Temporarily switch to unminified corescripts for debugging
This commit is contained in:
parent
005f005eb0
commit
6b2ca1f213
File diff suppressed because it is too large
Load Diff
|
|
@ -1,51 +1,245 @@
|
|||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||
'userdata'then h.Parent=e end end e.Parent=f return e end local b,c,d,e,f,g,h,i,
|
||||
j,k=Game:GetService'ContextActionService',Game:GetService'UserInputService'.
|
||||
TouchEnabled,{},{},nil,nil,'http://www.banland.xyz/asset/?id=97166756',
|
||||
'http://www.banland.xyz/asset/?id=97166444',{},{UDim2.new(0,123,0,70),UDim2.new(
|
||||
0,30,0,60),UDim2.new(0,180,0,160),UDim2.new(0,85,0,-25),UDim2.new(0,185,0,-25),
|
||||
UDim2.new(0,185,0,260),UDim2.new(0,216,0,65)}local l=#k do local m=Game:
|
||||
GetService'ContentProvider'm:Preload(h)m:Preload(i)end while not Game.Players do
|
||||
wait()end while not Game.Players.LocalPlayer do wait()end local m m=function()if
|
||||
not f and c then f=a('ScreenGui','ContextActionGui',{a('Frame',
|
||||
'ContextButtonFrame',{BackgroundTransparency=1,Size=UDim2.new(0.3,0,0.5,0),
|
||||
Position=UDim2.new(0.7,0,0.5,0)})})end end local n n=function(o,p,q)if p.
|
||||
UserInputType==Enum.UserInputType.Touch then o.Image=h return b:CallFunction(q,
|
||||
Enum.UserInputState.Begin)end end local o o=function(p,q,r)if q.UserInputType==
|
||||
Enum.UserInputType.Touch then p.Image=h return b:CallFunction(r,Enum.
|
||||
UserInputState.Change)end end local p p=function(q,r,s)q.Image=i if r.
|
||||
UserInputType==Enum.UserInputType.Touch and r.UserInputState==Enum.
|
||||
UserInputState.End then return b:CallFunction(s,Enum.UserInputState.End,r)end
|
||||
end local q q=function()return Game:GetService'GuiService':GetScreenResolution()
|
||||
.y<=320 end local r r=function(s,t)local u,v=a('ImageButton',
|
||||
'ContextActionButton',{BackgroundTransparency=1,Size=UDim2.new((function()if q()
|
||||
then return 0,90,0,90 else return 0,70,0,70 end end)()),Active=true,Image=i,
|
||||
Parent=g}),nil Game:GetService'UserInputService'.InputEnded:connect(function(w)j
|
||||
[w]=nil end)u.InputBegan:connect(function(w)if j[w]then return end if w.
|
||||
UserInputState==Enum.UserInputState.Begin and not(v~=nil)then v=w return n(u,w,s
|
||||
)end end)u.InputChanged:connect(function(w)if j[w]or v~=w then return end return
|
||||
o(u,w,s)end)u.InputEnded:connect(function(w)if j[w]or v~=w then return end v=nil
|
||||
j[w]=true return p(u,w,s)end)local w=a('ImageLabel','ActionIcon',{Position=UDim2
|
||||
.new(0.175,0,0.175,0),Size=UDim2.new(0.65,0,0.65,0),BackgroundTransparency=1})if
|
||||
t['image']and type(t['image'])=='string'then w.Image=t['image']end w.Parent=u
|
||||
local x=a('TextLabel','ActionTitle',{Size=UDim2.new(1,0,1,0),
|
||||
BackgroundTransparency=1,Font=Enum.Font.SourceSansBold,TextColor3=Color3.new(1,1
|
||||
,1),TextStrokeTransparency=0,FontSize=Enum.FontSize.Size18,TextWrapped=true,Text
|
||||
=''})if t['title']and type(t['title'])=='string'then x.Text=t['title']end x.
|
||||
Parent=u return u end local s s=function(t,u)local v,w=r(t,u),nil for x=1,#e do
|
||||
if e[x]=='empty'then w=x break end end if not w then w=#e+1 end if w>l then
|
||||
return end e[w]=v d[t]['button']=v v.Position=k[w]v.Parent=g if f and not(f.
|
||||
Parent~=nil)then f.Parent=Game.Players.LocalPlayer.PlayerGui end end local t t=
|
||||
function(u)if not d[u]then return end local v=d[u]['button']if v then v.Parent=
|
||||
nil for w=1,#e do if e[w]==v then e[w]='empty'break end end v:Destroy()end d[u]=
|
||||
nil end local u u=function(v,w,x)if d[v]then t(v)end d[v]={x}if w and c then m()
|
||||
return s(v,x)end end b.BoundActionChanged:connect(function(v,w,x)if d[v]and x
|
||||
then do local y=d[v]['button']if y then if w=='image'then y.ActionIcon.Image=x[w
|
||||
]elseif w=='title'then y.ActionTitle.Text=x[w]elseif w=='position'then y.
|
||||
Position=x[w]end end end end end)b.BoundActionAdded:connect(function(v,w,x)
|
||||
return u(v,w,x)end)b.BoundActionRemoved:connect(function(v,w)return t(v)end)b.
|
||||
GetActionButtonEvent:connect(function(v)if d[v]then return b:
|
||||
FireActionButtonFoundSignal(v,d[v]['button'])end end)local v=b:
|
||||
GetAllBoundActionInfo()for w,x in pairs(v)do u(w,x['createTouchButton'],x)end
|
||||
local New
|
||||
New = function(className, name, props)
|
||||
if not (props ~= nil) then
|
||||
props = name
|
||||
name = nil
|
||||
end
|
||||
local obj = Instance.new(className)
|
||||
if name then
|
||||
obj.Name = name
|
||||
end
|
||||
local parent
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" and type(v) == "userdata" then
|
||||
v.Parent = obj
|
||||
end
|
||||
end
|
||||
obj.Parent = parent
|
||||
return obj
|
||||
end
|
||||
local contextActionService = Game:GetService("ContextActionService")
|
||||
local isTouchDevice = Game:GetService("UserInputService").TouchEnabled
|
||||
local functionTable = { }
|
||||
local buttonVector = { }
|
||||
local buttonScreenGui
|
||||
local buttonFrame
|
||||
local ContextDownImage = "http://www.banland.xyz/asset/?id=97166756"
|
||||
local ContextUpImage = "http://www.banland.xyz/asset/?id=97166444"
|
||||
local oldTouches = { }
|
||||
local buttonPositionTable = {
|
||||
UDim2.new(0, 123, 0, 70),
|
||||
UDim2.new(0, 30, 0, 60),
|
||||
UDim2.new(0, 180, 0, 160),
|
||||
UDim2.new(0, 85, 0, -25),
|
||||
UDim2.new(0, 185, 0, -25),
|
||||
UDim2.new(0, 185, 0, 260),
|
||||
UDim2.new(0, 216, 0, 65)
|
||||
}
|
||||
local maxButtons = #buttonPositionTable
|
||||
do
|
||||
local _with_0 = Game:GetService("ContentProvider")
|
||||
_with_0:Preload(ContextDownImage)
|
||||
_with_0:Preload(ContextUpImage)
|
||||
end
|
||||
while not Game.Players do
|
||||
wait()
|
||||
end
|
||||
while not Game.Players.LocalPlayer do
|
||||
wait()
|
||||
end
|
||||
local createContextActionGui
|
||||
createContextActionGui = function()
|
||||
if not buttonScreenGui and isTouchDevice then
|
||||
buttonScreenGui = New("ScreenGui", "ContextActionGui", {
|
||||
New("Frame", "ContextButtonFrame", {
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new(0.3, 0, 0.5, 0),
|
||||
Position = UDim2.new(0.7, 0, 0.5, 0)
|
||||
})
|
||||
})
|
||||
end
|
||||
end
|
||||
local contextButtonDown
|
||||
contextButtonDown = function(button, inputObject, actionName)
|
||||
if inputObject.UserInputType == Enum.UserInputType.Touch then
|
||||
button.Image = ContextDownImage
|
||||
return contextActionService:CallFunction(actionName, Enum.UserInputState.Begin)
|
||||
end
|
||||
end
|
||||
local contextButtonMoved
|
||||
contextButtonMoved = function(button, inputObject, actionName)
|
||||
if inputObject.UserInputType == Enum.UserInputType.Touch then
|
||||
button.Image = ContextDownImage
|
||||
return contextActionService:CallFunction(actionName, Enum.UserInputState.Change)
|
||||
end
|
||||
end
|
||||
local contextButtonUp
|
||||
contextButtonUp = function(button, inputObject, actionName)
|
||||
button.Image = ContextUpImage
|
||||
if inputObject.UserInputType == Enum.UserInputType.Touch and inputObject.UserInputState == Enum.UserInputState.End then
|
||||
return contextActionService:CallFunction(actionName, Enum.UserInputState.End, inputObject)
|
||||
end
|
||||
end
|
||||
local isSmallScreenDevice
|
||||
isSmallScreenDevice = function()
|
||||
return Game:GetService("GuiService"):GetScreenResolution().y <= 320
|
||||
end
|
||||
local createNewButton
|
||||
createNewButton = function(actionName, functionInfoTable)
|
||||
local contextButton = New("ImageButton", "ContextActionButton", {
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new((function()
|
||||
if isSmallScreenDevice() then
|
||||
return 0, 90, 0, 90
|
||||
else
|
||||
return 0, 70, 0, 70
|
||||
end
|
||||
end)()),
|
||||
Active = true,
|
||||
Image = ContextUpImage,
|
||||
Parent = buttonFrame
|
||||
})
|
||||
local currentButtonTouch
|
||||
Game:GetService("UserInputService").InputEnded:connect(function(inputObject)
|
||||
oldTouches[inputObject] = nil
|
||||
end)
|
||||
contextButton.InputBegan:connect(function(inputObject)
|
||||
if oldTouches[inputObject] then
|
||||
return
|
||||
end
|
||||
if inputObject.UserInputState == Enum.UserInputState.Begin and not (currentButtonTouch ~= nil) then
|
||||
currentButtonTouch = inputObject
|
||||
return contextButtonDown(contextButton, inputObject, actionName)
|
||||
end
|
||||
end)
|
||||
contextButton.InputChanged:connect(function(inputObject)
|
||||
if oldTouches[inputObject] or currentButtonTouch ~= inputObject then
|
||||
return
|
||||
end
|
||||
return contextButtonMoved(contextButton, inputObject, actionName)
|
||||
end)
|
||||
contextButton.InputEnded:connect(function(inputObject)
|
||||
if oldTouches[inputObject] or currentButtonTouch ~= inputObject then
|
||||
return
|
||||
end
|
||||
currentButtonTouch = nil
|
||||
oldTouches[inputObject] = true
|
||||
return contextButtonUp(contextButton, inputObject, actionName)
|
||||
end)
|
||||
local actionIcon = New("ImageLabel", "ActionIcon", {
|
||||
Position = UDim2.new(0.175, 0, 0.175, 0),
|
||||
Size = UDim2.new(0.65, 0, 0.65, 0),
|
||||
BackgroundTransparency = 1
|
||||
})
|
||||
if functionInfoTable["image"] and type(functionInfoTable["image"]) == "string" then
|
||||
actionIcon.Image = functionInfoTable["image"]
|
||||
end
|
||||
actionIcon.Parent = contextButton
|
||||
local actionTitle = New("TextLabel", "ActionTitle", {
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
BackgroundTransparency = 1,
|
||||
Font = Enum.Font.SourceSansBold,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
TextStrokeTransparency = 0,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
TextWrapped = true,
|
||||
Text = ""
|
||||
})
|
||||
if functionInfoTable["title"] and type(functionInfoTable["title"]) == "string" then
|
||||
actionTitle.Text = functionInfoTable["title"]
|
||||
end
|
||||
actionTitle.Parent = contextButton
|
||||
return contextButton
|
||||
end
|
||||
local createButton
|
||||
createButton = function(actionName, functionInfoTable)
|
||||
local button = createNewButton(actionName, functionInfoTable)
|
||||
local position
|
||||
for i = 1, #buttonVector do
|
||||
if buttonVector[i] == "empty" then
|
||||
position = i
|
||||
break
|
||||
end
|
||||
end
|
||||
if not position then
|
||||
position = #buttonVector + 1
|
||||
end
|
||||
if position > maxButtons then
|
||||
return
|
||||
end
|
||||
buttonVector[position] = button
|
||||
functionTable[actionName]["button"] = button
|
||||
button.Position = buttonPositionTable[position]
|
||||
button.Parent = buttonFrame
|
||||
if buttonScreenGui and not (buttonScreenGui.Parent ~= nil) then
|
||||
buttonScreenGui.Parent = Game.Players.LocalPlayer.PlayerGui
|
||||
end
|
||||
end
|
||||
local removeAction
|
||||
removeAction = function(actionName)
|
||||
if not functionTable[actionName] then
|
||||
return
|
||||
end
|
||||
local actionButton = functionTable[actionName]["button"]
|
||||
if actionButton then
|
||||
actionButton.Parent = nil
|
||||
for i = 1, #buttonVector do
|
||||
if buttonVector[i] == actionButton then
|
||||
buttonVector[i] = "empty"
|
||||
break
|
||||
end
|
||||
end
|
||||
actionButton:Destroy()
|
||||
end
|
||||
functionTable[actionName] = nil
|
||||
end
|
||||
local addAction
|
||||
addAction = function(actionName, createTouchButton, functionInfoTable)
|
||||
if functionTable[actionName] then
|
||||
removeAction(actionName)
|
||||
end
|
||||
functionTable[actionName] = {
|
||||
functionInfoTable
|
||||
}
|
||||
if createTouchButton and isTouchDevice then
|
||||
createContextActionGui()
|
||||
return createButton(actionName, functionInfoTable)
|
||||
end
|
||||
end
|
||||
contextActionService.BoundActionChanged:connect(function(actionName, changeName, changeTable)
|
||||
if functionTable[actionName] and changeTable then
|
||||
do
|
||||
local button = functionTable[actionName]["button"]
|
||||
if button then
|
||||
if changeName == "image" then
|
||||
button.ActionIcon.Image = changeTable[changeName]
|
||||
elseif changeName == "title" then
|
||||
button.ActionTitle.Text = changeTable[changeName]
|
||||
elseif changeName == "position" then
|
||||
button.Position = changeTable[changeName]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
contextActionService.BoundActionAdded:connect(function(actionName, createTouchButton, functionInfoTable)
|
||||
return addAction(actionName, createTouchButton, functionInfoTable)
|
||||
end)
|
||||
contextActionService.BoundActionRemoved:connect(function(actionName, _)
|
||||
return removeAction(actionName)
|
||||
end)
|
||||
contextActionService.GetActionButtonEvent:connect(function(actionName)
|
||||
if functionTable[actionName] then
|
||||
return contextActionService:FireActionButtonFoundSignal(actionName, functionTable[actionName]["button"])
|
||||
end
|
||||
end)
|
||||
local boundActions = contextActionService:GetAllBoundActionInfo()
|
||||
for actionName, actionData in pairs(boundActions) do
|
||||
addAction(actionName, actionData["createTouchButton"], actionData)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,104 +1,526 @@
|
|||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||
'userdata'then h.Parent=e end end e.Parent=f return e end while not Game do
|
||||
wait()end while not Game:FindFirstChild'Players'do wait()end while not Game.
|
||||
Players.LocalPlayer do wait()end while not Game:FindFirstChild'CoreGui'do wait()
|
||||
end while not Game.CoreGui:FindFirstChild'RobloxGui'do wait()end local b=Game:
|
||||
GetService'UserInputService'local c=pcall(function()return b:IsLuaTouchControls(
|
||||
)end)if not c then script:Destroy()end local d,e=Game:GetService'GuiService':
|
||||
GetScreenResolution(),nil e=function()return d.y<=320 end local f,g=Game.Players
|
||||
.LocalPlayer,120 if e()then g=70 end local h,i,j,k,l=
|
||||
'rbxasset://textures/ui/TouchControlsSheet.png',5,0.92,{},90 if e()then l=70 end
|
||||
local m,n,o={},nil,0.007 local p,q,r,s=o*16,0.03,0.2,nil Game:GetService
|
||||
'ContentProvider':Preload(h)local t t=function(u,v)local w,x=v.x-u.x,v.y-u.y
|
||||
return math.sqrt(w*w+x*x)end local u u=function(v,w)return UDim2.new(0,v.x-w.
|
||||
AbsoluteSize.x/2,0,v.y-w.AbsoluteSize.y/2)end local v v=function(w,x,y)local z,A
|
||||
,B=math.sin(y),math.cos(y),w B=Vector2.new(B.x-x.x,B.y-x.y)local C,D=B.x*A-B.y*z
|
||||
,B.x*z+B.y*A B=Vector2.new(C+x.x,D+x.y)return B end local w w=function(x,y)
|
||||
return x.x*y.x+x.y*y.y end local x x=function(y,z,A)local B=Vector2.new(z.
|
||||
Position.X.Offset+z.AbsoluteSize.x/2,z.Position.Y.Offset+z.AbsoluteSize.y/2)
|
||||
local C=t(A,B)if C>(g/2)then local D=Vector2.new(A.x-B.x,A.y-B.y)local E=D.unit
|
||||
if E.x==math.nan or E.x==math.inf then E=Vector2.new(0,E.y)end if E.y==math.nan
|
||||
or E.y==math.inf then E=Vector2.new(E.x,0)end local F=B+(E*(g/2))y.Position=u(F,
|
||||
y)else y.Position=u(A,y)end return Vector2.new(y.Position.X.Offset-z.Position.X.
|
||||
Offset,y.Position.Y.Offset-z.Position.Y.Offset)end local y y=function(z,A,B)
|
||||
local C=Vector2.new(A.Position.X.Offset+A.AbsoluteSize.x/2,A.Position.Y.Offset+A
|
||||
.AbsoluteSize.y/2)if t(B,C)>g/2 then local D=Vector2.new(z.Position.X.Offset+z.
|
||||
AbsoluteSize.x/2,z.Position.Y.Offset+z.AbsoluteSize.y/2)local E,F=Vector2.new(B.
|
||||
x-D.x,B.y-D.y).unit,Vector2.new(D.x-C.x,D.y-C.y)local G,H=F.unit,Vector2.new(B.x
|
||||
-D.x,B.y-D.y)local I=(G.x*E.y)-(G.y*E.x)local J=math.atan2(I,w(G,E))local K=J*
|
||||
math.min(H.magnitude/F.magnitude,1)if math.abs(K)>0.00001 then local L=v(C,D,K)A
|
||||
.Position=u(Vector2.new(L.x,L.y),A)end A.Position=UDim2.new(0,A.Position.X.
|
||||
Offset+H.x,0,A.Position.Y.Offset+H.y)end z.Position=u(B,z)local D,E=Vector2.new(
|
||||
z.Position.X.Offset,z.Position.Y.Offset),Vector2.new(A.Position.X.Offset,A.
|
||||
Position.Y.Offset)if t(D,E)>g/2 then local F=(E-D).unit*g/2 A.Position=UDim2.
|
||||
new(0,D.x+F.x,0,D.y+F.y)end return Vector2.new(z.Position.X.Offset-A.Position.X.
|
||||
Offset,z.Position.Y.Offset-A.Position.Y.Offset)end local z z=function(A)return(
|
||||
math.abs(A.x)>i)or(math.abs(A.y)>i)end local A A=function(B,C,D)local E=a(
|
||||
'Frame','ThumbstickFrame',{Active=true,Size=UDim2.new(0,g,0,g),Position=B,
|
||||
BackgroundTransparency=1})a('ImageLabel','InnerThumbstick',{Image=h,
|
||||
ImageRectOffset=Vector2.new(220,0),ImageRectSize=Vector2.new(111,111),
|
||||
BackgroundTransparency=1,Size=UDim2.new(0,g/2,0,g/2),Position=UDim2.new(0,E.Size
|
||||
.X.Offset/2-g/4,0,E.Size.Y.Offset/2-g/4),ZIndex=2,Parent=E})local F,G,H,I,J=a(
|
||||
'ImageLabel','OuterThumbstick',{Image=h,ImageRectOffset=Vector2.new(0,0),
|
||||
ImageRectSize=Vector2.new(220,220),BackgroundTransparency=1,Size=UDim2.new(0,g,0
|
||||
,g),Position=B,Parent=Game.CoreGui.RobloxGui}),nil,nil,nil,nil J=function(K)if G
|
||||
then return end if K==s then return end if K==n then return end if K.
|
||||
UserInputType~=Enum.UserInputType.Touch then return end G=K table.insert(k,G)E.
|
||||
Position=u(G.Position,E)F.Position=E.Position H=b.TouchMoved:connect(function(L)
|
||||
if L==G then local M if D then M=x(E,F,Vector2.new(L.Position.x,L.Position.y))
|
||||
else M=y(E,F,Vector2.new(L.Position.x,L.Position.y))end if C then return C(M,F.
|
||||
Size.X.Offset/2)end end end)I=b.TouchEnded:connect(function(L)if L==G then if C
|
||||
then C(Vector2.new(0,0),1)end I:disconnect()H:disconnect()E.Position=B F.
|
||||
Position=B for M,N in pairs(k)do if N==G then table.remove(k,M)break end end G=
|
||||
nil end end)end b.Changed:connect(function(K)if K=='ModalEnabled'then do local L
|
||||
=not b.ModalEnabled E.Visible=L F.Visible=L end end end)E.InputBegan:connect(J)
|
||||
return E end local B B=function(C)local D,E,F,G=nil,nil,f.MoveCharacter,nil G=
|
||||
function(H,I)if f then if z(H)then D=H E=I if H.magnitude/I>j then I=H.magnitude
|
||||
-1 end return F(f,H,I)else D=Vector2.new(0,0)E=1 return F(f,D,E)end end end
|
||||
local H=UDim2.new(0,g/2,1,-g*1.75)if e()then H=UDim2.new(0,(g/2)-10,1,-g-20)end
|
||||
local I=A(H,G,false)I.Name='CharacterThumbstick'I.Parent=C local J J=function()
|
||||
if f and F and D and E then return F(f,D,E)end end return J end local C C=
|
||||
function(D)local E,F,G=a('ImageButton','JumpButton',{BackgroundTransparency=1,
|
||||
Image=h,ImageRectOffset=Vector2.new(176,222),ImageRectSize=Vector2.new(174,174),
|
||||
Size=UDim2.new(0,l,0,l),Position=UDim2.new(1,(function()if e()then return-(l*
|
||||
2.25),1,-l-20 else return-(l*2.75),1,-l-120 end end)())}),f.JumpCharacter,nil G=
|
||||
function()while n do if f then F(f)end wait(1.6666666666666665E-2)end end E.
|
||||
InputBegan:connect(function(H)if H.UserInputType~=Enum.UserInputType.Touch then
|
||||
return end if n then return end if H==s then return end for I,J in pairs(m)do if
|
||||
J==H then return end end n=H E.ImageRectOffset=Vector2.new(0,222)E.ImageRectSize
|
||||
=Vector2.new(174,174)return G()end)E.InputEnded:connect(function(H)if H.
|
||||
UserInputType~=Enum.UserInputType.Touch then return end E.ImageRectOffset=
|
||||
Vector2.new(176,222)E.ImageRectSize=Vector2.new(174,174)if H==n then table.
|
||||
insert(m,n)n=nil end end)b.InputEnded:connect(function(H)for I,J in pairs(m)do
|
||||
if J==H then table.remove(m,I)break end end end)b.Changed:connect(function(H)if
|
||||
H=='ModalEnabled'then E.Visible=not b.ModalEnabled end end)E.Parent=D end local
|
||||
D D=function(E)if E==n then return true end for F,G in pairs(m)do if E==G then
|
||||
return true end end return false end local E E=function(F)for G,H in pairs(k)do
|
||||
if F==H then return true end end return false end local F F=function(G,H)local I
|
||||
,J,K,L,M,N,O,P,Q,R=nil,false,b.RotateCamera,-1,false,nil,b.ZoomCamera,{},nil,nil
|
||||
R=function()s=nil J=false I=nil end local S S=function()P={}N=nil M=false Q:
|
||||
Destroy()Q=nil end local T T=function(U,V)if Q~=nil then Q:Destroy()end Q=a(
|
||||
'Frame',{Name='PinchFrame',BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),
|
||||
Parent=G})Q.InputChanged:connect(function(W)if not M then S()return end R()if
|
||||
not(N~=nil)then if W==U then N=(W.Position-V.Position).magnitude U=W elseif W==V
|
||||
then N=(W.Position-U.Position).magnitude V=W end else local X=0 if W==U then X=(
|
||||
W.Position-V.Position).magnitude U=W elseif W==V then X=(W.Position-U.Position).
|
||||
magnitude V=W end if X~=0 then local Y=X-N if Y~=0 then O(b,(Y*q))end N=X end
|
||||
end end)return Q.InputEnded:connect(function(W)if W==U or W==V then return S()
|
||||
end end)end local U U=function(V)if#P<1 then table.insert(P,V)L=tick()M=false
|
||||
elseif#P==1 then M=((tick()-L)<=r)if M then table.insert(P,V)return T(P[1],P[2])
|
||||
else P={}end end end G.InputBegan:connect(function(V)if V.UserInputType~=Enum.
|
||||
UserInputType.Touch then return end if D(V)then return end local W=E(V)if not W
|
||||
then U(V)end if not(s~=nil)and not W then s=V I=Vector2.new(s.Position.x,s.
|
||||
Position.y)end end)b.InputChanged:connect(function(V)if V.UserInputType~=Enum.
|
||||
UserInputType.Touch then return end if s~=V then return end local W=Vector2.new(
|
||||
s.Position.x,s.Position.y)local X=(I-W)*o if not J and(X.magnitude>p)then J=true
|
||||
I=W end if J and(I~=W)then K(b,X)H()I=W end end)return b.InputEnded:connect(
|
||||
function(V)if s==V or not(s~=nil)then R()end for W,X in pairs(P)do if X==V then
|
||||
table.remove(P,W)end end end)end local G G=function()local H=a('Frame',
|
||||
'TouchControlFrame',{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Parent=
|
||||
Game.CoreGui.RobloxGui})local I=B(H)C(H)F(H,I)return b.ProcessedEvent:connect(
|
||||
function(J,K)if not K then return end if J==s and J.UserInputState==Enum.
|
||||
UserInputState.Begin then s=nil end end)end return G()
|
||||
local New
|
||||
New = function(className, name, props)
|
||||
if not (props ~= nil) then
|
||||
props = name
|
||||
name = nil
|
||||
end
|
||||
local obj = Instance.new(className)
|
||||
if name then
|
||||
obj.Name = name
|
||||
end
|
||||
local parent
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" and type(v) == "userdata" then
|
||||
v.Parent = obj
|
||||
end
|
||||
end
|
||||
obj.Parent = parent
|
||||
return obj
|
||||
end
|
||||
while not Game do
|
||||
wait()
|
||||
end
|
||||
while not Game:FindFirstChild("Players") do
|
||||
wait()
|
||||
end
|
||||
while not Game.Players.LocalPlayer do
|
||||
wait()
|
||||
end
|
||||
while not Game:FindFirstChild("CoreGui") do
|
||||
wait()
|
||||
end
|
||||
while not Game.CoreGui:FindFirstChild("RobloxGui") do
|
||||
wait()
|
||||
end
|
||||
local userInputService = Game:GetService("UserInputService")
|
||||
local success = pcall(function()
|
||||
return userInputService:IsLuaTouchControls()
|
||||
end)
|
||||
if not success then
|
||||
script:Destroy()
|
||||
end
|
||||
local screenResolution = Game:GetService("GuiService"):GetScreenResolution()
|
||||
local isSmallScreenDevice
|
||||
isSmallScreenDevice = function()
|
||||
return screenResolution.y <= 320
|
||||
end
|
||||
local localPlayer = Game.Players.LocalPlayer
|
||||
local thumbstickSize = 120
|
||||
if isSmallScreenDevice() then
|
||||
thumbstickSize = 70
|
||||
end
|
||||
local touchControlsSheet = "rbxasset://textures/ui/TouchControlsSheet.png"
|
||||
local ThumbstickDeadZone = 5
|
||||
local ThumbstickMaxPercentGive = 0.92
|
||||
local thumbstickTouches = { }
|
||||
local jumpButtonSize = 90
|
||||
if isSmallScreenDevice() then
|
||||
jumpButtonSize = 70
|
||||
end
|
||||
local oldJumpTouches = { }
|
||||
local currentJumpTouch
|
||||
local CameraRotateSensitivity = 0.007
|
||||
local CameraRotateDeadZone = CameraRotateSensitivity * 16
|
||||
local CameraZoomSensitivity = 0.03
|
||||
local PinchZoomDelay = 0.2
|
||||
local cameraTouch
|
||||
Game:GetService("ContentProvider"):Preload(touchControlsSheet)
|
||||
local DistanceBetweenTwoPoints
|
||||
DistanceBetweenTwoPoints = function(point1, point2)
|
||||
local dx = point2.x - point1.x
|
||||
local dy = point2.y - point1.y
|
||||
return math.sqrt(dx * dx + dy * dy)
|
||||
end
|
||||
local transformFromCenterToTopLeft
|
||||
transformFromCenterToTopLeft = function(pointToTranslate, guiObject)
|
||||
return UDim2.new(0, pointToTranslate.x - guiObject.AbsoluteSize.x / 2, 0, pointToTranslate.y - guiObject.AbsoluteSize.y / 2)
|
||||
end
|
||||
local rotatePointAboutLocation
|
||||
rotatePointAboutLocation = function(pointToRotate, pointToRotateAbout, radians)
|
||||
local sinAnglePercent = math.sin(radians)
|
||||
local cosAnglePercent = math.cos(radians)
|
||||
local transformedPoint = pointToRotate
|
||||
transformedPoint = Vector2.new(transformedPoint.x - pointToRotateAbout.x, transformedPoint.y - pointToRotateAbout.y)
|
||||
local xNew = transformedPoint.x * cosAnglePercent - transformedPoint.y * sinAnglePercent
|
||||
local yNew = transformedPoint.x * sinAnglePercent + transformedPoint.y * cosAnglePercent
|
||||
transformedPoint = Vector2.new(xNew + pointToRotateAbout.x, yNew + pointToRotateAbout.y)
|
||||
return transformedPoint
|
||||
end
|
||||
local dotProduct
|
||||
dotProduct = function(v1, v2)
|
||||
return v1.x * v2.x + v1.y * v2.y
|
||||
end
|
||||
local stationaryThumbstickTouchMove
|
||||
stationaryThumbstickTouchMove = function(thumbstickFrame, thumbstickOuter, touchLocation)
|
||||
local thumbstickOuterCenterPosition = Vector2.new(thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2, thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2)
|
||||
local centerDiff = DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenterPosition)
|
||||
if centerDiff > (thumbstickSize / 2) then
|
||||
local thumbVector = Vector2.new(touchLocation.x - thumbstickOuterCenterPosition.x, touchLocation.y - thumbstickOuterCenterPosition.y)
|
||||
local normal = thumbVector.unit
|
||||
if normal.x == math.nan or normal.x == math.inf then
|
||||
normal = Vector2.new(0, normal.y)
|
||||
end
|
||||
if normal.y == math.nan or normal.y == math.inf then
|
||||
normal = Vector2.new(normal.x, 0)
|
||||
end
|
||||
local newThumbstickInnerPosition = thumbstickOuterCenterPosition + (normal * (thumbstickSize / 2))
|
||||
thumbstickFrame.Position = transformFromCenterToTopLeft(newThumbstickInnerPosition, thumbstickFrame)
|
||||
else
|
||||
thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame)
|
||||
end
|
||||
return Vector2.new(thumbstickFrame.Position.X.Offset - thumbstickOuter.Position.X.Offset, thumbstickFrame.Position.Y.Offset - thumbstickOuter.Position.Y.Offset)
|
||||
end
|
||||
local followThumbstickTouchMove
|
||||
followThumbstickTouchMove = function(thumbstickFrame, thumbstickOuter, touchLocation)
|
||||
local thumbstickOuterCenter = Vector2.new(thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2, thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2)
|
||||
if DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenter) > thumbstickSize / 2 then
|
||||
local thumbstickInnerCenter = Vector2.new(thumbstickFrame.Position.X.Offset + thumbstickFrame.AbsoluteSize.x / 2, thumbstickFrame.Position.Y.Offset + thumbstickFrame.AbsoluteSize.y / 2)
|
||||
local movementVectorUnit = Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y).unit
|
||||
local outerToInnerVectorCurrent = Vector2.new(thumbstickInnerCenter.x - thumbstickOuterCenter.x, thumbstickInnerCenter.y - thumbstickOuterCenter.y)
|
||||
local outerToInnerVectorCurrentUnit = outerToInnerVectorCurrent.unit
|
||||
local movementVector = Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y)
|
||||
local crossOuterToInnerWithMovement = (outerToInnerVectorCurrentUnit.x * movementVectorUnit.y) - (outerToInnerVectorCurrentUnit.y * movementVectorUnit.x)
|
||||
local angle = math.atan2(crossOuterToInnerWithMovement, dotProduct(outerToInnerVectorCurrentUnit, movementVectorUnit))
|
||||
local anglePercent = angle * math.min(movementVector.magnitude / outerToInnerVectorCurrent.magnitude, 1.0)
|
||||
if math.abs(anglePercent) > 0.00001 then
|
||||
local outerThumbCenter = rotatePointAboutLocation(thumbstickOuterCenter, thumbstickInnerCenter, anglePercent)
|
||||
thumbstickOuter.Position = transformFromCenterToTopLeft(Vector2.new(outerThumbCenter.x, outerThumbCenter.y), thumbstickOuter)
|
||||
end
|
||||
thumbstickOuter.Position = UDim2.new(0, thumbstickOuter.Position.X.Offset + movementVector.x, 0, thumbstickOuter.Position.Y.Offset + movementVector.y)
|
||||
end
|
||||
thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame)
|
||||
local thumbstickFramePosition = Vector2.new(thumbstickFrame.Position.X.Offset, thumbstickFrame.Position.Y.Offset)
|
||||
local thumbstickOuterPosition = Vector2.new(thumbstickOuter.Position.X.Offset, thumbstickOuter.Position.Y.Offset)
|
||||
if DistanceBetweenTwoPoints(thumbstickFramePosition, thumbstickOuterPosition) > thumbstickSize / 2 then
|
||||
local vectorWithLength = (thumbstickOuterPosition - thumbstickFramePosition).unit * thumbstickSize / 2
|
||||
thumbstickOuter.Position = UDim2.new(0, thumbstickFramePosition.x + vectorWithLength.x, 0, thumbstickFramePosition.y + vectorWithLength.y)
|
||||
end
|
||||
return Vector2.new(thumbstickFrame.Position.X.Offset - thumbstickOuter.Position.X.Offset, thumbstickFrame.Position.Y.Offset - thumbstickOuter.Position.Y.Offset)
|
||||
end
|
||||
local movementOutsideDeadZone
|
||||
movementOutsideDeadZone = function(movementVector)
|
||||
return (math.abs(movementVector.x) > ThumbstickDeadZone) or (math.abs(movementVector.y) > ThumbstickDeadZone)
|
||||
end
|
||||
local constructThumbstick
|
||||
constructThumbstick = function(defaultThumbstickPos, updateFunction, stationaryThumbstick)
|
||||
local thumbstickFrame = New("Frame", "ThumbstickFrame", {
|
||||
Active = true,
|
||||
Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize),
|
||||
Position = defaultThumbstickPos,
|
||||
BackgroundTransparency = 1
|
||||
})
|
||||
New("ImageLabel", "InnerThumbstick", {
|
||||
Image = touchControlsSheet,
|
||||
ImageRectOffset = Vector2.new(220, 0),
|
||||
ImageRectSize = Vector2.new(111, 111),
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new(0, thumbstickSize / 2, 0, thumbstickSize / 2),
|
||||
Position = UDim2.new(0, thumbstickFrame.Size.X.Offset / 2 - thumbstickSize / 4, 0, thumbstickFrame.Size.Y.Offset / 2 - thumbstickSize / 4),
|
||||
ZIndex = 2,
|
||||
Parent = thumbstickFrame
|
||||
})
|
||||
local outerThumbstick = New("ImageLabel", "OuterThumbstick", {
|
||||
Image = touchControlsSheet,
|
||||
ImageRectOffset = Vector2.new(0, 0),
|
||||
ImageRectSize = Vector2.new(220, 220),
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize),
|
||||
Position = defaultThumbstickPos,
|
||||
Parent = Game.CoreGui.RobloxGui
|
||||
})
|
||||
local thumbstickTouch
|
||||
local userInputServiceTouchMovedCon
|
||||
local userInputSeviceTouchEndedCon
|
||||
local startInputTracking
|
||||
startInputTracking = function(inputObject)
|
||||
if thumbstickTouch then
|
||||
return
|
||||
end
|
||||
if inputObject == cameraTouch then
|
||||
return
|
||||
end
|
||||
if inputObject == currentJumpTouch then
|
||||
return
|
||||
end
|
||||
if inputObject.UserInputType ~= Enum.UserInputType.Touch then
|
||||
return
|
||||
end
|
||||
thumbstickTouch = inputObject
|
||||
table.insert(thumbstickTouches, thumbstickTouch)
|
||||
thumbstickFrame.Position = transformFromCenterToTopLeft(thumbstickTouch.Position, thumbstickFrame)
|
||||
outerThumbstick.Position = thumbstickFrame.Position
|
||||
userInputServiceTouchMovedCon = userInputService.TouchMoved:connect(function(movedInput)
|
||||
if movedInput == thumbstickTouch then
|
||||
local movementVector
|
||||
if stationaryThumbstick then
|
||||
movementVector = stationaryThumbstickTouchMove(thumbstickFrame, outerThumbstick, Vector2.new(movedInput.Position.x, movedInput.Position.y))
|
||||
else
|
||||
movementVector = followThumbstickTouchMove(thumbstickFrame, outerThumbstick, Vector2.new(movedInput.Position.x, movedInput.Position.y))
|
||||
end
|
||||
if updateFunction then
|
||||
return updateFunction(movementVector, outerThumbstick.Size.X.Offset / 2)
|
||||
end
|
||||
end
|
||||
end)
|
||||
userInputSeviceTouchEndedCon = userInputService.TouchEnded:connect(function(endedInput)
|
||||
if endedInput == thumbstickTouch then
|
||||
if updateFunction then
|
||||
updateFunction(Vector2.new(0, 0), 1)
|
||||
end
|
||||
userInputSeviceTouchEndedCon:disconnect()
|
||||
userInputServiceTouchMovedCon:disconnect()
|
||||
thumbstickFrame.Position = defaultThumbstickPos
|
||||
outerThumbstick.Position = defaultThumbstickPos
|
||||
for i, object in pairs(thumbstickTouches) do
|
||||
if object == thumbstickTouch then
|
||||
table.remove(thumbstickTouches, i)
|
||||
break
|
||||
end
|
||||
end
|
||||
thumbstickTouch = nil
|
||||
end
|
||||
end)
|
||||
end
|
||||
userInputService.Changed:connect(function(prop)
|
||||
if prop == "ModalEnabled" then
|
||||
do
|
||||
local _tmp_0 = not userInputService.ModalEnabled
|
||||
thumbstickFrame.Visible = _tmp_0
|
||||
outerThumbstick.Visible = _tmp_0
|
||||
end
|
||||
end
|
||||
end)
|
||||
thumbstickFrame.InputBegan:connect(startInputTracking)
|
||||
return thumbstickFrame
|
||||
end
|
||||
local setupCharacterMovement
|
||||
setupCharacterMovement = function(parentFrame)
|
||||
local lastMovementVector, lastMaxMovement
|
||||
local moveCharacterFunc = localPlayer.MoveCharacter
|
||||
local moveCharacterFunction
|
||||
moveCharacterFunction = function(movementVector, maxMovement)
|
||||
if localPlayer then
|
||||
if movementOutsideDeadZone(movementVector) then
|
||||
lastMovementVector = movementVector
|
||||
lastMaxMovement = maxMovement
|
||||
if movementVector.magnitude / maxMovement > ThumbstickMaxPercentGive then
|
||||
maxMovement = movementVector.magnitude - 1
|
||||
end
|
||||
return moveCharacterFunc(localPlayer, movementVector, maxMovement)
|
||||
else
|
||||
lastMovementVector = Vector2.new(0, 0)
|
||||
lastMaxMovement = 1
|
||||
return moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement)
|
||||
end
|
||||
end
|
||||
end
|
||||
local thumbstickPos = UDim2.new(0, thumbstickSize / 2, 1, -thumbstickSize * 1.75)
|
||||
if isSmallScreenDevice() then
|
||||
thumbstickPos = UDim2.new(0, (thumbstickSize / 2) - 10, 1, -thumbstickSize - 20)
|
||||
end
|
||||
local characterThumbstick = constructThumbstick(thumbstickPos, moveCharacterFunction, false)
|
||||
characterThumbstick.Name = "CharacterThumbstick"
|
||||
characterThumbstick.Parent = parentFrame
|
||||
local refreshCharacterMovement
|
||||
refreshCharacterMovement = function()
|
||||
if localPlayer and moveCharacterFunc and lastMovementVector and lastMaxMovement then
|
||||
return moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement)
|
||||
end
|
||||
end
|
||||
return refreshCharacterMovement
|
||||
end
|
||||
local setupJumpButton
|
||||
setupJumpButton = function(parentFrame)
|
||||
local jumpButton = New("ImageButton", "JumpButton", {
|
||||
BackgroundTransparency = 1,
|
||||
Image = touchControlsSheet,
|
||||
ImageRectOffset = Vector2.new(176, 222),
|
||||
ImageRectSize = Vector2.new(174, 174),
|
||||
Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize),
|
||||
Position = UDim2.new(1, (function()
|
||||
if isSmallScreenDevice() then
|
||||
return -(jumpButtonSize * 2.25), 1, -jumpButtonSize - 20
|
||||
else
|
||||
return -(jumpButtonSize * 2.75), 1, -jumpButtonSize - 120
|
||||
end
|
||||
end)())
|
||||
})
|
||||
local playerJumpFunc = localPlayer.JumpCharacter
|
||||
local doJumpLoop
|
||||
doJumpLoop = function()
|
||||
while currentJumpTouch do
|
||||
if localPlayer then
|
||||
playerJumpFunc(localPlayer)
|
||||
end
|
||||
wait(1 / 60)
|
||||
end
|
||||
end
|
||||
jumpButton.InputBegan:connect(function(inputObject)
|
||||
if inputObject.UserInputType ~= Enum.UserInputType.Touch then
|
||||
return
|
||||
end
|
||||
if currentJumpTouch then
|
||||
return
|
||||
end
|
||||
if inputObject == cameraTouch then
|
||||
return
|
||||
end
|
||||
for _, touch in pairs(oldJumpTouches) do
|
||||
if touch == inputObject then
|
||||
return
|
||||
end
|
||||
end
|
||||
currentJumpTouch = inputObject
|
||||
jumpButton.ImageRectOffset = Vector2.new(0, 222)
|
||||
jumpButton.ImageRectSize = Vector2.new(174, 174)
|
||||
return doJumpLoop()
|
||||
end)
|
||||
jumpButton.InputEnded:connect(function(inputObject)
|
||||
if inputObject.UserInputType ~= Enum.UserInputType.Touch then
|
||||
return
|
||||
end
|
||||
jumpButton.ImageRectOffset = Vector2.new(176, 222)
|
||||
jumpButton.ImageRectSize = Vector2.new(174, 174)
|
||||
if inputObject == currentJumpTouch then
|
||||
table.insert(oldJumpTouches, currentJumpTouch)
|
||||
currentJumpTouch = nil
|
||||
end
|
||||
end)
|
||||
userInputService.InputEnded:connect(function(globalInputObject)
|
||||
for i, touch in pairs(oldJumpTouches) do
|
||||
if touch == globalInputObject then
|
||||
table.remove(oldJumpTouches, i)
|
||||
break
|
||||
end
|
||||
end
|
||||
end)
|
||||
userInputService.Changed:connect(function(prop)
|
||||
if prop == "ModalEnabled" then
|
||||
jumpButton.Visible = not userInputService.ModalEnabled
|
||||
end
|
||||
end)
|
||||
jumpButton.Parent = parentFrame
|
||||
end
|
||||
local isTouchUsedByJumpButton
|
||||
isTouchUsedByJumpButton = function(touch)
|
||||
if touch == currentJumpTouch then
|
||||
return true
|
||||
end
|
||||
for _, touchToCompare in pairs(oldJumpTouches) do
|
||||
if touch == touchToCompare then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
local isTouchUsedByThumbstick
|
||||
isTouchUsedByThumbstick = function(touch)
|
||||
for _, touchToCompare in pairs(thumbstickTouches) do
|
||||
if touch == touchToCompare then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
local setupCameraControl
|
||||
setupCameraControl = function(parentFrame, refreshCharacterMoveFunc)
|
||||
local lastPos
|
||||
local hasRotatedCamera = false
|
||||
local rotateCameraFunc = userInputService.RotateCamera
|
||||
local pinchTime = -1
|
||||
local shouldPinch = false
|
||||
local lastPinchScale
|
||||
local zoomCameraFunc = userInputService.ZoomCamera
|
||||
local pinchTouches = { }
|
||||
local pinchFrame
|
||||
local resetCameraRotateState
|
||||
resetCameraRotateState = function()
|
||||
cameraTouch = nil
|
||||
hasRotatedCamera = false
|
||||
lastPos = nil
|
||||
end
|
||||
local resetPinchState
|
||||
resetPinchState = function()
|
||||
pinchTouches = { }
|
||||
lastPinchScale = nil
|
||||
shouldPinch = false
|
||||
pinchFrame:Destroy()
|
||||
pinchFrame = nil
|
||||
end
|
||||
local startPinch
|
||||
startPinch = function(firstTouch, secondTouch)
|
||||
if pinchFrame ~= nil then
|
||||
pinchFrame:Destroy()
|
||||
end
|
||||
pinchFrame = New("Frame", {
|
||||
Name = "PinchFrame",
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Parent = parentFrame
|
||||
})
|
||||
pinchFrame.InputChanged:connect(function(inputObject)
|
||||
if not shouldPinch then
|
||||
resetPinchState()
|
||||
return
|
||||
end
|
||||
resetCameraRotateState()
|
||||
if not (lastPinchScale ~= nil) then
|
||||
if inputObject == firstTouch then
|
||||
lastPinchScale = (inputObject.Position - secondTouch.Position).magnitude
|
||||
firstTouch = inputObject
|
||||
elseif inputObject == secondTouch then
|
||||
lastPinchScale = (inputObject.Position - firstTouch.Position).magnitude
|
||||
secondTouch = inputObject
|
||||
end
|
||||
else
|
||||
local newPinchDistance = 0
|
||||
if inputObject == firstTouch then
|
||||
newPinchDistance = (inputObject.Position - secondTouch.Position).magnitude
|
||||
firstTouch = inputObject
|
||||
elseif inputObject == secondTouch then
|
||||
newPinchDistance = (inputObject.Position - firstTouch.Position).magnitude
|
||||
secondTouch = inputObject
|
||||
end
|
||||
if newPinchDistance ~= 0 then
|
||||
local pinchDiff = newPinchDistance - lastPinchScale
|
||||
if pinchDiff ~= 0 then
|
||||
zoomCameraFunc(userInputService, (pinchDiff * CameraZoomSensitivity))
|
||||
end
|
||||
lastPinchScale = newPinchDistance
|
||||
end
|
||||
end
|
||||
end)
|
||||
return pinchFrame.InputEnded:connect(function(inputObject)
|
||||
if inputObject == firstTouch or inputObject == secondTouch then
|
||||
return resetPinchState()
|
||||
end
|
||||
end)
|
||||
end
|
||||
local pinchGestureReceivedTouch
|
||||
pinchGestureReceivedTouch = function(inputObject)
|
||||
if #pinchTouches < 1 then
|
||||
table.insert(pinchTouches, inputObject)
|
||||
pinchTime = tick()
|
||||
shouldPinch = false
|
||||
elseif #pinchTouches == 1 then
|
||||
shouldPinch = ((tick() - pinchTime) <= PinchZoomDelay)
|
||||
if shouldPinch then
|
||||
table.insert(pinchTouches, inputObject)
|
||||
return startPinch(pinchTouches[1], pinchTouches[2])
|
||||
else
|
||||
pinchTouches = { }
|
||||
end
|
||||
end
|
||||
end
|
||||
parentFrame.InputBegan:connect(function(inputObject)
|
||||
if inputObject.UserInputType ~= Enum.UserInputType.Touch then
|
||||
return
|
||||
end
|
||||
if isTouchUsedByJumpButton(inputObject) then
|
||||
return
|
||||
end
|
||||
local usedByThumbstick = isTouchUsedByThumbstick(inputObject)
|
||||
if not usedByThumbstick then
|
||||
pinchGestureReceivedTouch(inputObject)
|
||||
end
|
||||
if not (cameraTouch ~= nil) and not usedByThumbstick then
|
||||
cameraTouch = inputObject
|
||||
lastPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y)
|
||||
end
|
||||
end)
|
||||
userInputService.InputChanged:connect(function(inputObject)
|
||||
if inputObject.UserInputType ~= Enum.UserInputType.Touch then
|
||||
return
|
||||
end
|
||||
if cameraTouch ~= inputObject then
|
||||
return
|
||||
end
|
||||
local newPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y)
|
||||
local touchDiff = (lastPos - newPos) * CameraRotateSensitivity
|
||||
if not hasRotatedCamera and (touchDiff.magnitude > CameraRotateDeadZone) then
|
||||
hasRotatedCamera = true
|
||||
lastPos = newPos
|
||||
end
|
||||
if hasRotatedCamera and (lastPos ~= newPos) then
|
||||
rotateCameraFunc(userInputService, touchDiff)
|
||||
refreshCharacterMoveFunc()
|
||||
lastPos = newPos
|
||||
end
|
||||
end)
|
||||
return userInputService.InputEnded:connect(function(inputObject)
|
||||
if cameraTouch == inputObject or not (cameraTouch ~= nil) then
|
||||
resetCameraRotateState()
|
||||
end
|
||||
for i, touch in pairs(pinchTouches) do
|
||||
if touch == inputObject then
|
||||
table.remove(pinchTouches, i)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
local setupTouchControls
|
||||
setupTouchControls = function()
|
||||
local touchControlFrame = New("Frame", "TouchControlFrame", {
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
BackgroundTransparency = 1,
|
||||
Parent = Game.CoreGui.RobloxGui
|
||||
})
|
||||
local refreshCharacterMoveFunc = setupCharacterMovement(touchControlFrame)
|
||||
setupJumpButton(touchControlFrame)
|
||||
setupCameraControl(touchControlFrame, refreshCharacterMoveFunc)
|
||||
return userInputService.ProcessedEvent:connect(function(inputObject, processed)
|
||||
if not processed then
|
||||
return
|
||||
end
|
||||
if inputObject == cameraTouch and inputObject.UserInputState == Enum.UserInputState.Begin then
|
||||
cameraTouch = nil
|
||||
end
|
||||
end)
|
||||
end
|
||||
return setupTouchControls()
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,27 +1,126 @@
|
|||
local a=script.Parent:FindFirstChild'ControlFrame'if not a then return end local
|
||||
b b=function(c,d,e)if not(e~=nil)then e=d d=nil end local f=Instance.new(c)if d
|
||||
then f.Name=d end local g for h,i in pairs(e)do if type(h)=='string'then if h==
|
||||
'Parent'then g=i else f[h]=i end elseif type(h)=='number'and type(i)=='userdata'
|
||||
then i.Parent=f end end f.Parent=g return f end local c,d,e,f=a:FindFirstChild
|
||||
'BottomLeftControl',a:FindFirstChild'BottomRightControl',b('TextLabel','ToolTip'
|
||||
,{Text='',Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size12,TextColor3=
|
||||
Color3.new(1,1,1),BorderSizePixel=0,ZIndex=10,Size=UDim2.new(2,0,1,0),Position=
|
||||
UDim2.new(1,0,0,0),BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,
|
||||
TextTransparency=1,TextWrap=true,b('BoolValue','inside',{Value=false})}),nil f=
|
||||
function(g)local h=0.1 g.Parent.MouseEnter:connect(function()if g:FindFirstChild
|
||||
'inside'then g.inside.Value=true wait(1.2)if g.inside.Value then while g.inside.
|
||||
Value and g.BackgroundTransparency>0 do g.BackgroundTransparency=g.
|
||||
BackgroundTransparency-h g.TextTransparency=g.TextTransparency-h wait()end end
|
||||
end end)local i i=function(j)j.inside.Value=false j.BackgroundTransparency=1 j.
|
||||
TextTransparency=1 end g.Parent.MouseLeave:connect(function()return i(g)end)
|
||||
return g.Parent.MouseButton1Click:connect(function()return i(g)end)end local g g
|
||||
=function(h)if not(h~=nil)then h=c:FindFirstChild'SettingsButton'end local i=e:
|
||||
clone()i.RobloxLocked=true i.Text='Settings/Leave Game'i.Position=UDim2.new(0,0,
|
||||
0,-18)i.Size=UDim2.new(0,120,0,20)i.Parent=h f(i)return i end wait(5)local h=c:
|
||||
GetChildren()for i=1,#h do if h[i].Name=='Exit'then do local j=e:clone()j.
|
||||
RobloxLocked=true j.Text='Leave Place'j.Position=UDim2.new(0,0,-1,0)j.Size=UDim2
|
||||
.new(1,0,1,0)j.Parent=h[i]f(j)end elseif h[i].Name=='SettingsButton'then g(h[i])
|
||||
end end local i=d:GetChildren()for j=1,#i do if(i[j].Name:find'Camera'~=nil)then
|
||||
do local k=e:clone()k.RobloxLocked=true k.Text='Camera View'if i[j].Name:find
|
||||
'Zoom'then k.Position=UDim2.new(-1,0,-1.5)else k.Position=UDim2.new(0,0,-1.5,0)
|
||||
end k.Size=UDim2.new(2,0,1.25,0)k.Parent=i[j]f(k)end end end
|
||||
local controlFrame = script.Parent:FindFirstChild("ControlFrame")
|
||||
if not controlFrame then
|
||||
return
|
||||
end
|
||||
local New
|
||||
New = function(className, name, props)
|
||||
if not (props ~= nil) then
|
||||
props = name
|
||||
name = nil
|
||||
end
|
||||
local obj = Instance.new(className)
|
||||
if name then
|
||||
obj.Name = name
|
||||
end
|
||||
local parent
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" and type(v) == "userdata" then
|
||||
v.Parent = obj
|
||||
end
|
||||
end
|
||||
obj.Parent = parent
|
||||
return obj
|
||||
end
|
||||
local bottomLeftControl = controlFrame:FindFirstChild("BottomLeftControl")
|
||||
local bottomRightControl = controlFrame:FindFirstChild("BottomRightControl")
|
||||
local frameTip = New("TextLabel", "ToolTip", {
|
||||
Text = "",
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size12,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
BorderSizePixel = 0,
|
||||
ZIndex = 10,
|
||||
Size = UDim2.new(2, 0, 1, 0),
|
||||
Position = UDim2.new(1, 0, 0, 0),
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BackgroundTransparency = 1,
|
||||
TextTransparency = 1,
|
||||
TextWrap = true,
|
||||
New("BoolValue", "inside", {
|
||||
Value = false
|
||||
})
|
||||
})
|
||||
local setUpListeners
|
||||
setUpListeners = function(frameToListen)
|
||||
local fadeSpeed = 0.1
|
||||
frameToListen.Parent.MouseEnter:connect(function()
|
||||
if frameToListen:FindFirstChild("inside") then
|
||||
frameToListen.inside.Value = true
|
||||
wait(1.2)
|
||||
if frameToListen.inside.Value then
|
||||
while frameToListen.inside.Value and frameToListen.BackgroundTransparency > 0 do
|
||||
frameToListen.BackgroundTransparency = frameToListen.BackgroundTransparency - fadeSpeed
|
||||
frameToListen.TextTransparency = frameToListen.TextTransparency - fadeSpeed
|
||||
wait()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
local killTip
|
||||
killTip = function(killFrame)
|
||||
killFrame.inside.Value = false
|
||||
killFrame.BackgroundTransparency = 1
|
||||
killFrame.TextTransparency = 1
|
||||
end
|
||||
frameToListen.Parent.MouseLeave:connect(function()
|
||||
return killTip(frameToListen)
|
||||
end)
|
||||
return frameToListen.Parent.MouseButton1Click:connect(function()
|
||||
return killTip(frameToListen)
|
||||
end)
|
||||
end
|
||||
local createSettingsButtonTip
|
||||
createSettingsButtonTip = function(parent)
|
||||
if not (parent ~= nil) then
|
||||
parent = bottomLeftControl:FindFirstChild("SettingsButton")
|
||||
end
|
||||
local toolTip = frameTip:clone()
|
||||
toolTip.RobloxLocked = true
|
||||
toolTip.Text = "Settings/Leave Game"
|
||||
toolTip.Position = UDim2.new(0, 0, 0, -18)
|
||||
toolTip.Size = UDim2.new(0, 120, 0, 20)
|
||||
toolTip.Parent = parent
|
||||
setUpListeners(toolTip)
|
||||
return toolTip
|
||||
end
|
||||
wait(5)
|
||||
local bottomLeftChildren = bottomLeftControl:GetChildren()
|
||||
for i = 1, #bottomLeftChildren do
|
||||
if bottomLeftChildren[i].Name == "Exit" then
|
||||
do
|
||||
local exitTip = frameTip:clone()
|
||||
exitTip.RobloxLocked = true
|
||||
exitTip.Text = "Leave Place"
|
||||
exitTip.Position = UDim2.new(0, 0, -1, 0)
|
||||
exitTip.Size = UDim2.new(1, 0, 1, 0)
|
||||
exitTip.Parent = bottomLeftChildren[i]
|
||||
setUpListeners(exitTip)
|
||||
end
|
||||
elseif bottomLeftChildren[i].Name == "SettingsButton" then
|
||||
createSettingsButtonTip(bottomLeftChildren[i])
|
||||
end
|
||||
end
|
||||
local bottomRightChildren = bottomRightControl:GetChildren()
|
||||
for i = 1, #bottomRightChildren do
|
||||
if (bottomRightChildren[i].Name:find("Camera") ~= nil) then
|
||||
do
|
||||
local cameraTip = frameTip:clone()
|
||||
cameraTip.RobloxLocked = true
|
||||
cameraTip.Text = "Camera View"
|
||||
if bottomRightChildren[i].Name:find("Zoom") then
|
||||
cameraTip.Position = UDim2.new(-1, 0, -1.5)
|
||||
else
|
||||
cameraTip.Position = UDim2.new(0, 0, -1.5, 0)
|
||||
end
|
||||
cameraTip.Size = UDim2.new(2, 0, 1.25, 0)
|
||||
cameraTip.Parent = bottomRightChildren[i]
|
||||
setUpListeners(cameraTip)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,33 +1,68 @@
|
|||
local a,b=game:GetService'ScriptContext',false pcall(function()b=game:GetService
|
||||
'UserInputService'.TouchEnabled end)a:AddCoreScript(60595695,a,
|
||||
'/Libraries/LibraryRegistration/LibraryRegistration')local c c=function(d,e)
|
||||
while not d:FindFirstChild(e)do d.ChildAdded:wait()end end a=game:GetService
|
||||
'ScriptContext'a:AddCoreScript(59002209,a,'CoreScripts/Sections')c(game:
|
||||
GetService'CoreGui','RobloxGui')local d=game:GetService'CoreGui':FindFirstChild
|
||||
'RobloxGui'if not b then a:AddCoreScript(36868950,d,'CoreScripts/ToolTip')a:
|
||||
AddCoreScript(46295863,d,'CoreScripts/Settings')else a:AddCoreScript(153556783,d
|
||||
,'CoreScripts/TouchControls')end a:AddCoreScript(39250920,d,
|
||||
'CoreScripts/MainBotChatScript')a:AddCoreScript(48488451,d,
|
||||
'CoreScripts/PopupScript')a:AddCoreScript(48488398,d,
|
||||
'CoreScripts/NotificationScript')a:AddCoreScript(97188756,d,
|
||||
'CoreScripts/ChatScript')a:AddCoreScript(107893730,d,
|
||||
'CoreScripts/PurchasePromptScript')if not b or d.AbsoluteSize.Y>600 then a:
|
||||
AddCoreScript(48488235,d,'CoreScripts/PlayerListScript')else delay(5,function()
|
||||
if d.AbsoluteSize.Y>=600 then return a:AddCoreScript(48488235,d,
|
||||
'CoreScripts/PlayerListScript')end end)end if game.CoreGui.Version>=3 and game.
|
||||
PlaceId~=130815926 then a:AddCoreScript(53878047,d,
|
||||
'CoreScripts/BackpackScripts/BackpackBuilder')c(d,'CurrentLoadout')c(d,
|
||||
'Backpack')local e=d.Backpack if game.CoreGui.Version>=7 then a:AddCoreScript(
|
||||
89449093,e,'CoreScripts/BackpackScripts/BackpackManager')end a:AddCoreScript(
|
||||
89449008,e,'CoreScripts/BackpackScripts/BackpackGear')a:AddCoreScript(53878057,d
|
||||
.CurrentLoadout,'CoreScripts/BackpackScripts/LoadoutScript')if game.CoreGui.
|
||||
Version>=8 then a:AddCoreScript(-1,e,
|
||||
'CoreScripts/BackpackScripts/BackpackWardrobe')end end local e=not not game.
|
||||
Workspace:FindFirstChild'PSVariable'if e then a:AddCoreScript(64164692,game.
|
||||
Players.LocalPlayer,'BuildToolManager')end game.Workspace.ChildAdded:connect(
|
||||
function(f)if f.Name=='PSVariable'and f:IsA'BoolValue'then e=true return a:
|
||||
AddCoreScript(64164692,game.Players.LocalPlayer,'BuildToolManager')end end)if b
|
||||
then a:AddCoreScript(152908679,d,'CoreScripts/ContextActionTouch')c(d,
|
||||
'ControlFrame')c(d.ControlFrame,'BottomLeftControl')d.ControlFrame.
|
||||
BottomLeftControl.Visible=false c(d.ControlFrame,'TopLeftControl')d.ControlFrame
|
||||
.TopLeftControl.Visible=false end
|
||||
local scriptContext = game:GetService("ScriptContext")
|
||||
local touchEnabled = false
|
||||
pcall(function()
|
||||
touchEnabled = game:GetService("UserInputService").TouchEnabled
|
||||
end)
|
||||
scriptContext:AddCoreScript(60595695, scriptContext, "/Libraries/LibraryRegistration/LibraryRegistration")
|
||||
local waitForChild
|
||||
waitForChild = function(instance, name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
instance.ChildAdded:wait()
|
||||
end
|
||||
end
|
||||
scriptContext = game:GetService("ScriptContext")
|
||||
scriptContext:AddCoreScript(59002209, scriptContext, "CoreScripts/Sections")
|
||||
waitForChild(game:GetService("CoreGui"), "RobloxGui")
|
||||
local screenGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui")
|
||||
if not touchEnabled then
|
||||
scriptContext:AddCoreScript(36868950, screenGui, "CoreScripts/ToolTip")
|
||||
scriptContext:AddCoreScript(46295863, screenGui, "CoreScripts/Settings")
|
||||
else
|
||||
scriptContext:AddCoreScript(153556783, screenGui, "CoreScripts/TouchControls")
|
||||
end
|
||||
scriptContext:AddCoreScript(39250920, screenGui, "CoreScripts/MainBotChatScript")
|
||||
scriptContext:AddCoreScript(48488451, screenGui, "CoreScripts/PopupScript")
|
||||
scriptContext:AddCoreScript(48488398, screenGui, "CoreScripts/NotificationScript")
|
||||
scriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript")
|
||||
scriptContext:AddCoreScript(107893730, screenGui, "CoreScripts/PurchasePromptScript")
|
||||
if not touchEnabled or screenGui.AbsoluteSize.Y > 600 then
|
||||
scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript")
|
||||
else
|
||||
delay(5, function()
|
||||
if screenGui.AbsoluteSize.Y >= 600 then
|
||||
return scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript")
|
||||
end
|
||||
end)
|
||||
end
|
||||
if game.CoreGui.Version >= 3 and game.PlaceId ~= 130815926 then
|
||||
scriptContext:AddCoreScript(53878047, screenGui, "CoreScripts/BackpackScripts/BackpackBuilder")
|
||||
waitForChild(screenGui, "CurrentLoadout")
|
||||
waitForChild(screenGui, "Backpack")
|
||||
local Backpack = screenGui.Backpack
|
||||
if game.CoreGui.Version >= 7 then
|
||||
scriptContext:AddCoreScript(89449093, Backpack, "CoreScripts/BackpackScripts/BackpackManager")
|
||||
end
|
||||
scriptContext:AddCoreScript(89449008, Backpack, "CoreScripts/BackpackScripts/BackpackGear")
|
||||
scriptContext:AddCoreScript(53878057, screenGui.CurrentLoadout, "CoreScripts/BackpackScripts/LoadoutScript")
|
||||
if game.CoreGui.Version >= 8 then
|
||||
scriptContext:AddCoreScript(-1, Backpack, "CoreScripts/BackpackScripts/BackpackWardrobe")
|
||||
end
|
||||
end
|
||||
local IsPersonalServer = not not game.Workspace:FindFirstChild("PSVariable")
|
||||
if IsPersonalServer then
|
||||
scriptContext:AddCoreScript(64164692, game.Players.LocalPlayer, "BuildToolManager")
|
||||
end
|
||||
game.Workspace.ChildAdded:connect(function(nchild)
|
||||
if nchild.Name == "PSVariable" and nchild:IsA("BoolValue") then
|
||||
IsPersonalServer = true
|
||||
return scriptContext:AddCoreScript(64164692, game.Players.LocalPlayer, "BuildToolManager")
|
||||
end
|
||||
end)
|
||||
if touchEnabled then
|
||||
scriptContext:AddCoreScript(152908679, screenGui, "CoreScripts/ContextActionTouch")
|
||||
waitForChild(screenGui, "ControlFrame")
|
||||
waitForChild(screenGui.ControlFrame, "BottomLeftControl")
|
||||
screenGui.ControlFrame.BottomLeftControl.Visible = false
|
||||
waitForChild(screenGui.ControlFrame, "TopLeftControl")
|
||||
screenGui.ControlFrame.TopLeftControl.Visible = false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,49 +1,230 @@
|
|||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||
'userdata'then h.Parent=e end end e.Parent=f return e end local b,c,d=5,5,nil d=
|
||||
function(e,f)local g=e:findFirstChild(f)if g then return g end while true do g=e
|
||||
.ChildAdded:wait()if g.Name==f then return g end end end local e=script.Parent
|
||||
local f,g,h,i=d(e,'Humanoid'),d(e,'Torso'),e:FindFirstChild'PlayerStats',
|
||||
Instance.new'BoolValue'i.Name='InCharTag'local j=Instance.new'BoolValue'j.Name=
|
||||
'RobloxBuildTool'if not(h~=nil)then h=a('Configuration','PlayerStats',{Parent=e}
|
||||
)end local k=h:FindFirstChild'MaxHealth'if not(k~=nil)then k=a('NumberValue',
|
||||
'MaxHealth',{Value=100,Parent=h})end f.MaxHealth=k.Value f.Health=k.Value local
|
||||
l l=function()f.MaxHealth=k.Value f.Health=k.Value end k.Changed:connect(l)local
|
||||
m=game.Players:GetPlayerFromCharacter(script.Parent)local n=m.PlayerGui:
|
||||
FindFirstChild'DamageOverTimeGui'if not(n~=nil)then n=a('BillboardGui',
|
||||
'DamageOverTimeGui',{Parent=m.PlayerGui,Adornee=script.Parent:FindFirstChild
|
||||
'Head',Active=true,size=UDim2.new(b,0,c,0),StudsOffset=Vector3.new(0,2,0)})end
|
||||
print'newHealth declarations finished'local o o=function(p)local q=a('TextLabel'
|
||||
,{Text=tostring(p),TextColor3=(function()if p>0 then return Color3.new(0,1,0)
|
||||
else return Color3.new(1,0,1)end end)(),size=UDim2.new(1,0,1,0),Active=true,
|
||||
FontSize=6,BackgroundTransparency=1,Parent=n})for r=1,10 do wait(0.1)q.
|
||||
TextTransparency=r/10 q.Position=UDim2.new(0,0,0,-r*5)q.FontSize=6-r*0.6 end
|
||||
return q:remove()end local p p=function()if k.Value>=0 then f.MaxHealth=k.Value
|
||||
print(f.MaxHealth)if f.Health>f.MaxHealth then f.Health=f.MaxHealth end end end
|
||||
k.Changed:connect(p)local q=a('Fire','FireEffect',{Heat=0.1,Size=3,Enabled=false
|
||||
})while true do local r,s=wait(1),f.Health if s>0 then local t=0 if h then local
|
||||
u,v,w,x,y=h:FindFirstChild'Regen',h:FindFirstChild'Poison',h:FindFirstChild'Ice'
|
||||
,h:FindFirstChild'Fire',h:FindFirstChild'Stun'if u then t=t+u.Value.X if u.Value
|
||||
.Y>=0 then u.Value=Vector3.new(u.Value.X+u.Value.Z,u.Value.Y-r,u.Value.Z)elseif
|
||||
u.Value.Y==-1 then u.Value=Vector3.new(u.Value.X+u.Value.Z,-1,u.Value.Z)else u:
|
||||
remove()end end if v then t=t-v.Value.X if v.Value.Y>=0 then v.Value=Vector3.
|
||||
new(v.Value.X+v.Value.Z,v.Value.Y-r,v.Value.Z)elseif v.Value.Y==-1 then v.Value=
|
||||
Vector3.new(v.Value.X+v.Value.Z,-1,v.Value.Z)else v:remove()end end if w then t=
|
||||
t-w.Value.X if w.Value.Y>=0 then w.Value=Vector3.new(w.Value.X,w.Value.Y-r,w.
|
||||
Value.Z)else w:remove()end end if x then q.Enabled=true q.Parent=e.Torso t=t-x.
|
||||
Value.X if x.Value.Y>=0 then x.Value=Vector3.new(x.Value.X,x.Value.Y-r,x.Value.Z
|
||||
)else x:remove()q.Enabled=false q.Parent=nil end end if y then local z if y.
|
||||
Value>0 then g.Anchored=true local A=script.Parent:GetChildren()z=game.Players:
|
||||
GetPlayerFromCharacter(script.Parent).Backpack:GetChildren()for B=1,#A do if A[B
|
||||
].className=='Tool'then i:Clone().Parent=A[B]print(z)table.insert(z,A[B])end end
|
||||
for B=1,#z do if not(z[B]:FindFirstChild'RobloxBuildTool'~=nil)then j:Clone().
|
||||
Parent=z[B]z[B].Parent=game.Lighting end end wait(0.2)for B=1,#z do z[B].Parent=
|
||||
game.Players:GetPlayerFromCharacter(script.Parent).Backpack end y.Value=y.Value-
|
||||
r else g.Anchored=false for A=1,#z do local B=z[A]:FindFirstChild
|
||||
'RobloxBuildTool'if B then B:Remove()end z[A].Parent=game.Lighting end wait(0.2)
|
||||
for A=1,#z do local B=z[A]:FindFirstChild'InCharTag'if B then B:Remove()z[A].
|
||||
Parent=script.Parent else z[A].Parent=game.Players:GetPlayerFromCharacter(script
|
||||
.Parent).Backpack end end y:Remove()end end if t~=0 then coroutine.resume(
|
||||
coroutine.create(o),t)end end s=f.Health+t*r if s*1.01<f.MaxHealth then f.Health
|
||||
=s elseif t>0 then f.Health=f.MaxHealth end end end
|
||||
local New
|
||||
New = function(className, name, props)
|
||||
if not (props ~= nil) then
|
||||
props = name
|
||||
name = nil
|
||||
end
|
||||
local obj = Instance.new(className)
|
||||
if name then
|
||||
obj.Name = name
|
||||
end
|
||||
local parent
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" and type(v) == "userdata" then
|
||||
v.Parent = obj
|
||||
end
|
||||
end
|
||||
obj.Parent = parent
|
||||
return obj
|
||||
end
|
||||
local damageGuiWidth = 5.0
|
||||
local damageGuiHeight = 5.0
|
||||
local waitForChild
|
||||
waitForChild = function(parent, childName)
|
||||
local child = parent:findFirstChild(childName)
|
||||
if child then
|
||||
return child
|
||||
end
|
||||
while true do
|
||||
child = parent.ChildAdded:wait()
|
||||
if child.Name == childName then
|
||||
return child
|
||||
end
|
||||
end
|
||||
end
|
||||
local Figure = script.Parent
|
||||
local Humanoid = waitForChild(Figure, "Humanoid")
|
||||
local Torso = waitForChild(Figure, "Torso")
|
||||
local config = Figure:FindFirstChild("PlayerStats")
|
||||
local inCharTag = Instance.new("BoolValue")
|
||||
inCharTag.Name = "InCharTag"
|
||||
local hider = Instance.new("BoolValue")
|
||||
hider.Name = "RobloxBuildTool"
|
||||
if not (config ~= nil) then
|
||||
config = New("Configuration", "PlayerStats", {
|
||||
Parent = Figure
|
||||
})
|
||||
end
|
||||
local myHealth = config:FindFirstChild("MaxHealth")
|
||||
if not (myHealth ~= nil) then
|
||||
myHealth = New("NumberValue", "MaxHealth", {
|
||||
Value = 100,
|
||||
Parent = config
|
||||
})
|
||||
end
|
||||
Humanoid.MaxHealth = myHealth.Value
|
||||
Humanoid.Health = myHealth.Value
|
||||
local onMaxHealthChange
|
||||
onMaxHealthChange = function()
|
||||
Humanoid.MaxHealth = myHealth.Value
|
||||
Humanoid.Health = myHealth.Value
|
||||
end
|
||||
myHealth.Changed:connect(onMaxHealthChange)
|
||||
local vPlayer = game.Players:GetPlayerFromCharacter(script.Parent)
|
||||
local dotGui = vPlayer.PlayerGui:FindFirstChild("DamageOverTimeGui")
|
||||
if not (dotGui ~= nil) then
|
||||
dotGui = New("BillboardGui", "DamageOverTimeGui", {
|
||||
Parent = vPlayer.PlayerGui,
|
||||
Adornee = script.Parent:FindFirstChild("Head"),
|
||||
Active = true,
|
||||
size = UDim2.new(damageGuiWidth, 0, damageGuiHeight, 0.0),
|
||||
StudsOffset = Vector3.new(0, 2.0, 0.0)
|
||||
})
|
||||
end
|
||||
print("newHealth declarations finished")
|
||||
local billboardHealthChange
|
||||
billboardHealthChange = function(dmg)
|
||||
local textLabel = New("TextLabel", {
|
||||
Text = tostring(dmg),
|
||||
TextColor3 = (function()
|
||||
if dmg > 0 then
|
||||
return Color3.new(0, 1, 0)
|
||||
else
|
||||
return Color3.new(1, 0, 1)
|
||||
end
|
||||
end)(),
|
||||
size = UDim2.new(1, 0, 1, 0.0),
|
||||
Active = true,
|
||||
FontSize = 6,
|
||||
BackgroundTransparency = 1,
|
||||
Parent = dotGui
|
||||
})
|
||||
for t = 1, 10 do
|
||||
wait(0.1)
|
||||
textLabel.TextTransparency = t / 10
|
||||
textLabel.Position = UDim2.new(0, 0, 0, -t * 5)
|
||||
textLabel.FontSize = 6 - t * 0.6
|
||||
end
|
||||
return textLabel:remove()
|
||||
end
|
||||
local setMaxHealth
|
||||
setMaxHealth = function()
|
||||
if myHealth.Value >= 0 then
|
||||
Humanoid.MaxHealth = myHealth.Value
|
||||
print(Humanoid.MaxHealth)
|
||||
if Humanoid.Health > Humanoid.MaxHealth then
|
||||
Humanoid.Health = Humanoid.MaxHealth
|
||||
end
|
||||
end
|
||||
end
|
||||
myHealth.Changed:connect(setMaxHealth)
|
||||
local fireEffect = New("Fire", "FireEffect", {
|
||||
Heat = 0.1,
|
||||
Size = 3.0,
|
||||
Enabled = false
|
||||
})
|
||||
while true do
|
||||
local s = wait(1)
|
||||
local health = Humanoid.Health
|
||||
if health > 0 then
|
||||
local delta = 0
|
||||
if config then
|
||||
local regen = config:FindFirstChild("Regen")
|
||||
local poison = config:FindFirstChild("Poison")
|
||||
local ice = config:FindFirstChild("Ice")
|
||||
local fire = config:FindFirstChild("Fire")
|
||||
local stun = config:FindFirstChild("Stun")
|
||||
if regen then
|
||||
delta = delta + regen.Value.X
|
||||
if regen.Value.Y >= 0 then
|
||||
regen.Value = Vector3.new(regen.Value.X + regen.Value.Z, regen.Value.Y - s, regen.Value.Z)
|
||||
elseif regen.Value.Y == -1 then
|
||||
regen.Value = Vector3.new(regen.Value.X + regen.Value.Z, -1, regen.Value.Z)
|
||||
else
|
||||
regen:remove()
|
||||
end
|
||||
end
|
||||
if poison then
|
||||
delta = delta - poison.Value.X
|
||||
if poison.Value.Y >= 0 then
|
||||
poison.Value = Vector3.new(poison.Value.X + poison.Value.Z, poison.Value.Y - s, poison.Value.Z)
|
||||
elseif poison.Value.Y == -1 then
|
||||
poison.Value = Vector3.new(poison.Value.X + poison.Value.Z, -1, poison.Value.Z)
|
||||
else
|
||||
poison:remove()
|
||||
end
|
||||
end
|
||||
if ice then
|
||||
delta = delta - ice.Value.X
|
||||
if ice.Value.Y >= 0 then
|
||||
ice.Value = Vector3.new(ice.Value.X, ice.Value.Y - s, ice.Value.Z)
|
||||
else
|
||||
ice:remove()
|
||||
end
|
||||
end
|
||||
if fire then
|
||||
fireEffect.Enabled = true
|
||||
fireEffect.Parent = Figure.Torso
|
||||
delta = delta - fire.Value.X
|
||||
if fire.Value.Y >= 0 then
|
||||
fire.Value = Vector3.new(fire.Value.X, fire.Value.Y - s, fire.Value.Z)
|
||||
else
|
||||
fire:remove()
|
||||
fireEffect.Enabled = false
|
||||
fireEffect.Parent = nil
|
||||
end
|
||||
end
|
||||
if stun then
|
||||
local backpackTools
|
||||
if stun.Value > 0 then
|
||||
Torso.Anchored = true
|
||||
local currentChildren = script.Parent:GetChildren()
|
||||
backpackTools = game.Players:GetPlayerFromCharacter(script.Parent).Backpack:GetChildren()
|
||||
for i = 1, #currentChildren do
|
||||
if currentChildren[i].className == "Tool" then
|
||||
inCharTag:Clone().Parent = currentChildren[i]
|
||||
print(backpackTools)
|
||||
table.insert(backpackTools, currentChildren[i])
|
||||
end
|
||||
end
|
||||
for i = 1, #backpackTools do
|
||||
if not (backpackTools[i]:FindFirstChild("RobloxBuildTool") ~= nil) then
|
||||
hider:Clone().Parent = backpackTools[i]
|
||||
backpackTools[i].Parent = game.Lighting
|
||||
end
|
||||
end
|
||||
wait(0.2)
|
||||
for i = 1, #backpackTools do
|
||||
backpackTools[i].Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack
|
||||
end
|
||||
stun.Value = stun.Value - s
|
||||
else
|
||||
Torso.Anchored = false
|
||||
for i = 1, #backpackTools do
|
||||
local rbTool = backpackTools[i]:FindFirstChild("RobloxBuildTool")
|
||||
if rbTool then
|
||||
rbTool:Remove()
|
||||
end
|
||||
backpackTools[i].Parent = game.Lighting
|
||||
end
|
||||
wait(0.2)
|
||||
for i = 1, #backpackTools do
|
||||
local wasInChar = backpackTools[i]:FindFirstChild("InCharTag")
|
||||
if wasInChar then
|
||||
wasInChar:Remove()
|
||||
backpackTools[i].Parent = script.Parent
|
||||
else
|
||||
backpackTools[i].Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack
|
||||
end
|
||||
end
|
||||
stun:Remove()
|
||||
end
|
||||
end
|
||||
if delta ~= 0 then
|
||||
coroutine.resume(coroutine.create(billboardHealthChange), delta)
|
||||
end
|
||||
end
|
||||
health = Humanoid.Health + delta * s
|
||||
if health * 1.01 < Humanoid.MaxHealth then
|
||||
Humanoid.Health = health
|
||||
elseif delta > 0 then
|
||||
Humanoid.Health = Humanoid.MaxHealth
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,131 +1,541 @@
|
|||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||
'userdata'then h.Parent=e end end e.Parent=f return e end local b b=function(c,d
|
||||
)while not c[d]do c.Changed:wait()end end local c c=function(d,e)while not d:
|
||||
FindFirstChild(e)do d.ChildAdded:wait()end end local d,e,f,g,h,i,j,k,l,m,n,o,p,q
|
||||
,r,s,t,u,v,w,x=nil,{},nil,{},nil,nil,nil,'You are too far away to chat!',300,
|
||||
'Chat ended because you walked away',350,"Chat ended because you didn't reply",
|
||||
350,nil,nil,nil,nil,nil,{},{},nil c(game,'CoreGui')c(game.CoreGui,'RobloxGui')if
|
||||
game.CoreGui.RobloxGui:FindFirstChild'ControlFrame'then x=game.CoreGui.RobloxGui
|
||||
.ControlFrame else x=game.CoreGui.RobloxGui end local y y=function()if h then
|
||||
return h.Tone else return Enum.DialogTone.Neutral end end local z z=function()r=
|
||||
a('BillboardGui','ChatNotificationGui',{ExtentsOffset=Vector3.new(0,1,0),Size=
|
||||
UDim2.new(4,0,5.42857122,0),SizeOffset=Vector2.new(0,0),StudsOffset=Vector3.new(
|
||||
0.4,4.3,0),Enabled=true,RobloxLocked=true,Active=true,a('ImageLabel','Image',{
|
||||
Active=false,BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.
|
||||
new(1,0,1,0),Image='',RobloxLocked=true,a('ImageButton','Button',{
|
||||
AutoButtonColor=false,Position=UDim2.new(0.088,0,0.053,0),Size=UDim2.new(0.83,0,
|
||||
0.46,0),Image='',BackgroundTransparency=1,RobloxLocked=true})})})end local A A=
|
||||
function(B)if B==Enum.DialogTone.Neutral then return Enum.ChatColor.Blue elseif
|
||||
B==Enum.DialogTone.Friendly then return Enum.ChatColor.Green elseif B==Enum.
|
||||
DialogTone.Enemy then return Enum.ChatColor.Red end end local B B=function(C,D)
|
||||
if D==Enum.DialogTone.Neutral then C.BackgroundColor3=Color3.new(0,0,
|
||||
0.7019607843137254)C.Number.TextColor3=Color3.new(0.17647058823529413,
|
||||
0.5568627450980392,0.9607843137254902)elseif D==Enum.DialogTone.Friendly then C.
|
||||
BackgroundColor3=Color3.new(0,0.30196078431372547,0)C.Number.TextColor3=Color3.
|
||||
new(0,0.7450980392156863,0)elseif D==Enum.DialogTone.Enemy then C.
|
||||
BackgroundColor3=Color3.new(0.5490196078431373,0,0)C.Number.TextColor3=Color3.
|
||||
new(1,0.34509803921568627,0.30980392156862746)end end local C C=function(D)for E
|
||||
,F in pairs(e)do B(F,D)end return B(f,D)end local D D=function(E)if E==Enum.
|
||||
DialogTone.Neutral then d.Style=Enum.FrameStyle.ChatBlue d.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botBlue_tailRight.png'elseif E==Enum.DialogTone.
|
||||
Friendly then d.Style=Enum.FrameStyle.ChatGreen d.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botGreen_tailRight.png'elseif E==Enum.DialogTone
|
||||
.Enemy then d.Style=Enum.FrameStyle.ChatRed d.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botRed_tailRight.png'end return C(E)end local E
|
||||
E=function(F,G,H)if H==Enum.DialogTone.Neutral then F.Image.Image=
|
||||
'rbxasset://textures/chatBubble_botBlue_notify_bkg.png'elseif H==Enum.DialogTone
|
||||
.Friendly then F.Image.Image=
|
||||
'rbxasset://textures/chatBubble_botGreen_notify_bkg.png'elseif H==Enum.
|
||||
DialogTone.Enemy then F.Image.Image=
|
||||
'rbxasset://textures/chatBubble_botRed_notify_bkg.png'end if G==Enum.
|
||||
DialogPurpose.Quest then F.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_bang.png'elseif G==Enum.DialogPurpose
|
||||
.Help then F.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_question.png'elseif G==Enum.
|
||||
DialogPurpose.Shop then F.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_money.png'end end local F F=function(
|
||||
)s=a('Frame','DialogScriptMessage',{Style=Enum.FrameStyle.RobloxRound,Visible=
|
||||
false,a('TextLabel','Text',{Position=UDim2.new(0,0,0,-1),Size=UDim2.new(1,0,1,0)
|
||||
,FontSize=Enum.FontSize.Size14,BackgroundTransparency=1,TextColor3=Color3.new(1,
|
||||
1,1),RobloxLocked=true})})end local G G=function(H,I)s.Text.Text=H s.Size=UDim2.
|
||||
new(0,I,0,40)s.Position=UDim2.new(0.5,-I/2,0.5,-40)s.Visible=true wait(2)s.
|
||||
Visible=false return s end local H H=function(I)local J=math.min(string.len(I),
|
||||
100)return wait(0.75+(J/75)*1.5)end local I I=function(J,K)if K==Enum.DialogTone
|
||||
.Neutral then J.BackgroundColor3=Color3.new(7.8431372549019605E-3,
|
||||
0.4235294117647059,1)J.Number.TextColor3=Color3.new(1,1,1)elseif K==Enum.
|
||||
DialogTone.Friendly then J.BackgroundColor3=Color3.new(0,0.5019607843137255,0)J.
|
||||
Number.TextColor3=Color3.new(1,1,1)elseif K==Enum.DialogTone.Enemy then J.
|
||||
BackgroundColor3=Color3.new(0.8,0,0)J.Number.TextColor3=Color3.new(1,1,1)end end
|
||||
local J J=function()if j then j:Remove()j=nil end local K=h h=nil if K and K.
|
||||
InUse then local L=u:Clone()L.archivable=false L.Disabled=false L.Parent=K end
|
||||
for L,M in pairs(v)do if L and M then M.Enabled=not L.InUse end end i=nil end
|
||||
local L L=function()print'Wander'd.Visible=false J()return G(m,n)end local M M=
|
||||
function()print'Timeout'd.Visible=false J()return G(o,p)end local N N=function()
|
||||
print'Done'return J()end local O O=function(P)if string.len(P)==0 then return
|
||||
'...'else return P end end local P P=function(Q)if j then j:Remove()j=nil end j=
|
||||
t:Clone()j.archivable=false j.Disabled=false j.Parent=Q return j end local Q Q=
|
||||
function(R,S)if not h then return end i=R local T={}for U,V in pairs(S)do if V:
|
||||
IsA'DialogChoice'then table.insert(T,V)end end table.sort(T,function(W,X)return
|
||||
W.Name<X.Name end)if#T==0 then N()return end local W,X=1,0 g={}for Y,Z in pairs(
|
||||
e)do Z.Visible=false end for _,aa in pairs(T)do if W<=#e then e[W].Size=UDim2.
|
||||
new(1,0,0,72)e[W].UserPrompt.Text=aa.UserDialog local ab=math.ceil(e[W].
|
||||
UserPrompt.TextBounds.Y/24)*24 e[W].Position=UDim2.new(0,0,0,X)e[W].Size=UDim2.
|
||||
new(1,0,0,ab)e[W].Visible=true g[e[W]]=aa X=X+ab W=W+1 end end f.Position=UDim2.
|
||||
new(0,0,0,X)f.Number.Text=W..')'d.Size=UDim2.new(0,350,0,X+24+32)d.Position=
|
||||
UDim2.new(0,20,0,-d.Size.Y.Offset-20)D(y())d.Visible=true end local aa aa=
|
||||
function(ab)P(h)d.Visible=false if ab==f then game.Chat:Chat(game.Players.
|
||||
LocalPlayer.Character,'Goodbye!',A(y()))return N()else local R=g[ab]game.Chat:
|
||||
Chat(game.Players.LocalPlayer.Character,O(R.UserDialog),A(y()))wait(1)h:
|
||||
SignalDialogChoiceSelected(q,R)game.Chat:Chat(i,O(R.ResponseDialog),A(y()))H(R.
|
||||
ResponseDialog)return Q(i,R:GetChildren())end end local ab ab=function(R)local S
|
||||
=a('TextButton',{BackgroundColor3=Color3.new(0,0,0.7019607843137254),
|
||||
AutoButtonColor=false,BorderSizePixel=0,Text='',RobloxLocked=true,a('TextLabel',
|
||||
'Number',{TextColor3=Color3.new(0.4980392156862745,0.8313725490196079,1),Text=R,
|
||||
FontSize=Enum.FontSize.Size14,BackgroundTransparency=1,Position=UDim2.new(0,4,0,
|
||||
2),Size=UDim2.new(0,20,0,24),TextXAlignment=Enum.TextXAlignment.Left,
|
||||
TextYAlignment=Enum.TextYAlignment.Top,RobloxLocked=true}),a('TextLabel',
|
||||
'UserPrompt',{BackgroundTransparency=1,TextColor3=Color3.new(1,1,1),FontSize=
|
||||
Enum.FontSize.Size14,Position=UDim2.new(0,28,0,2),Size=UDim2.new(1,-32,1,-4),
|
||||
TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top,
|
||||
TextWrap=true,RobloxLocked=true})})S.MouseEnter:connect(function()return I(S,y()
|
||||
)end)S.MouseLeave:connect(function()return B(S,y())end)S.MouseButton1Click:
|
||||
connect(function()return aa(S)end)return S end local R R=function(S)e[1]=ab'1)'e
|
||||
[2]=ab'2)'e[3]=ab'3)'e[4]=ab'4)'f=ab'5)'f.UserPrompt.Text='Goodbye!'f.Size=UDim2
|
||||
.new(1,0,0,28)d=a('Frame','UserDialogArea',{Size=UDim2.new(0,350,0,200),Style=
|
||||
Enum.FrameStyle.ChatBlue,Visible=false,a('ImageLabel','Tail',{Size=UDim2.new(0,
|
||||
62,0,53),Position=UDim2.new(1,8,0.25),Image=
|
||||
'rbxasset://textures/chatBubble_botBlue_tailRight.png',BackgroundTransparency=1,
|
||||
RobloxLocked=true})})for T,W in pairs(e)do W.RobloxLocked=true W.Parent=d f.
|
||||
RobloxLocked=true end f.Parent=d d.RobloxLocked=true d.Parent=S end local S S=
|
||||
function(T)while not Instance.Lock(T,q)do wait()end if T.InUse then Instance.
|
||||
Unlock(T)return else T.InUse=true Instance.Unlock(T)end h=T game.Chat:Chat(T.
|
||||
Parent,T.InitialPrompt,A(T.Tone))H(T.InitialPrompt)return Q(T.Parent,T:
|
||||
GetChildren())end local T T=function()while h do if h.Parent and(q:
|
||||
DistanceFromCharacter(h.Parent.Position>=h.ConversationDistance))then L()end
|
||||
wait(1)end end local W W=function(X)if X.Parent and X.Parent:IsA'BasePart'then
|
||||
if q:DistanceFromCharacter(X.Parent.Position)>=X.ConversationDistance then G(k,l
|
||||
)return end for _,ac in pairs(v)do if _ and ac then ac.Enabled=false end end P(_
|
||||
)delay(1,T)return S(_)end end local ac ac=function(X)if v[X]then v[X]:Remove()v[
|
||||
X]=nil end if w[X]then w[X]:disconnect()w[X]=nil end end local X X=function(_)if
|
||||
_.Parent then if _.Parent:IsA'BasePart'then local ad=r:clone()ad.Enabled=not _.
|
||||
InUse ad.Adornee=_.Parent ad.RobloxLocked=true ad.Parent=game.CoreGui ad.Image.
|
||||
Button.MouseButton1Click:connect(function()return W(_)end)E(ad,_.Purpose,_.Tone)
|
||||
v[_]=ad w[_]=_.Changed:connect(function(ae)if ae=='Parent'and _.Parent then ac(_
|
||||
)return X(_)elseif ae=='InUse'then ad.Enabled=not h and not _.InUse if _==h then
|
||||
return M()end elseif ae=='Tone'or ae=='Purpose'then return E(ad,_.Purpose,_.Tone
|
||||
)end end)else w[_]=_.Changed:connect(function(ad)if ad=='Parent'and _.Parent
|
||||
then ac(_)return X(_)end end)end end end local ad ad=function()local ae=game:
|
||||
GetService'InsertService':LoadAsset(39226062)if type(ae)=='string'then wait(0.1)
|
||||
ae=game:GetService'InsertService':LoadAsset(39226062)end if type(ae)=='string'
|
||||
then return end c(ae,'TimeoutScript')t=ae.TimeoutScript c(ae,
|
||||
'ReenableDialogScript')u=ae.ReenableDialogScript end local ae ae=function()b(
|
||||
game.Players,'LocalPlayer')q=game.Players.LocalPlayer b(q,'Character')ad()z()F()
|
||||
s.RobloxLocked=true s.Parent=x c(x,'BottomLeftControl')local _=a('Frame',
|
||||
'DialogFrame',{Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,0,0,0),
|
||||
BackgroundTransparency=1,RobloxLocked=true,Parent=x.BottomLeftControl})R(_)game.
|
||||
CollectionService.ItemAdded:connect(function(af)if af:IsA'Dialog'then return X(
|
||||
af)end end)game.CollectionService.ItemRemoved:connect(function(af)if af:IsA
|
||||
'Dialog'then return ac(af)end end)for af,ag in pairs(game.CollectionService:
|
||||
GetCollection'Dialog')do if ag:IsA'Dialog'then X(ag)end end end return ae()
|
||||
local New
|
||||
New = function(className, name, props)
|
||||
if not (props ~= nil) then
|
||||
props = name
|
||||
name = nil
|
||||
end
|
||||
local obj = Instance.new(className)
|
||||
if name then
|
||||
obj.Name = name
|
||||
end
|
||||
local parent
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" and type(v) == "userdata" then
|
||||
v.Parent = obj
|
||||
end
|
||||
end
|
||||
obj.Parent = parent
|
||||
return obj
|
||||
end
|
||||
local waitForProperty
|
||||
waitForProperty = function(instance, name)
|
||||
while not instance[name] do
|
||||
instance.Changed:wait()
|
||||
end
|
||||
end
|
||||
local waitForChild
|
||||
waitForChild = function(instance, name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
instance.ChildAdded:wait()
|
||||
end
|
||||
end
|
||||
local mainFrame
|
||||
local choices = { }
|
||||
local lastChoice
|
||||
local choiceMap = { }
|
||||
local currentConversationDialog
|
||||
local currentConversationPartner
|
||||
local currentAbortDialogScript
|
||||
local tooFarAwayMessage = "You are too far away to chat!"
|
||||
local tooFarAwaySize = 300
|
||||
local characterWanderedOffMessage = "Chat ended because you walked away"
|
||||
local characterWanderedOffSize = 350
|
||||
local conversationTimedOut = "Chat ended because you didn't reply"
|
||||
local conversationTimedOutSize = 350
|
||||
local player
|
||||
local chatNotificationGui
|
||||
local messageDialog
|
||||
local timeoutScript
|
||||
local reenableDialogScript
|
||||
local dialogMap = { }
|
||||
local dialogConnections = { }
|
||||
local gui
|
||||
waitForChild(game, "CoreGui")
|
||||
waitForChild(game.CoreGui, "RobloxGui")
|
||||
if game.CoreGui.RobloxGui:FindFirstChild("ControlFrame") then
|
||||
gui = game.CoreGui.RobloxGui.ControlFrame
|
||||
else
|
||||
gui = game.CoreGui.RobloxGui
|
||||
end
|
||||
local currentTone
|
||||
currentTone = function()
|
||||
if currentConversationDialog then
|
||||
return currentConversationDialog.Tone
|
||||
else
|
||||
return Enum.DialogTone.Neutral
|
||||
end
|
||||
end
|
||||
local createChatNotificationGui
|
||||
createChatNotificationGui = function()
|
||||
chatNotificationGui = New("BillboardGui", "ChatNotificationGui", {
|
||||
ExtentsOffset = Vector3.new(0, 1, 0),
|
||||
Size = UDim2.new(4, 0, 5.42857122, 0),
|
||||
SizeOffset = Vector2.new(0, 0),
|
||||
StudsOffset = Vector3.new(0.4, 4.3, 0),
|
||||
Enabled = true,
|
||||
RobloxLocked = true,
|
||||
Active = true,
|
||||
New("ImageLabel", "Image", {
|
||||
Active = false,
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Image = "",
|
||||
RobloxLocked = true,
|
||||
New("ImageButton", "Button", {
|
||||
AutoButtonColor = false,
|
||||
Position = UDim2.new(0.088, 0, 0.053, 0),
|
||||
Size = UDim2.new(0.83, 0, 0.46, 0),
|
||||
Image = "",
|
||||
BackgroundTransparency = 1,
|
||||
RobloxLocked = true
|
||||
})
|
||||
})
|
||||
})
|
||||
end
|
||||
local getChatColor
|
||||
getChatColor = function(tone)
|
||||
if tone == Enum.DialogTone.Neutral then
|
||||
return Enum.ChatColor.Blue
|
||||
elseif tone == Enum.DialogTone.Friendly then
|
||||
return Enum.ChatColor.Green
|
||||
elseif tone == Enum.DialogTone.Enemy then
|
||||
return Enum.ChatColor.Red
|
||||
end
|
||||
end
|
||||
local resetColor
|
||||
resetColor = function(frame, tone)
|
||||
if tone == Enum.DialogTone.Neutral then
|
||||
frame.BackgroundColor3 = Color3.new(0, 0, 179 / 255)
|
||||
frame.Number.TextColor3 = Color3.new(45 / 255, 142 / 255, 245 / 255)
|
||||
elseif tone == Enum.DialogTone.Friendly then
|
||||
frame.BackgroundColor3 = Color3.new(0, 77 / 255, 0)
|
||||
frame.Number.TextColor3 = Color3.new(0, 190 / 255, 0)
|
||||
elseif tone == Enum.DialogTone.Enemy then
|
||||
frame.BackgroundColor3 = Color3.new(140 / 255, 0, 0)
|
||||
frame.Number.TextColor3 = Color3.new(255 / 255, 88 / 255, 79 / 255)
|
||||
end
|
||||
end
|
||||
local styleChoices
|
||||
styleChoices = function(tone)
|
||||
for _, obj in pairs(choices) do
|
||||
resetColor(obj, tone)
|
||||
end
|
||||
return resetColor(lastChoice, tone)
|
||||
end
|
||||
local styleMainFrame
|
||||
styleMainFrame = function(tone)
|
||||
if tone == Enum.DialogTone.Neutral then
|
||||
mainFrame.Style = Enum.FrameStyle.ChatBlue
|
||||
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png"
|
||||
elseif tone == Enum.DialogTone.Friendly then
|
||||
mainFrame.Style = Enum.FrameStyle.ChatGreen
|
||||
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botGreen_tailRight.png"
|
||||
elseif tone == Enum.DialogTone.Enemy then
|
||||
mainFrame.Style = Enum.FrameStyle.ChatRed
|
||||
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botRed_tailRight.png"
|
||||
end
|
||||
return styleChoices(tone)
|
||||
end
|
||||
local setChatNotificationTone
|
||||
setChatNotificationTone = function(gui, purpose, tone)
|
||||
if tone == Enum.DialogTone.Neutral then
|
||||
gui.Image.Image = "rbxasset://textures/chatBubble_botBlue_notify_bkg.png"
|
||||
elseif tone == Enum.DialogTone.Friendly then
|
||||
gui.Image.Image = "rbxasset://textures/chatBubble_botGreen_notify_bkg.png"
|
||||
elseif tone == Enum.DialogTone.Enemy then
|
||||
gui.Image.Image = "rbxasset://textures/chatBubble_botRed_notify_bkg.png"
|
||||
end
|
||||
if purpose == Enum.DialogPurpose.Quest then
|
||||
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_bang.png"
|
||||
elseif purpose == Enum.DialogPurpose.Help then
|
||||
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_question.png"
|
||||
elseif purpose == Enum.DialogPurpose.Shop then
|
||||
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_money.png"
|
||||
end
|
||||
end
|
||||
local createMessageDialog
|
||||
createMessageDialog = function()
|
||||
messageDialog = New("Frame", "DialogScriptMessage", {
|
||||
Style = Enum.FrameStyle.RobloxRound,
|
||||
Visible = false,
|
||||
New("TextLabel", "Text", {
|
||||
Position = UDim2.new(0, 0, 0, -1),
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
BackgroundTransparency = 1,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
RobloxLocked = true
|
||||
})
|
||||
})
|
||||
end
|
||||
local showMessage
|
||||
showMessage = function(msg, size)
|
||||
messageDialog.Text.Text = msg
|
||||
messageDialog.Size = UDim2.new(0, size, 0, 40)
|
||||
messageDialog.Position = UDim2.new(0.5, -size / 2, 0.5, -40)
|
||||
messageDialog.Visible = true
|
||||
wait(2)
|
||||
messageDialog.Visible = false
|
||||
return messageDialog
|
||||
end
|
||||
local variableDelay
|
||||
variableDelay = function(str)
|
||||
local length = math.min(string.len(str), 100)
|
||||
return wait(0.75 + (length / 75) * 1.5)
|
||||
end
|
||||
local highlightColor
|
||||
highlightColor = function(frame, tone)
|
||||
if tone == Enum.DialogTone.Neutral then
|
||||
frame.BackgroundColor3 = Color3.new(2 / 255, 108 / 255, 255 / 255)
|
||||
frame.Number.TextColor3 = Color3.new(1, 1, 1)
|
||||
elseif tone == Enum.DialogTone.Friendly then
|
||||
frame.BackgroundColor3 = Color3.new(0, 128 / 255, 0)
|
||||
frame.Number.TextColor3 = Color3.new(1, 1, 1)
|
||||
elseif tone == Enum.DialogTone.Enemy then
|
||||
frame.BackgroundColor3 = Color3.new(204 / 255, 0, 0)
|
||||
frame.Number.TextColor3 = Color3.new(1, 1, 1)
|
||||
end
|
||||
end
|
||||
local endDialog
|
||||
endDialog = function()
|
||||
if currentAbortDialogScript then
|
||||
currentAbortDialogScript:Remove()
|
||||
currentAbortDialogScript = nil
|
||||
end
|
||||
local dialog = currentConversationDialog
|
||||
currentConversationDialog = nil
|
||||
if dialog and dialog.InUse then
|
||||
local reenableScript = reenableDialogScript:Clone()
|
||||
reenableScript.archivable = false
|
||||
reenableScript.Disabled = false
|
||||
reenableScript.Parent = dialog
|
||||
end
|
||||
for dialog, gui in pairs(dialogMap) do
|
||||
if dialog and gui then
|
||||
gui.Enabled = not dialog.InUse
|
||||
end
|
||||
end
|
||||
currentConversationPartner = nil
|
||||
end
|
||||
local wanderDialog
|
||||
wanderDialog = function()
|
||||
print("Wander")
|
||||
mainFrame.Visible = false
|
||||
endDialog()
|
||||
return showMessage(characterWanderedOffMessage, characterWanderedOffSize)
|
||||
end
|
||||
local timeoutDialog
|
||||
timeoutDialog = function()
|
||||
print("Timeout")
|
||||
mainFrame.Visible = false
|
||||
endDialog()
|
||||
return showMessage(conversationTimedOut, conversationTimedOutSize)
|
||||
end
|
||||
local normalEndDialog
|
||||
normalEndDialog = function()
|
||||
print("Done")
|
||||
return endDialog()
|
||||
end
|
||||
local sanitizeMessage
|
||||
sanitizeMessage = function(msg)
|
||||
if string.len(msg) == 0 then
|
||||
return "..."
|
||||
else
|
||||
return msg
|
||||
end
|
||||
end
|
||||
local renewKillswitch
|
||||
renewKillswitch = function(dialog)
|
||||
if currentAbortDialogScript then
|
||||
currentAbortDialogScript:Remove()
|
||||
currentAbortDialogScript = nil
|
||||
end
|
||||
currentAbortDialogScript = timeoutScript:Clone()
|
||||
currentAbortDialogScript.archivable = false
|
||||
currentAbortDialogScript.Disabled = false
|
||||
currentAbortDialogScript.Parent = dialog
|
||||
return currentAbortDialogScript
|
||||
end
|
||||
local presentDialogChoices
|
||||
presentDialogChoices = function(talkingPart, dialogChoices)
|
||||
if not currentConversationDialog then
|
||||
return
|
||||
end
|
||||
currentConversationPartner = talkingPart
|
||||
local sortedDialogChoices = { }
|
||||
for _, obj in pairs(dialogChoices) do
|
||||
if obj:IsA("DialogChoice") then
|
||||
table.insert(sortedDialogChoices, obj)
|
||||
end
|
||||
end
|
||||
table.sort(sortedDialogChoices, function(a, b)
|
||||
return a.Name < b.Name
|
||||
end)
|
||||
if #sortedDialogChoices == 0 then
|
||||
normalEndDialog()
|
||||
return
|
||||
end
|
||||
local pos = 1
|
||||
local yPosition = 0
|
||||
choiceMap = { }
|
||||
for _, obj in pairs(choices) do
|
||||
obj.Visible = false
|
||||
end
|
||||
for _, obj in pairs(sortedDialogChoices) do
|
||||
if pos <= #choices then
|
||||
choices[pos].Size = UDim2.new(1, 0, 0, 24 * 3)
|
||||
choices[pos].UserPrompt.Text = obj.UserDialog
|
||||
local height = math.ceil(choices[pos].UserPrompt.TextBounds.Y / 24) * 24
|
||||
choices[pos].Position = UDim2.new(0, 0, 0, yPosition)
|
||||
choices[pos].Size = UDim2.new(1, 0, 0, height)
|
||||
choices[pos].Visible = true
|
||||
choiceMap[choices[pos]] = obj
|
||||
yPosition = yPosition + height
|
||||
pos = pos + 1
|
||||
end
|
||||
end
|
||||
lastChoice.Position = UDim2.new(0, 0, 0, yPosition)
|
||||
lastChoice.Number.Text = pos .. ")"
|
||||
mainFrame.Size = UDim2.new(0, 350, 0, yPosition + 24 + 32)
|
||||
mainFrame.Position = UDim2.new(0, 20, 0, -mainFrame.Size.Y.Offset - 20)
|
||||
styleMainFrame(currentTone())
|
||||
mainFrame.Visible = true
|
||||
end
|
||||
local selectChoice
|
||||
selectChoice = function(choice)
|
||||
renewKillswitch(currentConversationDialog)
|
||||
mainFrame.Visible = false
|
||||
if choice == lastChoice then
|
||||
game.Chat:Chat(game.Players.LocalPlayer.Character, "Goodbye!", getChatColor(currentTone()))
|
||||
return normalEndDialog()
|
||||
else
|
||||
local dialogChoice = choiceMap[choice]
|
||||
game.Chat:Chat(game.Players.LocalPlayer.Character, sanitizeMessage(dialogChoice.UserDialog), getChatColor(currentTone()))
|
||||
wait(1)
|
||||
currentConversationDialog:SignalDialogChoiceSelected(player, dialogChoice)
|
||||
game.Chat:Chat(currentConversationPartner, sanitizeMessage(dialogChoice.ResponseDialog), getChatColor(currentTone()))
|
||||
variableDelay(dialogChoice.ResponseDialog)
|
||||
return presentDialogChoices(currentConversationPartner, dialogChoice:GetChildren())
|
||||
end
|
||||
end
|
||||
local newChoice
|
||||
newChoice = function(numberText)
|
||||
local frame = New("TextButton", {
|
||||
BackgroundColor3 = Color3.new(0, 0, 179 / 255),
|
||||
AutoButtonColor = false,
|
||||
BorderSizePixel = 0,
|
||||
Text = "",
|
||||
RobloxLocked = true,
|
||||
New("TextLabel", "Number", {
|
||||
TextColor3 = Color3.new(127 / 255, 212 / 255, 255 / 255),
|
||||
Text = numberText,
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0, 4, 0, 2),
|
||||
Size = UDim2.new(0, 20, 0, 24),
|
||||
TextXAlignment = Enum.TextXAlignment.Left,
|
||||
TextYAlignment = Enum.TextYAlignment.Top,
|
||||
RobloxLocked = true
|
||||
}),
|
||||
New("TextLabel", "UserPrompt", {
|
||||
BackgroundTransparency = 1,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
Position = UDim2.new(0, 28, 0, 2),
|
||||
Size = UDim2.new(1, -32, 1, -4),
|
||||
TextXAlignment = Enum.TextXAlignment.Left,
|
||||
TextYAlignment = Enum.TextYAlignment.Top,
|
||||
TextWrap = true,
|
||||
RobloxLocked = true
|
||||
})
|
||||
})
|
||||
frame.MouseEnter:connect(function()
|
||||
return highlightColor(frame, currentTone())
|
||||
end)
|
||||
frame.MouseLeave:connect(function()
|
||||
return resetColor(frame, currentTone())
|
||||
end)
|
||||
frame.MouseButton1Click:connect(function()
|
||||
return selectChoice(frame)
|
||||
end)
|
||||
return frame
|
||||
end
|
||||
local initialize
|
||||
initialize = function(parent)
|
||||
choices[1] = newChoice("1)")
|
||||
choices[2] = newChoice("2)")
|
||||
choices[3] = newChoice("3)")
|
||||
choices[4] = newChoice("4)")
|
||||
lastChoice = newChoice("5)")
|
||||
lastChoice.UserPrompt.Text = "Goodbye!"
|
||||
lastChoice.Size = UDim2.new(1, 0, 0, 28)
|
||||
mainFrame = New("Frame", "UserDialogArea", {
|
||||
Size = UDim2.new(0, 350, 0, 200),
|
||||
Style = Enum.FrameStyle.ChatBlue,
|
||||
Visible = false,
|
||||
New("ImageLabel", "Tail", {
|
||||
Size = UDim2.new(0, 62, 0, 53),
|
||||
Position = UDim2.new(1, 8, 0.25),
|
||||
Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png",
|
||||
BackgroundTransparency = 1,
|
||||
RobloxLocked = true
|
||||
})
|
||||
})
|
||||
for _, obj in pairs(choices) do
|
||||
obj.RobloxLocked = true
|
||||
obj.Parent = mainFrame
|
||||
lastChoice.RobloxLocked = true
|
||||
end
|
||||
lastChoice.Parent = mainFrame
|
||||
mainFrame.RobloxLocked = true
|
||||
mainFrame.Parent = parent
|
||||
end
|
||||
local doDialog
|
||||
doDialog = function(dialog)
|
||||
while not Instance.Lock(dialog, player) do
|
||||
wait()
|
||||
end
|
||||
if dialog.InUse then
|
||||
Instance.Unlock(dialog)
|
||||
return
|
||||
else
|
||||
dialog.InUse = true
|
||||
Instance.Unlock(dialog)
|
||||
end
|
||||
currentConversationDialog = dialog
|
||||
game.Chat:Chat(dialog.Parent, dialog.InitialPrompt, getChatColor(dialog.Tone))
|
||||
variableDelay(dialog.InitialPrompt)
|
||||
return presentDialogChoices(dialog.Parent, dialog:GetChildren())
|
||||
end
|
||||
local checkForLeaveArea
|
||||
checkForLeaveArea = function()
|
||||
while currentConversationDialog do
|
||||
if currentConversationDialog.Parent and (player:DistanceFromCharacter(currentConversationDialog.Parent.Position >= currentConversationDialog.ConversationDistance)) then
|
||||
wanderDialog()
|
||||
end
|
||||
wait(1)
|
||||
end
|
||||
end
|
||||
local startDialog
|
||||
startDialog = function(dialog)
|
||||
if dialog.Parent and dialog.Parent:IsA("BasePart") then
|
||||
if player:DistanceFromCharacter(dialog.Parent.Position) >= dialog.ConversationDistance then
|
||||
showMessage(tooFarAwayMessage, tooFarAwaySize)
|
||||
return
|
||||
end
|
||||
for dialog, gui in pairs(dialogMap) do
|
||||
if dialog and gui then
|
||||
gui.Enabled = false
|
||||
end
|
||||
end
|
||||
renewKillswitch(dialog)
|
||||
delay(1, checkForLeaveArea)
|
||||
return doDialog(dialog)
|
||||
end
|
||||
end
|
||||
local removeDialog
|
||||
removeDialog = function(dialog)
|
||||
if dialogMap[dialog] then
|
||||
dialogMap[dialog]:Remove()
|
||||
dialogMap[dialog] = nil
|
||||
end
|
||||
if dialogConnections[dialog] then
|
||||
dialogConnections[dialog]:disconnect()
|
||||
dialogConnections[dialog] = nil
|
||||
end
|
||||
end
|
||||
local addDialog
|
||||
addDialog = function(dialog)
|
||||
if dialog.Parent then
|
||||
if dialog.Parent:IsA("BasePart") then
|
||||
local chatGui = chatNotificationGui:clone()
|
||||
chatGui.Enabled = not dialog.InUse
|
||||
chatGui.Adornee = dialog.Parent
|
||||
chatGui.RobloxLocked = true
|
||||
chatGui.Parent = game.CoreGui
|
||||
chatGui.Image.Button.MouseButton1Click:connect(function()
|
||||
return startDialog(dialog)
|
||||
end)
|
||||
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
|
||||
dialogMap[dialog] = chatGui
|
||||
dialogConnections[dialog] = dialog.Changed:connect(function(prop)
|
||||
if prop == "Parent" and dialog.Parent then
|
||||
removeDialog(dialog)
|
||||
return addDialog(dialog)
|
||||
elseif prop == "InUse" then
|
||||
chatGui.Enabled = not currentConversationDialog and not dialog.InUse
|
||||
if dialog == currentConversationDialog then
|
||||
return timeoutDialog()
|
||||
end
|
||||
elseif prop == "Tone" or prop == "Purpose" then
|
||||
return setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
|
||||
end
|
||||
end)
|
||||
else
|
||||
dialogConnections[dialog] = dialog.Changed:connect(function(prop)
|
||||
if prop == "Parent" and dialog.Parent then
|
||||
removeDialog(dialog)
|
||||
return addDialog(dialog)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
local fetchScripts
|
||||
fetchScripts = function()
|
||||
local model = game:GetService("InsertService"):LoadAsset(39226062)
|
||||
if type(model) == "string" then
|
||||
wait(0.1)
|
||||
model = game:GetService("InsertService"):LoadAsset(39226062)
|
||||
end
|
||||
if type(model) == "string" then
|
||||
return
|
||||
end
|
||||
waitForChild(model, "TimeoutScript")
|
||||
timeoutScript = model.TimeoutScript
|
||||
waitForChild(model, "ReenableDialogScript")
|
||||
reenableDialogScript = model.ReenableDialogScript
|
||||
end
|
||||
local onLoad
|
||||
onLoad = function()
|
||||
waitForProperty(game.Players, "LocalPlayer")
|
||||
player = game.Players.LocalPlayer
|
||||
waitForProperty(player, "Character")
|
||||
fetchScripts()
|
||||
createChatNotificationGui()
|
||||
createMessageDialog()
|
||||
messageDialog.RobloxLocked = true
|
||||
messageDialog.Parent = gui
|
||||
waitForChild(gui, "BottomLeftControl")
|
||||
local frame = New("Frame", "DialogFrame", {
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
Size = UDim2.new(0, 0, 0, 0),
|
||||
BackgroundTransparency = 1,
|
||||
RobloxLocked = true,
|
||||
Parent = gui.BottomLeftControl
|
||||
})
|
||||
initialize(frame)
|
||||
game.CollectionService.ItemAdded:connect(function(obj)
|
||||
if obj:IsA("Dialog") then
|
||||
return addDialog(obj)
|
||||
end
|
||||
end)
|
||||
game.CollectionService.ItemRemoved:connect(function(obj)
|
||||
if obj:IsA("Dialog") then
|
||||
return removeDialog(obj)
|
||||
end
|
||||
end)
|
||||
for _, obj in pairs(game.CollectionService:GetCollection("Dialog")) do
|
||||
if obj:IsA("Dialog") then
|
||||
addDialog(obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
return onLoad()
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,15 @@
|
|||
local a={}a.Foo=function()return print'foo'end a.Bar=function()return print'bar'
|
||||
end a.Help=function(b)if'Foo'==b or a.Foo==b then return
|
||||
'Function Foo. Arguments: None. Side effect: prints foo'elseif'Bar'==b or a.
|
||||
Bar==b then return'Function Bar. Arguments: None. Side effect: prints bar'end
|
||||
end return a
|
||||
local t = { }
|
||||
t.Foo = function()
|
||||
return print("foo")
|
||||
end
|
||||
t.Bar = function()
|
||||
return print("bar")
|
||||
end
|
||||
t.Help = function(funcNameOrFunc)
|
||||
if "Foo" == funcNameOrFunc or t.Foo == funcNameOrFunc then
|
||||
return "Function Foo. Arguments: None. Side effect: prints foo"
|
||||
elseif "Bar" == funcNameOrFunc or t.Bar == funcNameOrFunc then
|
||||
return "Function Bar. Arguments: None. Side effect: prints bar"
|
||||
end
|
||||
end
|
||||
return t
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,84 +1,234 @@
|
|||
local a a=function(b,c)while not b[c]do b.Changed:wait()end end local b b=
|
||||
function(c,d)while not c:FindFirstChild(d)do c.ChildAdded:wait()end end a(game.
|
||||
Players,'LocalPlayer')b(script.Parent,'Popup')b(script.Parent.Popup,
|
||||
'AcceptButton')script.Parent.Popup.AcceptButton.Modal=true local c,d,e,f,g=game.
|
||||
Players.LocalPlayer,nil,{},true,nil g=function()local h=script.Parent:
|
||||
FindFirstChild'Popup'if h then h.OKButton.Visible=true h.DeclineButton.Visible=
|
||||
false h.AcceptButton.Visible=false end return h end local h h=function()local i=
|
||||
script.Parent:FindFirstChild'Popup'if i then i.OKButton.Visible=false i.
|
||||
DeclineButton.Visible=true i.AcceptButton.Visible=true end return i end local i
|
||||
i=function()if script.Parent.Popup then script.Parent.Popup.Visible=false end
|
||||
end local j j=function(k,l)local m=script.Parent:FindFirstChild'Popup'if not(m~=
|
||||
nil)then return end if m.Visible then return end if e[k]then return end m.
|
||||
PopupText.Text='Accept Friend Request from '..tostring(k.Name)..'?'m.PopupImage.
|
||||
Image='http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||
'&x=352&y=352'h()m.Visible=true m.AcceptButton.Text='Accept'm.DeclineButton.Text
|
||||
='Decline'm:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quart,1,true)local n,o n=m.AcceptButton.MouseButton1Click:connect(
|
||||
function()m.Visible=false l:RequestFriendship(k)if n~=nil then n:disconnect()end
|
||||
if o~=nil then o:disconnect()end return m:TweenSize(UDim2.new(0,0,0,0),Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quart,1,true,i())end)o=m.DeclineButton.
|
||||
MouseButton1Click:connect(function()m.Visible=false l:RevokeFriendship(k)e[k]=
|
||||
true print'pop up blacklist'if n~=nil then n:disconnect()end if o~=nil then o:
|
||||
disconnect()end return m:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,
|
||||
Enum.EasingStyle.Quart,1,true,i())end)end game.Players.FriendRequestEvent:
|
||||
connect(function(k,l,m)if k~=c and l~=c then return end if k==c then if m==Enum.
|
||||
FriendRequestEvent.Accept then return game:GetService'GuiService':
|
||||
SendNotification('You are Friends','With '..tostring(l.Name)..'!',
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(l.userId)..
|
||||
'&x=48&y=48',5,function()end)end elseif l==c then if m==Enum.FriendRequestEvent.
|
||||
Issue then if e[k]then return end return game:GetService'GuiService':
|
||||
SendNotification('Friend Request','From '..tostring(k.Name),
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||
'&x=48&y=48',8,function()return j(k,l)end)elseif m==Enum.FriendRequestEvent.
|
||||
Accept then return game:GetService'GuiService':SendNotification(
|
||||
'You are Friends','With '..tostring(k.Name)..'!',
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||
'&x=48&y=48',5,function()end)end end end)local k k=function(l,m)if d~=nil then d
|
||||
:Remove()end b(c,'PlayerGui')local n=Instance.new'Message'n.Text=l n.Parent=c.
|
||||
PlayerGui if m>0 then wait(m)n:Remove()end return n end local l l=function(m,n,o
|
||||
)if game:GetService'TeleportService'.CustomizedTeleportUI==false then return k((
|
||||
function()if Enum.TeleportState.Started==m then return'Teleport started...',0
|
||||
elseif Enum.TeleportState.WaitingForServer==m then return'Requesting server...',
|
||||
0 elseif Enum.TeleportState.InProgress==m then return'Teleporting...',0 elseif
|
||||
Enum.TeleportState.Failed==m then return
|
||||
[[Teleport failed. Insufficient privileges or target place does not exist.]],3
|
||||
end end)())end end if f then c.OnTeleport:connect(l)game:GetService
|
||||
'TeleportService'.ErrorCallback=function(m)local o=script.Parent:FindFirstChild
|
||||
'Popup'g()o.PopupText.Text=m local p p=o.OKButton.MouseButton1Click:connect(
|
||||
function()game:GetService'TeleportService':TeleportCancel()if p then p:
|
||||
disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild
|
||||
'Popup')return o:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quart,1,true,i())end)return game.GuiService:AddCenterDialog(script.
|
||||
Parent:FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()g()
|
||||
script.Parent:FindFirstChild'Popup'.Visible=true return o:TweenSize(UDim2.new(0,
|
||||
330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()
|
||||
return o:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.
|
||||
Quart,1,true,i())end)end game:GetService'TeleportService'.ConfirmationCallback=
|
||||
function(m,o,p)local q=script.Parent:FindFirstChild'Popup'q.PopupText.Text=m q.
|
||||
PopupImage.Image=''local r,s,t t=function()if r~=nil then r:disconnect()end if s
|
||||
~=nil then s:disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:
|
||||
FindFirstChild'Popup')return q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection
|
||||
.Out,Enum.EasingStyle.Quart,1,true,i())end r=q.AcceptButton.MouseButton1Click:
|
||||
connect(function()t()local u,v u,v=pcall(function()return game:GetService
|
||||
'TeleportService':TeleportImpl(o,p)end)if not u then g()q.PopupText.Text=v local
|
||||
w w=q.OKButton.MouseButton1Click:connect(function()if w~=nil then w:disconnect()
|
||||
end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild'Popup')
|
||||
return q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.
|
||||
Quart,1,true,i())end)return game.GuiService:AddCenterDialog(script.Parent:
|
||||
FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()g()script.
|
||||
Parent:FindFirstChild'Popup'.Visible=true return q:TweenSize(UDim2.new(0,330,0,
|
||||
350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()return
|
||||
q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1
|
||||
,true,i())end)end end)s=q.DeclineButton.MouseButton1Click:connect(function()t()
|
||||
return pcall(function()return game:GetService'TeleportService':TeleportCancel()
|
||||
end)end)local u=pcall(function()return game.GuiService:AddCenterDialog(script.
|
||||
Parent:FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()h()q.
|
||||
AcceptButton.Text='Leave'q.DeclineButton.Text='Stay'script.Parent:FindFirstChild
|
||||
'Popup'.Visible=true return q:TweenSize(UDim2.new(0,330,0,350),Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()return q:
|
||||
TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,
|
||||
true,i())end)end)if u==false then script.Parent:FindFirstChild'Popup'.Visible=
|
||||
true q.AcceptButton.Text='Leave'q.DeclineButton.Text='Stay'q:TweenSize(UDim2.
|
||||
new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end
|
||||
return true end end
|
||||
local waitForProperty
|
||||
waitForProperty = function(instance, property)
|
||||
while not instance[property] do
|
||||
instance.Changed:wait()
|
||||
end
|
||||
end
|
||||
local waitForChild
|
||||
waitForChild = function(instance, name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
instance.ChildAdded:wait()
|
||||
end
|
||||
end
|
||||
waitForProperty(game.Players, "LocalPlayer")
|
||||
waitForChild(script.Parent, "Popup")
|
||||
waitForChild(script.Parent.Popup, "AcceptButton")
|
||||
script.Parent.Popup.AcceptButton.Modal = true
|
||||
local localPlayer = game.Players.LocalPlayer
|
||||
local teleportUI
|
||||
local friendRequestBlacklist = { }
|
||||
local teleportEnabled = true
|
||||
local showOneButton
|
||||
showOneButton = function()
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
if popup then
|
||||
popup.OKButton.Visible = true
|
||||
popup.DeclineButton.Visible = false
|
||||
popup.AcceptButton.Visible = false
|
||||
end
|
||||
return popup
|
||||
end
|
||||
local showTwoButtons
|
||||
showTwoButtons = function()
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
if popup then
|
||||
popup.OKButton.Visible = false
|
||||
popup.DeclineButton.Visible = true
|
||||
popup.AcceptButton.Visible = true
|
||||
end
|
||||
return popup
|
||||
end
|
||||
local makePopupInvisible
|
||||
makePopupInvisible = function()
|
||||
if script.Parent.Popup then
|
||||
script.Parent.Popup.Visible = false
|
||||
end
|
||||
end
|
||||
local makeFriend
|
||||
makeFriend = function(fromPlayer, toPlayer)
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
if not (popup ~= nil) then
|
||||
return
|
||||
end
|
||||
if popup.Visible then
|
||||
return
|
||||
end
|
||||
if friendRequestBlacklist[fromPlayer] then
|
||||
return
|
||||
end
|
||||
popup.PopupText.Text = "Accept Friend Request from " .. tostring(fromPlayer.Name) .. "?"
|
||||
popup.PopupImage.Image = "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=352&y=352"
|
||||
showTwoButtons()
|
||||
popup.Visible = true
|
||||
popup.AcceptButton.Text = "Accept"
|
||||
popup.DeclineButton.Text = "Decline"
|
||||
popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
|
||||
local yesCon, noCon
|
||||
yesCon = popup.AcceptButton.MouseButton1Click:connect(function()
|
||||
popup.Visible = false
|
||||
toPlayer:RequestFriendship(fromPlayer)
|
||||
if yesCon ~= nil then
|
||||
yesCon:disconnect()
|
||||
end
|
||||
if noCon ~= nil then
|
||||
noCon:disconnect()
|
||||
end
|
||||
return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible())
|
||||
end)
|
||||
noCon = popup.DeclineButton.MouseButton1Click:connect(function()
|
||||
popup.Visible = false
|
||||
toPlayer:RevokeFriendship(fromPlayer)
|
||||
friendRequestBlacklist[fromPlayer] = true
|
||||
print("pop up blacklist")
|
||||
if yesCon ~= nil then
|
||||
yesCon:disconnect()
|
||||
end
|
||||
if noCon ~= nil then
|
||||
noCon:disconnect()
|
||||
end
|
||||
return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible())
|
||||
end)
|
||||
end
|
||||
game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
|
||||
if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then
|
||||
return
|
||||
end
|
||||
if fromPlayer == localPlayer then
|
||||
if event == Enum.FriendRequestEvent.Accept then
|
||||
return game:GetService("GuiService"):SendNotification("You are Friends", "With " .. tostring(toPlayer.Name) .. "!", "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(toPlayer.userId) .. "&x=48&y=48", 5, function() end)
|
||||
end
|
||||
elseif toPlayer == localPlayer then
|
||||
if event == Enum.FriendRequestEvent.Issue then
|
||||
if friendRequestBlacklist[fromPlayer] then
|
||||
return
|
||||
end
|
||||
return game:GetService("GuiService"):SendNotification("Friend Request", "From " .. tostring(fromPlayer.Name), "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", 8, function()
|
||||
return makeFriend(fromPlayer, toPlayer)
|
||||
end)
|
||||
elseif event == Enum.FriendRequestEvent.Accept then
|
||||
return game:GetService("GuiService"):SendNotification("You are Friends", "With " .. tostring(fromPlayer.Name) .. "!", "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", 5, function() end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
local showTeleportUI
|
||||
showTeleportUI = function(message, timer)
|
||||
if teleportUI ~= nil then
|
||||
teleportUI:Remove()
|
||||
end
|
||||
waitForChild(localPlayer, "PlayerGui")
|
||||
local _with_0 = Instance.new("Message")
|
||||
_with_0.Text = message
|
||||
_with_0.Parent = localPlayer.PlayerGui
|
||||
if timer > 0 then
|
||||
wait(timer)
|
||||
_with_0:Remove()
|
||||
end
|
||||
return _with_0
|
||||
end
|
||||
local onTeleport
|
||||
onTeleport = function(teleportState, _, _)
|
||||
if game:GetService("TeleportService").CustomizedTeleportUI == false then
|
||||
return showTeleportUI((function()
|
||||
if Enum.TeleportState.Started == teleportState then
|
||||
return "Teleport started...", 0
|
||||
elseif Enum.TeleportState.WaitingForServer == teleportState then
|
||||
return "Requesting server...", 0
|
||||
elseif Enum.TeleportState.InProgress == teleportState then
|
||||
return "Teleporting...", 0
|
||||
elseif Enum.TeleportState.Failed == teleportState then
|
||||
return "Teleport failed. Insufficient privileges or target place does not exist.", 3
|
||||
end
|
||||
end)())
|
||||
end
|
||||
end
|
||||
if teleportEnabled then
|
||||
localPlayer.OnTeleport:connect(onTeleport)
|
||||
game:GetService("TeleportService").ErrorCallback = function(message)
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
showOneButton()
|
||||
popup.PopupText.Text = message
|
||||
local clickCon
|
||||
clickCon = popup.OKButton.MouseButton1Click:connect(function()
|
||||
game:GetService("TeleportService"):TeleportCancel()
|
||||
if clickCon then
|
||||
clickCon:disconnect()
|
||||
end
|
||||
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup"))
|
||||
return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible())
|
||||
end)
|
||||
return game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup", Enum.CenterDialogType.QuitDialog), function()
|
||||
showOneButton()
|
||||
script.Parent:FindFirstChild("Popup").Visible = true
|
||||
return popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
|
||||
end, function()
|
||||
return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible())
|
||||
end)
|
||||
end
|
||||
game:GetService("TeleportService").ConfirmationCallback = function(message, placeId, spawnName)
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
popup.PopupText.Text = message
|
||||
popup.PopupImage.Image = ""
|
||||
local yesCon, noCon
|
||||
local killCons
|
||||
killCons = function()
|
||||
if yesCon ~= nil then
|
||||
yesCon:disconnect()
|
||||
end
|
||||
if noCon ~= nil then
|
||||
noCon:disconnect()
|
||||
end
|
||||
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup"))
|
||||
return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible())
|
||||
end
|
||||
yesCon = popup.AcceptButton.MouseButton1Click:connect(function()
|
||||
killCons()
|
||||
local success, err
|
||||
success, err = pcall(function()
|
||||
return game:GetService("TeleportService"):TeleportImpl(placeId, spawnName)
|
||||
end)
|
||||
if not success then
|
||||
showOneButton()
|
||||
popup.PopupText.Text = err
|
||||
local clickCon
|
||||
clickCon = popup.OKButton.MouseButton1Click:connect(function()
|
||||
if clickCon ~= nil then
|
||||
clickCon:disconnect()
|
||||
end
|
||||
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup"))
|
||||
return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible())
|
||||
end)
|
||||
return game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup", Enum.CenterDialogType.QuitDialog), function()
|
||||
showOneButton()
|
||||
script.Parent:FindFirstChild("Popup").Visible = true
|
||||
return popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
|
||||
end, function()
|
||||
return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible())
|
||||
end)
|
||||
end
|
||||
end)
|
||||
noCon = popup.DeclineButton.MouseButton1Click:connect(function()
|
||||
killCons()
|
||||
return pcall(function()
|
||||
return game:GetService("TeleportService"):TeleportCancel()
|
||||
end)
|
||||
end)
|
||||
local centerDialogSuccess = pcall(function()
|
||||
return game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup", Enum.CenterDialogType.QuitDialog), function()
|
||||
showTwoButtons()
|
||||
popup.AcceptButton.Text = "Leave"
|
||||
popup.DeclineButton.Text = "Stay"
|
||||
script.Parent:FindFirstChild("Popup").Visible = true
|
||||
return popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
|
||||
end, function()
|
||||
return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible())
|
||||
end)
|
||||
end)
|
||||
if centerDialogSuccess == false then
|
||||
script.Parent:FindFirstChild("Popup").Visible = true
|
||||
popup.AcceptButton.Text = "Leave"
|
||||
popup.DeclineButton.Text = "Stay"
|
||||
popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,22 +1,90 @@
|
|||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=a(b)if c then
|
||||
e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then if g==
|
||||
'Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)=='userdata'
|
||||
then h.Parent=e end end e.Parent=f return e end local b=a('Frame','Popup',{
|
||||
Position=UDim2.new(0.5,-165,0.5,-175),Size=UDim2.new(0,330,0,350),Style=Enum.
|
||||
FrameStyle.RobloxRound,ZIndex=4,Visible=false,Parent=script.Parent,a('TextLabel'
|
||||
,'PopupText',{Size=UDim2.new(1,0,0.8,0),Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||
FontSize.Size36,BackgroundTransparency=1,Text="Hello I'm a popup",TextColor3=
|
||||
Color3.new(0.9725490196078431,0.9725490196078431,0.9725490196078431),TextWrap=
|
||||
true,ZIndex=5}),a('TextButton','AcceptButton',{Position=UDim2.new(0,20,0,270),
|
||||
Size=UDim2.new(0,100,0,50),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.
|
||||
Size24,Style=Enum.ButtonStyle.RobloxButton,TextColor3=Color3.new(
|
||||
0.9725490196078431,0.9725490196078431,0.9725490196078431),Text='Yes',ZIndex=5}),
|
||||
a('ImageLabel','PopupImage',{BackgroundTransparency=1,Position=UDim2.new(0.5,-
|
||||
140,0,0),Size=UDim2.new(0,280,0,280),ZIndex=3,a('ImageLabel','Backing',{
|
||||
BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),Image=
|
||||
'http://www.roblox.com/asset/?id=47574181',ZIndex=2})})})local c=b.AcceptButton
|
||||
do local d=b:clone()d.Name='Darken'd.Size=UDim2.new(1,16,1,16)d.Position=UDim2.
|
||||
new(0,-8,0,-8)d.ZIndex=1 d.Parent=b end do local d=c:clone()d.Name=
|
||||
'DeclineButton'd.Position=UDim2.new(1,-120,0,270)d.Text='No'd.Parent=b end do
|
||||
local d=c:clone()d.Name='OKButton'd.Text='OK'd.Position=UDim2.new(0.5,-50,0,270)
|
||||
d.Visible=false d.Parent=b end return script:remove()
|
||||
local New
|
||||
New = function(className, name, props)
|
||||
if not (props ~= nil) then
|
||||
props = name
|
||||
name = nil
|
||||
end
|
||||
local obj = New(className)
|
||||
if name then
|
||||
obj.Name = name
|
||||
end
|
||||
local parent
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" and type(v) == "userdata" then
|
||||
v.Parent = obj
|
||||
end
|
||||
end
|
||||
obj.Parent = parent
|
||||
return obj
|
||||
end
|
||||
local popupFrame = New("Frame", "Popup", {
|
||||
Position = UDim2.new(0.5, -165, 0.5, -175),
|
||||
Size = UDim2.new(0, 330, 0, 350),
|
||||
Style = Enum.FrameStyle.RobloxRound,
|
||||
ZIndex = 4,
|
||||
Visible = false,
|
||||
Parent = script.Parent,
|
||||
New("TextLabel", "PopupText", {
|
||||
Size = UDim2.new(1, 0, 0.8, 0),
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size36,
|
||||
BackgroundTransparency = 1,
|
||||
Text = "Hello I'm a popup",
|
||||
TextColor3 = Color3.new(248 / 255, 248 / 255, 248 / 255),
|
||||
TextWrap = true,
|
||||
ZIndex = 5
|
||||
}),
|
||||
New("TextButton", "AcceptButton", {
|
||||
Position = UDim2.new(0, 20, 0, 270),
|
||||
Size = UDim2.new(0, 100, 0, 50),
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size24,
|
||||
Style = Enum.ButtonStyle.RobloxButton,
|
||||
TextColor3 = Color3.new(248 / 255, 248 / 255, 248 / 255),
|
||||
Text = "Yes",
|
||||
ZIndex = 5
|
||||
}),
|
||||
New("ImageLabel", "PopupImage", {
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0.5, -140, 0, 0),
|
||||
Size = UDim2.new(0, 280, 0, 280),
|
||||
ZIndex = 3,
|
||||
New("ImageLabel", "Backing", {
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Image = "http://www.roblox.com/asset/?id=47574181",
|
||||
ZIndex = 2
|
||||
})
|
||||
})
|
||||
})
|
||||
local AcceptButton = popupFrame.AcceptButton
|
||||
do
|
||||
local _with_0 = popupFrame:clone()
|
||||
_with_0.Name = "Darken"
|
||||
_with_0.Size = UDim2.new(1, 16, 1, 16)
|
||||
_with_0.Position = UDim2.new(0, -8, 0, -8)
|
||||
_with_0.ZIndex = 1
|
||||
_with_0.Parent = popupFrame
|
||||
end
|
||||
do
|
||||
local _with_0 = AcceptButton:clone()
|
||||
_with_0.Name = "DeclineButton"
|
||||
_with_0.Position = UDim2.new(1, -120, 0, 270)
|
||||
_with_0.Text = "No"
|
||||
_with_0.Parent = popupFrame
|
||||
end
|
||||
do
|
||||
local _with_0 = AcceptButton:clone()
|
||||
_with_0.Name = "OKButton"
|
||||
_with_0.Text = "OK"
|
||||
_with_0.Position = UDim2.new(0.5, -50, 0, 270)
|
||||
_with_0.Visible = false
|
||||
_with_0.Parent = popupFrame
|
||||
end
|
||||
return script:remove()
|
||||
|
|
|
|||
|
|
@ -1,229 +1,757 @@
|
|||
if game.CoreGui.Version<3 then return end local a a=function(b,c,d)if not(d~=nil
|
||||
)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for g,
|
||||
h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h end
|
||||
elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e.Parent=
|
||||
f return e end local b,c=script.Parent,nil c=function(d,e)while not d:
|
||||
FindFirstChild(e)do d.ChildAdded:wait()end end local d d=function(e,f)while not
|
||||
e[f]do e.Changed:wait()end end local e e=function()local f=false pcall(function(
|
||||
)f=Game:GetService'UserInputService'.TouchEnabled end)return f end local f f=
|
||||
function()if b.AbsoluteSize.Y<=320 then return true else return false end end c(
|
||||
game,'Players')d(game.Players,'LocalPlayer')local g=a('Frame','CurrentLoadout',{
|
||||
Position=UDim2.new(0.5,-300,1,-85),Size=UDim2.new(0,600,0,54),
|
||||
BackgroundTransparency=1,RobloxLocked=true,Parent=b,a('BoolValue','Debounce',{
|
||||
RobloxLocked=true}),a('ImageLabel','Background',{Size=UDim2.new(1.2,0,1.2,0),
|
||||
Image='http://www.roblox.com/asset/?id=96536002',BackgroundTransparency=1,
|
||||
Position=UDim2.new(-0.1,0,-0.1,0),ZIndex=0,Visible=false,a('ImageLabel',{Size=
|
||||
UDim2.new(1,0,0.025,1),Position=UDim2.new(0,0,0,0),Image=
|
||||
'http://www.roblox.com/asset/?id=97662207',BackgroundTransparency=1})})})c(b,
|
||||
'ControlFrame')a('ImageButton','BackpackButton',{RobloxLocked=true,Visible=false
|
||||
,BackgroundTransparency=1,Image='http://www.roblox.com/asset/?id=97617958',
|
||||
Position=UDim2.new(0.5,-60,1,-108),Size=UDim2.new(0,120,0,18),Parent=b.
|
||||
ControlFrame})local h=9 if f()then h=3 g.Size=UDim2.new(0,180,0,54)g.Position=
|
||||
UDim2.new(0.5,-90,1,-85)end for i=0,h do local j=a('Frame',{Name='Slot'..
|
||||
tostring(i),RobloxLocked=true,BackgroundColor3=Color3.new(0,0,0),
|
||||
BackgroundTransparency=1,BorderColor3=Color3.new(1,1,1),ZIndex=4,Position=UDim2.
|
||||
new((function()if i==0 then return 0.9,0,0,0 else return(i-1)*0.1,(i-1)*6,0,0
|
||||
end end)()),Size=UDim2.new(0,54,1,0),Parent=g})if b.AbsoluteSize.Y<=320 then j.
|
||||
Position=UDim2.new(0,(i-1)*60,0,-50)print('Well got here',j,j.Position.X.Scale,j
|
||||
.Position.X.Offset)if i==0 then j:Destroy()end end end local i=a('ImageButton',
|
||||
'TempSlot',{Active=true,Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Style=
|
||||
'Custom',Visible=false,RobloxLocked=true,ZIndex=3,Parent=g,a('ImageLabel',
|
||||
'Background',{BackgroundTransparency=1,Image=
|
||||
'http://www.roblox.com/asset/?id=97613075',Size=UDim2.new(1,0,1,0)}),a(
|
||||
'ObjectValue','GearReference',{RobloxLocked=true}),a('TextLabel','ToolTipLabel',
|
||||
{RobloxLocked=true,Text='',BackgroundTransparency=0.5,BorderSizePixel=0,Visible=
|
||||
false,TextColor3=Color3.new(1,1,1),BackgroundColor3=Color3.new(0,0,0),
|
||||
TextStrokeTransparency=0,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size14,
|
||||
Size=UDim2.new(1,60,0,20),Position=UDim2.new(0,-30,0,-30)}),a('BoolValue','Kill'
|
||||
,{RobloxLocked=true}),a('TextLabel','GearText',{RobloxLocked=true,
|
||||
BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,
|
||||
Position=UDim2.new(0,-8,0,-8),Size=UDim2.new(1,16,1,16),Text='',TextColor3=
|
||||
Color3.new(1,1,1),TextWrap=true,ZIndex=5}),a('ImageLabel','GearImage',{
|
||||
BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0),
|
||||
ZIndex=5,RobloxLocked=true})})local j=a('TextLabel','SlotNumber',{
|
||||
BackgroundTransparency=1,BorderSizePixel=0,Font=Enum.Font.ArialBold,FontSize=
|
||||
Enum.FontSize.Size18,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,10,0,15),
|
||||
TextColor3=Color3.new(1,1,1),TextTransparency=0,TextXAlignment=Enum.
|
||||
TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Bottom,RobloxLocked=true,
|
||||
Parent=i,ZIndex=5})if e()then j.Visible=false end local k do local l=j:Clone()l.
|
||||
Name='SlotNumberDownShadow'l.TextColor3=Color3.new(0,0,0)l.Position=UDim2.new(0,
|
||||
1,0,-1)l.Parent=i l.ZIndex=2 k=l end do local l=k:Clone()l.Name=
|
||||
'SlotNumberUpShadow'l.Position=UDim2.new(0,-1,0,-1)l.Parent=i end local l=a(
|
||||
'Frame','Backpack',{RobloxLocked=true,Visible=false,Position=UDim2.new(0.5,0,0.5
|
||||
,0),BackgroundColor3=Color3.new(0.12549019607843137,0.12549019607843137,
|
||||
0.12549019607843137),BackgroundTransparency=0,BorderSizePixel=0,Parent=b,Active=
|
||||
true,a('BoolValue','SwapSlot',{RobloxLocked=true,a('IntValue','Slot',{
|
||||
RobloxLocked=true}),a('ObjectValue','GearButton',{RobloxLocked=true})}),a(
|
||||
'Frame','SearchFrame',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2
|
||||
.new(1,-220,0,2),Size=UDim2.new(0,220,0,24),a('ImageButton','SearchButton',{
|
||||
RobloxLocked=true,Size=UDim2.new(0,25,0,25),BackgroundTransparency=1,Image=
|
||||
'rbxasset://textures/ui/SearchIcon.png'}),a('TextButton','ResetButton',{
|
||||
RobloxLocked=true,Visible=false,Position=UDim2.new(1,-26,0,3),Size=UDim2.new(0,
|
||||
20,0,20),Style=Enum.ButtonStyle.RobloxButtonDefault,Text='X',TextColor3=Color3.
|
||||
new(1,1,1),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,ZIndex=3}),a(
|
||||
'TextButton','SearchBoxFrame',{RobloxLocked=true,Position=UDim2.new(0,25,0,0),
|
||||
Size=UDim2.new(1,-28,0,26),Text='',Style=Enum.ButtonStyle.RobloxButton,a(
|
||||
'TextBox','SearchBox',{RobloxLocked=true,BackgroundTransparency=1,Font=Enum.Font
|
||||
.ArialBold,FontSize=Enum.FontSize.Size12,Position=UDim2.new(0,-5,0,-5),Size=
|
||||
UDim2.new(1,10,1,10),TextColor3=Color3.new(1,1,1),TextXAlignment=Enum.
|
||||
TextXAlignment.Left,ZIndex=2,TextWrap=true,Text='Search...'})})})})local m=a(
|
||||
'Frame','Tabs',{Visible=false,Active=false,RobloxLocked=true,BackgroundColor3=
|
||||
Color3.new(0,0,0),BackgroundTransparency=0.08,BorderSizePixel=0,Position=UDim2.
|
||||
new(0,0,-0.1,-4),Size=UDim2.new(1,0,0.1,4),Parent=l,a('Frame','TabLine',{
|
||||
RobloxLocked=true,BackgroundColor3=Color3.new(0.20784313725490197,
|
||||
0.20784313725490197,0.20784313725490197),BorderSizePixel=0,Position=UDim2.new(0,
|
||||
5,1,-4),Size=UDim2.new(1,-10,0,4),ZIndex=2}),a('TextButton','InventoryButton',{
|
||||
RobloxLocked=true,Size=UDim2.new(0,60,0,30),Position=UDim2.new(0,7,1,-31),
|
||||
BackgroundColor3=Color3.new(1,1,1),BorderColor3=Color3.new(1,1,1),Font=Enum.Font
|
||||
.ArialBold,FontSize=Enum.FontSize.Size18,Text='Gear',AutoButtonColor=false,
|
||||
TextColor3=Color3.new(0,0,0),Selected=true,Active=true,ZIndex=3}),a('TextButton'
|
||||
,'CloseButton',{RobloxLocked=true,Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||
FontSize.Size24,Position=UDim2.new(1,-33,0,4),Size=UDim2.new(0,30,0,30),Style=
|
||||
Enum.ButtonStyle.RobloxButton,Text='',TextColor3=Color3.new(1,1,1),Modal=true,a(
|
||||
'ImageLabel','XImage',{RobloxLocked=true,Image=(function()game:GetService
|
||||
'ContentProvider':Preload'http://www.roblox.com/asset/?id=75547445'return
|
||||
'http://www.roblox.com/asset/?id=75547445'end)(),BackgroundTransparency=1,
|
||||
Position=UDim2.new(-0.25,-1,-0.25,-1),Size=UDim2.new(1.5,2,1.5,2),ZIndex=2})})})
|
||||
if game.CoreGui.Version>=8 then a('TextButton','WardrobeButton',{RobloxLocked=
|
||||
true,Size=UDim2.new(0,90,0,30),Position=UDim2.new(0,77,1,-31),BackgroundColor3=
|
||||
Color3.new(0,0,0),BorderColor3=Color3.new(1,1,1),Font=Enum.Font.ArialBold,
|
||||
FontSize=Enum.FontSize.Size18,Text='Wardrobe',AutoButtonColor=false,TextColor3=
|
||||
Color3.new(1,1,1),Selected=false,Active=true,Parent=m})end local n=a('Frame',
|
||||
'Gear',{RobloxLocked=true,BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),
|
||||
ClipsDescendants=true,Parent=l,a('Frame','AssetsList',{RobloxLocked=true,
|
||||
BackgroundTransparency=1,Size=UDim2.new(0.2,0,1,0),Style=Enum.FrameStyle.
|
||||
RobloxSquare,Visible=false}),a('Frame','GearGrid',{RobloxLocked=true,Size=UDim2.
|
||||
new(0.95,0,1,0),BackgroundTransparency=1,a('ImageButton','GearButton',{
|
||||
RobloxLocked=true,Visible=false,Size=UDim2.new(0,54,0,54),Style='Custom',
|
||||
BackgroundTransparency=1,a('ImageLabel','Background',{BackgroundTransparency=1,
|
||||
Image='http://www.roblox.com/asset/?id=97613075',Size=UDim2.new(1,0,1,0)}),a(
|
||||
'ObjectValue','GearReference',{RobloxLocked=true}),a('Frame','GreyOutButton',{
|
||||
RobloxLocked=true,BackgroundTransparency=0.5,Size=UDim2.new(1,0,1,0),Active=true
|
||||
,Visible=false,ZIndex=3}),a('TextLabel','GearText',{RobloxLocked=true,
|
||||
BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,
|
||||
Position=UDim2.new(0,-8,0,-8),Size=UDim2.new(1,16,1,16),Text='',ZIndex=2,
|
||||
TextColor3=Color3.new(1,1,1),TextWrap=true})})})})local o,p=a('Frame',
|
||||
'GearGridScrollingArea',{RobloxLocked=true,Position=UDim2.new(1,-19,0,35),Size=
|
||||
UDim2.new(0,17,1,-45),BackgroundTransparency=1,Parent=n}),a('Frame',
|
||||
'GearLoadouts',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2.new(
|
||||
0.7,23,0.5,1),Size=UDim2.new(0.3,-23,0.5,-1),Parent=n,Visible=false,a('Frame',
|
||||
'LoadoutsList',{RobloxLocked=true,Position=UDim2.new(0,0,0.15,2),Size=UDim2.new(
|
||||
1,-17,0.85,-2),Style=Enum.FrameStyle.RobloxSquare}),a('Frame',
|
||||
'GearLoadoutsHeader',{RobloxLocked=true,BackgroundColor3=Color3.new(0,0,0),
|
||||
BackgroundTransparency=0.2,BorderColor3=Color3.new(1,0,0),Size=UDim2.new(1,2,
|
||||
0.15,-1),a('TextLabel','LoadoutsHeaderText',{RobloxLocked=true,
|
||||
BackgroundTransparency=1,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,
|
||||
Size=UDim2.new(1,0,1,0),Text='Loadouts',TextColor3=Color3.new(1,1,1)})})})do
|
||||
local q=o:Clone()q.Name='GearLoadoutsScrollingArea'q.RobloxLocked=true q.
|
||||
Position=UDim2.new(1,-15,0.15,2)q.Size=UDim2.new(0,17,0.85,-2)q.Parent=p end
|
||||
local q,r,s=a('Frame','GearPreview',{RobloxLocked=true,Position=UDim2.new(0.7,23
|
||||
,0,0),Size=UDim2.new(0.3,-28,0.5,-1),BackgroundTransparency=1,ZIndex=7,Parent=n,
|
||||
a('Frame','GearStats',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2
|
||||
.new(0,0,0.75,0),Size=UDim2.new(1,0,0.25,0),ZIndex=8,a('TextLabel','GearName',{
|
||||
RobloxLocked=true,BackgroundTransparency=1,Font=Enum.Font.ArialBold,FontSize=
|
||||
Enum.FontSize.Size18,Position=UDim2.new(0,-3,0,0),Size=UDim2.new(1,6,1,5),Text=
|
||||
'',TextColor3=Color3.new(1,1,1),TextWrap=true,ZIndex=9})}),a('ImageLabel',
|
||||
'GearImage',{RobloxLocked=true,Image='',BackgroundTransparency=1,Position=UDim2.
|
||||
new(0.125,0,0,0),Size=UDim2.new(0.75,0,0.75,0),ZIndex=8,a('Frame','GearIcons',{
|
||||
BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,BorderSizePixel=0,
|
||||
RobloxLocked=true,Position=UDim2.new(0.4,2,0.85,-2),Size=UDim2.new(0.6,0,0.15,0)
|
||||
,Visible=false,ZIndex=9,a('ImageLabel','GenreImage',{RobloxLocked=true,
|
||||
BackgroundColor3=Color3.new(0.4,0.6,1),BackgroundTransparency=0.5,
|
||||
BorderSizePixel=0,Size=UDim2.new(0.25,0,1,0)})})})}),nil,nil do local t=q.
|
||||
GearImage r,s=t.GearIcons,t.GearIcons.GenreImage end do local t=s:Clone()t.Name=
|
||||
'AttributeOneImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(1,0.2,0)t.
|
||||
Position=UDim2.new(0.25,0,0,0)t.Parent=r end do local t=s:Clone()t.Name=
|
||||
'AttributeTwoImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(0.6,1,0.6)t
|
||||
.Position=UDim2.new(0.5,0,0,0)t.Parent=r end do local t=s:Clone()t.Name=
|
||||
'AttributeThreeImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(0,0.5,0.5
|
||||
)t.Position=UDim2.new(0.75,0,0,0)t.Parent=r end if game.CoreGui.Version<8 then
|
||||
script:remove()return end local t t=function(u,v)return a('Frame',tostring(u),{
|
||||
RobloxLocked=true,Size=UDim2.new(1,0,1,-70),Position=UDim2.new(0,0,0,20),
|
||||
BackgroundTransparency=1,Parent=v,Visible=false})end local u u=function(v,w,x,y,
|
||||
z)return a('ImageLabel',tostring(v),{RobloxLocked=true,Image=w,Size=x,
|
||||
BackgroundTransparency=1,Position=y,Parent=z})end local v v=function(w,x,y,z,A)
|
||||
local B=a('ImageButton',tostring(w),{RobloxLocked=true,Size=x,Position=y})if A
|
||||
then B.Style=A else B.BackgroundColor3=Color3.new(0,0,0)B.BorderColor3=Color3.
|
||||
new(1,1,1)end B.Parent=z return B end local w w=function(x,y,z,A)return a(
|
||||
'TextLabel',{Name=x,RobloxLocked=true,BackgroundTransparency=1,Size=UDim2.new(0,
|
||||
32,0,14),Font=Enum.Font.Arial,TextColor3=Color3.new(1,1,1),FontSize=Enum.
|
||||
FontSize.Size14,Text=y,Position=z,Parent=A})end local x=a('Frame','Wardrobe',{
|
||||
RobloxLocked=true,BackgroundTransparency=1,Visible=false,Size=UDim2.new(1,0,1,0)
|
||||
,Parent=l,a('Frame','AssetList',{RobloxLocked=true,Position=UDim2.new(0,4,0,5),
|
||||
Size=UDim2.new(0,85,1,-5),BackgroundTransparency=1,Visible=true}),a('TextButton'
|
||||
,'PreviewButton',{RobloxLocked=true,Text='Rotate',BackgroundColor3=Color3.new(0,
|
||||
0,0),BackgroundTransparency=0.5,BorderColor3=Color3.new(1,1,1),Position=UDim2.
|
||||
new(1.2,-62,1,-50),Size=UDim2.new(0,125,0,50),Font=Enum.Font.ArialBold,FontSize=
|
||||
Enum.FontSize.Size24,TextColor3=Color3.new(1,1,1),TextWrapped=true,
|
||||
TextStrokeTransparency=0})})local y=a('Frame','PreviewAssetFrame',{RobloxLocked=
|
||||
true,BackgroundTransparency=1,Position=UDim2.new(1,-240,0,30),Size=UDim2.new(0,
|
||||
250,0,250),Parent=x})local z=a('TextButton','PreviewAssetBacking',{RobloxLocked=
|
||||
true,Active=false,Text='',AutoButtonColor=false,Size=UDim2.new(1,0,1,0),Style=
|
||||
Enum.ButtonStyle.RobloxButton,Visible=false,ZIndex=9,Parent=y,a('ImageLabel',
|
||||
'PreviewAssetImage',{RobloxLocked=true,BackgroundTransparency=0.8,Position=UDim2
|
||||
.new(0.5,-100,0,0),Size=UDim2.new(0,200,0,200),BorderSizePixel=0,ZIndex=10})})
|
||||
local A=a('TextLabel','AssetNameLabel',{RobloxLocked=true,BackgroundTransparency
|
||||
=1,Position=UDim2.new(0,0,1,-20),Size=UDim2.new(0.5,0,0,24),ZIndex=10,Font=Enum.
|
||||
Font.Arial,Text='',TextColor3=Color3.new(1,1,1),TextScaled=true,Parent=z})do
|
||||
local B=A:Clone()B.Name='AssetTypeLabel'B.RobloxLocked=true B.TextScaled=false B
|
||||
.FontSize=Enum.FontSize.Size18 B.Position=UDim2.new(0.5,3,1,-20)B.Parent=z end
|
||||
local B=a('Frame','CharacterPane',{RobloxLocked=true,Position=UDim2.new(1,-220,0
|
||||
,32),Size=UDim2.new(0,220,1,-40),BackgroundTransparency=1,Visible=true,Parent=x,
|
||||
a('TextLabel','CategoryLabel',{RobloxLocked=true,BackgroundTransparency=1,Font=
|
||||
Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,Position=UDim2.new(0,0,0,-7),
|
||||
Size=UDim2.new(1,0,0,20),TextXAlignment=Enum.TextXAlignment.Center,Text='All',
|
||||
TextColor3=Color3.new(1,1,1)}),a('TextButton','SaveButton',{RobloxLocked=true,
|
||||
Size=UDim2.new(0.6,0,0,50),Position=UDim2.new(0.2,0,1,-50),Style=Enum.
|
||||
ButtonStyle.RobloxButton,Selected=false,Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||
FontSize.Size18,Text='Save',TextColor3=Color3.new(1,1,1)})})local C=t(
|
||||
'FacesFrame',B)game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=75460621'u('FaceZone',
|
||||
'http://www.roblox.com/asset/?id=75460621',UDim2.new(0,157,0,137),UDim2.new(0.5,
|
||||
-78,0.5,-68),C)v('Face',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),C)local
|
||||
D=t('HeadsFrame',B)u('FaceZone','http://www.roblox.com/asset/?id=75460621',UDim2
|
||||
.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),D)v('Head',UDim2.new(0,64,0,64),
|
||||
UDim2.new(0.5,-32,0.5,-135),D)local E=t('HatsFrame',B)game:GetService
|
||||
'ContentProvider':Preload'http://www.roblox.com/asset/?id=75457888'local F=u(
|
||||
'HatsZone','http://www.roblox.com/asset/?id=75457888',UDim2.new(0,186,0,184),
|
||||
UDim2.new(0.5,-93,0.5,-100),E)v('Hat1Button',UDim2.new(0,64,0,64),UDim2.new(0,-1
|
||||
,0,-1),F,Enum.ButtonStyle.RobloxButton)v('Hat2Button',UDim2.new(0,64,0,64),UDim2
|
||||
.new(0,63,0,-1),F,Enum.ButtonStyle.RobloxButton)v('Hat3Button',UDim2.new(0,64,0,
|
||||
64),UDim2.new(0,127,0,-1),F,Enum.ButtonStyle.RobloxButton)local G=t('PantsFrame'
|
||||
,B)game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=75457920'u('PantsZone',
|
||||
'http://www.roblox.com/asset/?id=75457920',UDim2.new(0,121,0,99),UDim2.new(0.5,-
|
||||
60,0.5,-100),G)local H=a('Frame','PantFrame',{RobloxLocked=true,Size=UDim2.new(0
|
||||
,25,0,56),Position=UDim2.new(0.5,-26,0.5,0),BackgroundColor3=Color3.new(0,0,0),
|
||||
BorderColor3=Color3.new(1,1,1),Parent=G})do local I=H:Clone()I.Position=UDim2.
|
||||
new(0.5,3,0.5,0)I.RobloxLocked=true I.Parent=G end a('ImageButton',
|
||||
'CurrentPants',{RobloxLocked=true,BackgroundTransparency=1,ZIndex=2,Position=
|
||||
UDim2.new(0.5,-31,0.5,-4),Size=UDim2.new(0,54,0,59),Parent=G})local I=t(
|
||||
'PackagesFrame',B)local J=v('TorsoMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5
|
||||
,-32,0.5,-110),I,Enum.ButtonStyle.RobloxButton)w('TorsoLabel','Torso',UDim2.new(
|
||||
0.5,-16,0,-25),J)local K=v('LeftLegMeshButton',UDim2.new(0,64,0,64),UDim2.new(
|
||||
0.5,0,0.5,-25),I,Enum.ButtonStyle.RobloxButton)w('LeftLegLabel','Left Leg',UDim2
|
||||
.new(0.5,-16,0,-25),K)local L=v('RightLegMeshButton',UDim2.new(0,64,0,64),UDim2.
|
||||
new(0.5,-64,0.5,-25),I,Enum.ButtonStyle.RobloxButton)w('RightLegLabel',
|
||||
'Right Leg',UDim2.new(0.5,-16,0,-25),L)local M=v('RightArmMeshButton',UDim2.new(
|
||||
0,64,0,64),UDim2.new(0.5,-96,0.5,-110),I,Enum.ButtonStyle.RobloxButton)w(
|
||||
'RightArmLabel','Right Arm',UDim2.new(0.5,-16,0,-25),M)local N=v(
|
||||
'LeftArmMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,32,0.5,-110),I,Enum.
|
||||
ButtonStyle.RobloxButton)w('LeftArmLabel','Left Arm',UDim2.new(0.5,-16,0,-25),N)
|
||||
local O=t('T-ShirtsFrame',B)game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=75460642'u('TShirtZone',
|
||||
'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5,
|
||||
-60,0.5,-100),O)v('TShirtButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64)
|
||||
,O)local P=t('ShirtsFrame',B)u('ShirtZone',
|
||||
'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5,
|
||||
-60,0.5,-100),P)v('ShirtButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),
|
||||
P)local Q=t('ColorFrame',B)game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=76049888'local R=u('ColorZone',
|
||||
'http://www.roblox.com/asset/?id=76049888',UDim2.new(0,120,0,150),UDim2.new(0.5,
|
||||
-60,0.5,-100),Q)v('Head',UDim2.new(0.26,0,0.19,0),UDim2.new(0.37,0,0.02,0),R).
|
||||
AutoButtonColor=false v('LeftArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26
|
||||
,0),R).AutoButtonColor=false v('RightArm',UDim2.new(0.19,0,0.36,0),UDim2.new(
|
||||
0.025,0,0.26,0),R).AutoButtonColor=false v('Torso',UDim2.new(0.43,0,0.36,0),
|
||||
UDim2.new(0.28,0,0.26,0),R).AutoButtonColor=false v('RightLeg',UDim2.new(0.19,0,
|
||||
0.31,0),UDim2.new(0.275,0,0.67,0),R).AutoButtonColor=false v('LeftLeg',UDim2.
|
||||
new(0.19,0,0.31,0),UDim2.new(0.525,0,0.67,0),R).AutoButtonColor=false return
|
||||
script:Destroy()
|
||||
if game.CoreGui.Version < 3 then
|
||||
return
|
||||
end
|
||||
local New
|
||||
New = function(className, name, props)
|
||||
if not (props ~= nil) then
|
||||
props = name
|
||||
name = nil
|
||||
end
|
||||
local obj = Instance.new(className)
|
||||
if name then
|
||||
obj.Name = name
|
||||
end
|
||||
local parent
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" and type(v) == "userdata" then
|
||||
v.Parent = obj
|
||||
end
|
||||
end
|
||||
obj.Parent = parent
|
||||
return obj
|
||||
end
|
||||
local gui = script.Parent
|
||||
local waitForChild
|
||||
waitForChild = function(instance, name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
instance.ChildAdded:wait()
|
||||
end
|
||||
end
|
||||
local waitForProperty
|
||||
waitForProperty = function(instance, property)
|
||||
while not instance[property] do
|
||||
instance.Changed:wait()
|
||||
end
|
||||
end
|
||||
local IsTouchDevice
|
||||
IsTouchDevice = function()
|
||||
local touchEnabled = false
|
||||
pcall(function()
|
||||
touchEnabled = Game:GetService("UserInputService").TouchEnabled
|
||||
end)
|
||||
return touchEnabled
|
||||
end
|
||||
local IsPhone
|
||||
IsPhone = function()
|
||||
if gui.AbsoluteSize.Y <= 320 then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
waitForChild(game, "Players")
|
||||
waitForProperty(game.Players, "LocalPlayer")
|
||||
local CurrentLoadout = New("Frame", "CurrentLoadout", {
|
||||
Position = UDim2.new(0.5, -300, 1, -85),
|
||||
Size = UDim2.new(0, 600, 0, 54),
|
||||
BackgroundTransparency = 1,
|
||||
RobloxLocked = true,
|
||||
Parent = gui,
|
||||
New("BoolValue", "Debounce", {
|
||||
RobloxLocked = true
|
||||
}),
|
||||
New("ImageLabel", "Background", {
|
||||
Size = UDim2.new(1.2, 0, 1.2, 0),
|
||||
Image = "http://www.roblox.com/asset/?id=96536002",
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(-0.1, 0, -0.1, 0),
|
||||
ZIndex = 0.0,
|
||||
Visible = false,
|
||||
New("ImageLabel", {
|
||||
Size = UDim2.new(1, 0, 0.025, 1),
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
Image = "http://www.roblox.com/asset/?id=97662207",
|
||||
BackgroundTransparency = 1
|
||||
})
|
||||
})
|
||||
})
|
||||
waitForChild(gui, "ControlFrame")
|
||||
New("ImageButton", "BackpackButton", {
|
||||
RobloxLocked = true,
|
||||
Visible = false,
|
||||
BackgroundTransparency = 1,
|
||||
Image = "http://www.roblox.com/asset/?id=97617958",
|
||||
Position = UDim2.new(0.5, -60, 1, -108),
|
||||
Size = UDim2.new(0, 120, 0, 18),
|
||||
Parent = gui.ControlFrame
|
||||
})
|
||||
local NumSlots = 9
|
||||
if IsPhone() then
|
||||
NumSlots = 3
|
||||
CurrentLoadout.Size = UDim2.new(0, 180, 0, 54)
|
||||
CurrentLoadout.Position = UDim2.new(0.5, -90, 1, -85)
|
||||
end
|
||||
for i = 0, NumSlots do
|
||||
local slotFrame = New("Frame", {
|
||||
Name = "Slot" .. tostring(i),
|
||||
RobloxLocked = true,
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BackgroundTransparency = 1,
|
||||
BorderColor3 = Color3.new(1, 1, 1),
|
||||
ZIndex = 4.0,
|
||||
Position = UDim2.new((function()
|
||||
if i == 0 then
|
||||
return 0.9, 0, 0, 0
|
||||
else
|
||||
return (i - 1) * 0.1, (i - 1) * 6, 0, 0
|
||||
end
|
||||
end)()),
|
||||
Size = UDim2.new(0, 54, 1, 0),
|
||||
Parent = CurrentLoadout
|
||||
})
|
||||
if gui.AbsoluteSize.Y <= 320 then
|
||||
slotFrame.Position = UDim2.new(0, (i - 1) * 60, 0, -50)
|
||||
print("Well got here", slotFrame, slotFrame.Position.X.Scale, slotFrame.Position.X.Offset)
|
||||
if i == 0 then
|
||||
slotFrame:Destroy()
|
||||
end
|
||||
end
|
||||
end
|
||||
local TempSlot = New("ImageButton", "TempSlot", {
|
||||
Active = true,
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
BackgroundTransparency = 1,
|
||||
Style = "Custom",
|
||||
Visible = false,
|
||||
RobloxLocked = true,
|
||||
ZIndex = 3.0,
|
||||
Parent = CurrentLoadout,
|
||||
New("ImageLabel", "Background", {
|
||||
BackgroundTransparency = 1,
|
||||
Image = "http://www.roblox.com/asset/?id=97613075",
|
||||
Size = UDim2.new(1, 0, 1, 0)
|
||||
}),
|
||||
New("ObjectValue", "GearReference", {
|
||||
RobloxLocked = true
|
||||
}),
|
||||
New("TextLabel", "ToolTipLabel", {
|
||||
RobloxLocked = true,
|
||||
Text = "",
|
||||
BackgroundTransparency = 0.5,
|
||||
BorderSizePixel = 0,
|
||||
Visible = false,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
TextStrokeTransparency = 0,
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
Size = UDim2.new(1, 60, 0, 20),
|
||||
Position = UDim2.new(0, -30, 0, -30)
|
||||
}),
|
||||
New("BoolValue", "Kill", {
|
||||
RobloxLocked = true
|
||||
}),
|
||||
New("TextLabel", "GearText", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Font = Enum.Font.Arial,
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
Position = UDim2.new(0, -8, 0, -8),
|
||||
Size = UDim2.new(1, 16, 1, 16),
|
||||
Text = "",
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
TextWrap = true,
|
||||
ZIndex = 5.0
|
||||
}),
|
||||
New("ImageLabel", "GearImage", {
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
ZIndex = 5.0,
|
||||
RobloxLocked = true
|
||||
})
|
||||
})
|
||||
local SlotNumber = New("TextLabel", "SlotNumber", {
|
||||
BackgroundTransparency = 1,
|
||||
BorderSizePixel = 0,
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
Size = UDim2.new(0, 10, 0, 15),
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
TextTransparency = 0,
|
||||
TextXAlignment = Enum.TextXAlignment.Left,
|
||||
TextYAlignment = Enum.TextYAlignment.Bottom,
|
||||
RobloxLocked = true,
|
||||
Parent = TempSlot,
|
||||
ZIndex = 5
|
||||
})
|
||||
if IsTouchDevice() then
|
||||
SlotNumber.Visible = false
|
||||
end
|
||||
local SlotNumberDownShadow
|
||||
do
|
||||
local _with_0 = SlotNumber:Clone()
|
||||
_with_0.Name = "SlotNumberDownShadow"
|
||||
_with_0.TextColor3 = Color3.new(0, 0, 0)
|
||||
_with_0.Position = UDim2.new(0, 1, 0, -1)
|
||||
_with_0.Parent = TempSlot
|
||||
_with_0.ZIndex = 2
|
||||
SlotNumberDownShadow = _with_0
|
||||
end
|
||||
do
|
||||
local _with_0 = SlotNumberDownShadow:Clone()
|
||||
_with_0.Name = "SlotNumberUpShadow"
|
||||
_with_0.Position = UDim2.new(0, -1, 0, -1)
|
||||
_with_0.Parent = TempSlot
|
||||
end
|
||||
local Backpack = New("Frame", "Backpack", {
|
||||
RobloxLocked = true,
|
||||
Visible = false,
|
||||
Position = UDim2.new(0.5, 0, 0.5, 0),
|
||||
BackgroundColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255),
|
||||
BackgroundTransparency = 0.0,
|
||||
BorderSizePixel = 0,
|
||||
Parent = gui,
|
||||
Active = true,
|
||||
New("BoolValue", "SwapSlot", {
|
||||
RobloxLocked = true,
|
||||
New("IntValue", "Slot", {
|
||||
RobloxLocked = true
|
||||
}),
|
||||
New("ObjectValue", "GearButton", {
|
||||
RobloxLocked = true
|
||||
})
|
||||
}),
|
||||
New("Frame", "SearchFrame", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(1, -220, 0, 2),
|
||||
Size = UDim2.new(0, 220, 0, 24),
|
||||
New("ImageButton", "SearchButton", {
|
||||
RobloxLocked = true,
|
||||
Size = UDim2.new(0, 25, 0, 25),
|
||||
BackgroundTransparency = 1,
|
||||
Image = "rbxasset://textures/ui/SearchIcon.png"
|
||||
}),
|
||||
New("TextButton", "ResetButton", {
|
||||
RobloxLocked = true,
|
||||
Visible = false,
|
||||
Position = UDim2.new(1, -26, 0, 3),
|
||||
Size = UDim2.new(0, 20, 0, 20),
|
||||
Style = Enum.ButtonStyle.RobloxButtonDefault,
|
||||
Text = "X",
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
ZIndex = 3
|
||||
}),
|
||||
New("TextButton", "SearchBoxFrame", {
|
||||
RobloxLocked = true,
|
||||
Position = UDim2.new(0, 25, 0, 0),
|
||||
Size = UDim2.new(1, -28, 0, 26),
|
||||
Text = "",
|
||||
Style = Enum.ButtonStyle.RobloxButton,
|
||||
New("TextBox", "SearchBox", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size12,
|
||||
Position = UDim2.new(0, -5, 0, -5),
|
||||
Size = UDim2.new(1, 10, 1, 10),
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
TextXAlignment = Enum.TextXAlignment.Left,
|
||||
ZIndex = 2,
|
||||
TextWrap = true,
|
||||
Text = "Search..."
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
local Tabs = New("Frame", "Tabs", {
|
||||
Visible = false,
|
||||
Active = false,
|
||||
RobloxLocked = true,
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BackgroundTransparency = 0.08,
|
||||
BorderSizePixel = 0,
|
||||
Position = UDim2.new(0, 0, -0.1, -4),
|
||||
Size = UDim2.new(1, 0, 0.1, 4),
|
||||
Parent = Backpack,
|
||||
New("Frame", "TabLine", {
|
||||
RobloxLocked = true,
|
||||
BackgroundColor3 = Color3.new(53 / 255, 53 / 255, 53 / 255),
|
||||
BorderSizePixel = 0,
|
||||
Position = UDim2.new(0, 5, 1, -4),
|
||||
Size = UDim2.new(1, -10, 0, 4),
|
||||
ZIndex = 2
|
||||
}),
|
||||
New("TextButton", "InventoryButton", {
|
||||
RobloxLocked = true,
|
||||
Size = UDim2.new(0, 60, 0, 30),
|
||||
Position = UDim2.new(0, 7, 1, -31),
|
||||
BackgroundColor3 = Color3.new(1, 1, 1),
|
||||
BorderColor3 = Color3.new(1, 1, 1),
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
Text = "Gear",
|
||||
AutoButtonColor = false,
|
||||
TextColor3 = Color3.new(0, 0, 0),
|
||||
Selected = true,
|
||||
Active = true,
|
||||
ZIndex = 3
|
||||
}),
|
||||
New("TextButton", "CloseButton", {
|
||||
RobloxLocked = true,
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size24,
|
||||
Position = UDim2.new(1, -33, 0, 4),
|
||||
Size = UDim2.new(0, 30, 0, 30),
|
||||
Style = Enum.ButtonStyle.RobloxButton,
|
||||
Text = "",
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
Modal = true,
|
||||
New("ImageLabel", "XImage", {
|
||||
RobloxLocked = true,
|
||||
Image = (function()
|
||||
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75547445")
|
||||
return "http://www.roblox.com/asset/?id=75547445"
|
||||
end)(),
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(-0.25, -1, -0.25, -1),
|
||||
Size = UDim2.new(1.5, 2, 1.5, 2),
|
||||
ZIndex = 2
|
||||
})
|
||||
})
|
||||
})
|
||||
if game.CoreGui.Version >= 8 then
|
||||
New("TextButton", "WardrobeButton", {
|
||||
RobloxLocked = true,
|
||||
Size = UDim2.new(0, 90, 0, 30),
|
||||
Position = UDim2.new(0, 77, 1, -31),
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BorderColor3 = Color3.new(1, 1, 1),
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
Text = "Wardrobe",
|
||||
AutoButtonColor = false,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
Selected = false,
|
||||
Active = true,
|
||||
Parent = Tabs
|
||||
})
|
||||
end
|
||||
local Gear = New("Frame", "Gear", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
ClipsDescendants = true,
|
||||
Parent = Backpack,
|
||||
New("Frame", "AssetsList", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new(0.2, 0, 1, 0),
|
||||
Style = Enum.FrameStyle.RobloxSquare,
|
||||
Visible = false
|
||||
}),
|
||||
New("Frame", "GearGrid", {
|
||||
RobloxLocked = true,
|
||||
Size = UDim2.new(0.95, 0, 1, 0),
|
||||
BackgroundTransparency = 1,
|
||||
New("ImageButton", "GearButton", {
|
||||
RobloxLocked = true,
|
||||
Visible = false,
|
||||
Size = UDim2.new(0, 54, 0, 54),
|
||||
Style = "Custom",
|
||||
BackgroundTransparency = 1,
|
||||
New("ImageLabel", "Background", {
|
||||
BackgroundTransparency = 1,
|
||||
Image = "http://www.roblox.com/asset/?id=97613075",
|
||||
Size = UDim2.new(1, 0, 1, 0)
|
||||
}),
|
||||
New("ObjectValue", "GearReference", {
|
||||
RobloxLocked = true
|
||||
}),
|
||||
New("Frame", "GreyOutButton", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 0.5,
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Active = true,
|
||||
Visible = false,
|
||||
ZIndex = 3
|
||||
}),
|
||||
New("TextLabel", "GearText", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Font = Enum.Font.Arial,
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
Position = UDim2.new(0, -8, 0, -8),
|
||||
Size = UDim2.new(1, 16, 1, 16),
|
||||
Text = "",
|
||||
ZIndex = 2,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
TextWrap = true
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
local GearGridScrollingArea = New("Frame", "GearGridScrollingArea", {
|
||||
RobloxLocked = true,
|
||||
Position = UDim2.new(1, -19, 0, 35),
|
||||
Size = UDim2.new(0, 17, 1, -45),
|
||||
BackgroundTransparency = 1,
|
||||
Parent = Gear
|
||||
})
|
||||
local GearLoadouts = New("Frame", "GearLoadouts", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0.7, 23, 0.5, 1),
|
||||
Size = UDim2.new(0.3, -23, 0.5, -1),
|
||||
Parent = Gear,
|
||||
Visible = false,
|
||||
New("Frame", "LoadoutsList", {
|
||||
RobloxLocked = true,
|
||||
Position = UDim2.new(0, 0, 0.15, 2),
|
||||
Size = UDim2.new(1, -17, 0.85, -2),
|
||||
Style = Enum.FrameStyle.RobloxSquare
|
||||
}),
|
||||
New("Frame", "GearLoadoutsHeader", {
|
||||
RobloxLocked = true,
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BackgroundTransparency = 0.2,
|
||||
BorderColor3 = Color3.new(1, 0, 0),
|
||||
Size = UDim2.new(1, 2, 0.15, -1),
|
||||
New("TextLabel", "LoadoutsHeaderText", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Text = "Loadouts",
|
||||
TextColor3 = Color3.new(1, 1, 1)
|
||||
})
|
||||
})
|
||||
})
|
||||
do
|
||||
local _with_0 = GearGridScrollingArea:Clone()
|
||||
_with_0.Name = "GearLoadoutsScrollingArea"
|
||||
_with_0.RobloxLocked = true
|
||||
_with_0.Position = UDim2.new(1, -15, 0.15, 2)
|
||||
_with_0.Size = UDim2.new(0, 17, 0.85, -2)
|
||||
_with_0.Parent = GearLoadouts
|
||||
end
|
||||
local GearPreview = New("Frame", "GearPreview", {
|
||||
RobloxLocked = true,
|
||||
Position = UDim2.new(0.7, 23, 0, 0),
|
||||
Size = UDim2.new(0.3, -28, 0.5, -1),
|
||||
BackgroundTransparency = 1,
|
||||
ZIndex = 7,
|
||||
Parent = Gear,
|
||||
New("Frame", "GearStats", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0, 0, 0.75, 0),
|
||||
Size = UDim2.new(1, 0, 0.25, 0),
|
||||
ZIndex = 8,
|
||||
New("TextLabel", "GearName", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
Position = UDim2.new(0, -3, 0, 0),
|
||||
Size = UDim2.new(1, 6, 1, 5),
|
||||
Text = "",
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
TextWrap = true,
|
||||
ZIndex = 9
|
||||
})
|
||||
}),
|
||||
New("ImageLabel", "GearImage", {
|
||||
RobloxLocked = true,
|
||||
Image = "",
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0.125, 0, 0, 0),
|
||||
Size = UDim2.new(0.75, 0, 0.75, 0),
|
||||
ZIndex = 8,
|
||||
New("Frame", "GearIcons", {
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BackgroundTransparency = 0.5,
|
||||
BorderSizePixel = 0,
|
||||
RobloxLocked = true,
|
||||
Position = UDim2.new(0.4, 2, 0.85, -2),
|
||||
Size = UDim2.new(0.6, 0, 0.15, 0),
|
||||
Visible = false,
|
||||
ZIndex = 9,
|
||||
New("ImageLabel", "GenreImage", {
|
||||
RobloxLocked = true,
|
||||
BackgroundColor3 = Color3.new(102 / 255, 153 / 255, 1),
|
||||
BackgroundTransparency = 0.5,
|
||||
BorderSizePixel = 0,
|
||||
Size = UDim2.new(0.25, 0, 1, 0)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
local GearIcons, GenreImage
|
||||
do
|
||||
local _obj_0 = GearPreview.GearImage
|
||||
GearIcons, GenreImage = _obj_0.GearIcons, _obj_0.GearIcons.GenreImage
|
||||
end
|
||||
do
|
||||
local _with_0 = GenreImage:Clone()
|
||||
_with_0.Name = "AttributeOneImage"
|
||||
_with_0.RobloxLocked = true
|
||||
_with_0.BackgroundColor3 = Color3.new(1, 51 / 255, 0)
|
||||
_with_0.Position = UDim2.new(0.25, 0, 0, 0)
|
||||
_with_0.Parent = GearIcons
|
||||
end
|
||||
do
|
||||
local _with_0 = GenreImage:Clone()
|
||||
_with_0.Name = "AttributeTwoImage"
|
||||
_with_0.RobloxLocked = true
|
||||
_with_0.BackgroundColor3 = Color3.new(153 / 255, 1, 153 / 255)
|
||||
_with_0.Position = UDim2.new(0.5, 0, 0, 0)
|
||||
_with_0.Parent = GearIcons
|
||||
end
|
||||
do
|
||||
local _with_0 = GenreImage:Clone()
|
||||
_with_0.Name = "AttributeThreeImage"
|
||||
_with_0.RobloxLocked = true
|
||||
_with_0.BackgroundColor3 = Color3.new(0, 0.5, 0.5)
|
||||
_with_0.Position = UDim2.new(0.75, 0, 0, 0)
|
||||
_with_0.Parent = GearIcons
|
||||
end
|
||||
if game.CoreGui.Version < 8 then
|
||||
script:remove()
|
||||
return
|
||||
end
|
||||
local makeCharFrame
|
||||
makeCharFrame = function(frameName, parent)
|
||||
return New("Frame", tostring(frameName), {
|
||||
RobloxLocked = true,
|
||||
Size = UDim2.new(1, 0, 1, -70),
|
||||
Position = UDim2.new(0, 0, 0, 20),
|
||||
BackgroundTransparency = 1,
|
||||
Parent = parent,
|
||||
Visible = false
|
||||
})
|
||||
end
|
||||
local makeZone
|
||||
makeZone = function(zoneName, image, size, position, parent)
|
||||
return New("ImageLabel", tostring(zoneName), {
|
||||
RobloxLocked = true,
|
||||
Image = image,
|
||||
Size = size,
|
||||
BackgroundTransparency = 1,
|
||||
Position = position,
|
||||
Parent = parent
|
||||
})
|
||||
end
|
||||
local makeStyledButton
|
||||
makeStyledButton = function(buttonName, size, position, parent, buttonStyle)
|
||||
local button = New("ImageButton", tostring(buttonName), {
|
||||
RobloxLocked = true,
|
||||
Size = size,
|
||||
Position = position
|
||||
})
|
||||
if buttonStyle then
|
||||
button.Style = buttonStyle
|
||||
else
|
||||
button.BackgroundColor3 = Color3.new(0, 0, 0)
|
||||
button.BorderColor3 = Color3.new(1, 1, 1)
|
||||
end
|
||||
button.Parent = parent
|
||||
return button
|
||||
end
|
||||
local makeTextLabel
|
||||
makeTextLabel = function(TextLabelName, text, position, parent)
|
||||
return New("TextLabel", {
|
||||
Name = TextLabelName,
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Size = UDim2.new(0, 32, 0, 14),
|
||||
Font = Enum.Font.Arial,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
Text = text,
|
||||
Position = position,
|
||||
Parent = parent
|
||||
})
|
||||
end
|
||||
local Wardrobe = New("Frame", "Wardrobe", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Visible = false,
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Parent = Backpack,
|
||||
New("Frame", "AssetList", {
|
||||
RobloxLocked = true,
|
||||
Position = UDim2.new(0, 4, 0, 5),
|
||||
Size = UDim2.new(0, 85, 1, -5),
|
||||
BackgroundTransparency = 1,
|
||||
Visible = true
|
||||
}),
|
||||
New("TextButton", "PreviewButton", {
|
||||
RobloxLocked = true,
|
||||
Text = "Rotate",
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BackgroundTransparency = 0.5,
|
||||
BorderColor3 = Color3.new(1, 1, 1),
|
||||
Position = UDim2.new(1.2, -62, 1, -50),
|
||||
Size = UDim2.new(0, 125, 0, 50),
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size24,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
TextWrapped = true,
|
||||
TextStrokeTransparency = 0
|
||||
})
|
||||
})
|
||||
local PreviewAssetFrame = New("Frame", "PreviewAssetFrame", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(1, -240, 0, 30),
|
||||
Size = UDim2.new(0, 250, 0, 250),
|
||||
Parent = Wardrobe
|
||||
})
|
||||
local PreviewAssetBacking = New("TextButton", "PreviewAssetBacking", {
|
||||
RobloxLocked = true,
|
||||
Active = false,
|
||||
Text = "",
|
||||
AutoButtonColor = false,
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Style = Enum.ButtonStyle.RobloxButton,
|
||||
Visible = false,
|
||||
ZIndex = 9,
|
||||
Parent = PreviewAssetFrame,
|
||||
New("ImageLabel", "PreviewAssetImage", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 0.8,
|
||||
Position = UDim2.new(0.5, -100, 0, 0),
|
||||
Size = UDim2.new(0, 200, 0, 200),
|
||||
BorderSizePixel = 0,
|
||||
ZIndex = 10
|
||||
})
|
||||
})
|
||||
local AssetNameLabel = New("TextLabel", "AssetNameLabel", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0, 0, 1, -20),
|
||||
Size = UDim2.new(0.5, 0, 0, 24),
|
||||
ZIndex = 10,
|
||||
Font = Enum.Font.Arial,
|
||||
Text = "",
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
TextScaled = true,
|
||||
Parent = PreviewAssetBacking
|
||||
})
|
||||
do
|
||||
local _with_0 = AssetNameLabel:Clone()
|
||||
_with_0.Name = "AssetTypeLabel"
|
||||
_with_0.RobloxLocked = true
|
||||
_with_0.TextScaled = false
|
||||
_with_0.FontSize = Enum.FontSize.Size18
|
||||
_with_0.Position = UDim2.new(0.5, 3, 1, -20)
|
||||
_with_0.Parent = PreviewAssetBacking
|
||||
end
|
||||
local CharacterPane = New("Frame", "CharacterPane", {
|
||||
RobloxLocked = true,
|
||||
Position = UDim2.new(1, -220, 0, 32),
|
||||
Size = UDim2.new(0, 220, 1, -40),
|
||||
BackgroundTransparency = 1,
|
||||
Visible = true,
|
||||
Parent = Wardrobe,
|
||||
New("TextLabel", "CategoryLabel", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
Position = UDim2.new(0, 0, 0, -7),
|
||||
Size = UDim2.new(1, 0, 0, 20),
|
||||
TextXAlignment = Enum.TextXAlignment.Center,
|
||||
Text = "All",
|
||||
TextColor3 = Color3.new(1, 1, 1)
|
||||
}),
|
||||
New("TextButton", "SaveButton", {
|
||||
RobloxLocked = true,
|
||||
Size = UDim2.new(0.6, 0, 0, 50),
|
||||
Position = UDim2.new(0.2, 0, 1, -50),
|
||||
Style = Enum.ButtonStyle.RobloxButton,
|
||||
Selected = false,
|
||||
Font = Enum.Font.ArialBold,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
Text = "Save",
|
||||
TextColor3 = Color3.new(1, 1, 1)
|
||||
})
|
||||
})
|
||||
local FaceFrame = makeCharFrame("FacesFrame", CharacterPane)
|
||||
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75460621")
|
||||
makeZone("FaceZone", "http://www.roblox.com/asset/?id=75460621", UDim2.new(0, 157, 0, 137), UDim2.new(0.5, -78, 0.5, -68), FaceFrame)
|
||||
makeStyledButton("Face", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -135), FaceFrame)
|
||||
local HeadFrame = makeCharFrame("HeadsFrame", CharacterPane)
|
||||
makeZone("FaceZone", "http://www.roblox.com/asset/?id=75460621", UDim2.new(0, 157, 0, 137), UDim2.new(0.5, -78, 0.5, -68), HeadFrame)
|
||||
makeStyledButton("Head", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -135), HeadFrame)
|
||||
local HatsFrame = makeCharFrame("HatsFrame", CharacterPane)
|
||||
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75457888")
|
||||
local HatsZone = makeZone("HatsZone", "http://www.roblox.com/asset/?id=75457888", UDim2.new(0, 186, 0, 184), UDim2.new(0.5, -93, 0.5, -100), HatsFrame)
|
||||
makeStyledButton("Hat1Button", UDim2.new(0, 64, 0, 64), UDim2.new(0, -1, 0, -1), HatsZone, Enum.ButtonStyle.RobloxButton)
|
||||
makeStyledButton("Hat2Button", UDim2.new(0, 64, 0, 64), UDim2.new(0, 63, 0, -1), HatsZone, Enum.ButtonStyle.RobloxButton)
|
||||
makeStyledButton("Hat3Button", UDim2.new(0, 64, 0, 64), UDim2.new(0, 127, 0, -1), HatsZone, Enum.ButtonStyle.RobloxButton)
|
||||
local PantsFrame = makeCharFrame("PantsFrame", CharacterPane)
|
||||
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75457920")
|
||||
makeZone("PantsZone", "http://www.roblox.com/asset/?id=75457920", UDim2.new(0, 121, 0, 99), UDim2.new(0.5, -60, 0.5, -100), PantsFrame)
|
||||
local pantFrame = New("Frame", "PantFrame", {
|
||||
RobloxLocked = true,
|
||||
Size = UDim2.new(0, 25, 0, 56),
|
||||
Position = UDim2.new(0.5, -26, 0.5, 0),
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BorderColor3 = Color3.new(1, 1, 1),
|
||||
Parent = PantsFrame
|
||||
})
|
||||
do
|
||||
local _with_0 = pantFrame:Clone()
|
||||
_with_0.Position = UDim2.new(0.5, 3, 0.5, 0)
|
||||
_with_0.RobloxLocked = true
|
||||
_with_0.Parent = PantsFrame
|
||||
end
|
||||
New("ImageButton", "CurrentPants", {
|
||||
RobloxLocked = true,
|
||||
BackgroundTransparency = 1,
|
||||
ZIndex = 2,
|
||||
Position = UDim2.new(0.5, -31, 0.5, -4),
|
||||
Size = UDim2.new(0, 54, 0, 59),
|
||||
Parent = PantsFrame
|
||||
})
|
||||
local MeshFrame = makeCharFrame("PackagesFrame", CharacterPane)
|
||||
local torsoButton = makeStyledButton("TorsoMeshButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -110), MeshFrame, Enum.ButtonStyle.RobloxButton)
|
||||
makeTextLabel("TorsoLabel", "Torso", UDim2.new(0.5, -16, 0, -25), torsoButton)
|
||||
local leftLegButton = makeStyledButton("LeftLegMeshButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, 0, 0.5, -25), MeshFrame, Enum.ButtonStyle.RobloxButton)
|
||||
makeTextLabel("LeftLegLabel", "Left Leg", UDim2.new(0.5, -16, 0, -25), leftLegButton)
|
||||
local rightLegButton = makeStyledButton("RightLegMeshButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -64, 0.5, -25), MeshFrame, Enum.ButtonStyle.RobloxButton)
|
||||
makeTextLabel("RightLegLabel", "Right Leg", UDim2.new(0.5, -16, 0, -25), rightLegButton)
|
||||
local rightArmButton = makeStyledButton("RightArmMeshButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -96, 0.5, -110), MeshFrame, Enum.ButtonStyle.RobloxButton)
|
||||
makeTextLabel("RightArmLabel", "Right Arm", UDim2.new(0.5, -16, 0, -25), rightArmButton)
|
||||
local leftArmButton = makeStyledButton("LeftArmMeshButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, 32, 0.5, -110), MeshFrame, Enum.ButtonStyle.RobloxButton)
|
||||
makeTextLabel("LeftArmLabel", "Left Arm", UDim2.new(0.5, -16, 0, -25), leftArmButton)
|
||||
local TShirtFrame = makeCharFrame("T-ShirtsFrame", CharacterPane)
|
||||
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75460642")
|
||||
makeZone("TShirtZone", "http://www.roblox.com/asset/?id=75460642", UDim2.new(0, 121, 0, 154), UDim2.new(0.5, -60, 0.5, -100), TShirtFrame)
|
||||
makeStyledButton("TShirtButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -64), TShirtFrame)
|
||||
local ShirtFrame = makeCharFrame("ShirtsFrame", CharacterPane)
|
||||
makeZone("ShirtZone", "http://www.roblox.com/asset/?id=75460642", UDim2.new(0, 121, 0, 154), UDim2.new(0.5, -60, 0.5, -100), ShirtFrame)
|
||||
makeStyledButton("ShirtButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -64), ShirtFrame)
|
||||
local ColorFrame = makeCharFrame("ColorFrame", CharacterPane)
|
||||
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=76049888")
|
||||
local ColorZone = makeZone("ColorZone", "http://www.roblox.com/asset/?id=76049888", UDim2.new(0, 120, 0, 150), UDim2.new(0.5, -60, 0.5, -100), ColorFrame)
|
||||
makeStyledButton("Head", UDim2.new(0.26, 0, 0.19, 0), UDim2.new(0.37, 0, 0.02, 0), ColorZone).AutoButtonColor = false
|
||||
makeStyledButton("LeftArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.78, 0, 0.26, 0), ColorZone).AutoButtonColor = false
|
||||
makeStyledButton("RightArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.025, 0, 0.26, 0), ColorZone).AutoButtonColor = false
|
||||
makeStyledButton("Torso", UDim2.new(0.43, 0, 0.36, 0), UDim2.new(0.28, 0, 0.26, 0), ColorZone).AutoButtonColor = false
|
||||
makeStyledButton("RightLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.275, 0, 0.67, 0), ColorZone).AutoButtonColor = false
|
||||
makeStyledButton("LeftLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.525, 0, 0.67, 0), ColorZone).AutoButtonColor = false
|
||||
return script:Destroy()
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,164 +1,730 @@
|
|||
local a,b={},nil b=function(c,d,e)if not(e~=nil)then e=d d=nil end local f=
|
||||
Instance.new(c)if d then f.Name=d end local g for h,i in pairs(e)do if type(h)==
|
||||
'string'then if h=='Parent'then g=i else f[h]=i end elseif type(h)=='number'and
|
||||
type(i)=='userdata'then i.Parent=f end end f.Parent=g return f end local c,d=
|
||||
assert,nil d=function()return d end local e={buffer={}}e.New=function(f)local g=
|
||||
setmetatable({},f)f.__index=f g.buffer={}return g end e.Append=function(f,g)do
|
||||
local h=f.buffer h[#h+1]=g end end e.ToString=function(f)return table.concat(f.
|
||||
buffer)end local f={backslashes={['\b']='\\b',['\t']='\\t',['\n']='\\n',['\f']=
|
||||
'\\f',['\r']='\\r',['"']='\\"',['\\']='\\\\',['/']='\\/'}}f.New=function(g)local
|
||||
h=setmetatable({},g)h.writer=e:New()g.__index=g return h end f.Append=function(g
|
||||
,h)return g.writer:Append(h)end f.ToString=function(g)return g.writer:ToString()
|
||||
end f.Write=function(g,h)local i=type(h)if'nil'==i then return g:WriteNil()
|
||||
elseif'boolean'==i or'number'==i then return g:WriteString(h)elseif'string'==i
|
||||
then return g:ParseString(h)elseif'table'==i then return g:WriteTable(h)elseif
|
||||
'function'==i then return g:WriteFunction(h)elseif'thread'==i or'userdata'==i
|
||||
then return g:WriteError(h)end end f.WriteNil=function(g)return g:Append'null'
|
||||
end f.WriteString=function(g,h)return g:Append(tostring(h))end f.ParseString=
|
||||
function(g,h)g:Append'"'g:Append(string.gsub(h,'[%z%c\\"/]',function(i)local j=g
|
||||
.backslashes[i]if j then return j end return string.format('\\u%.4X',string.
|
||||
byte(i))end))return g:Append'"'end f.IsArray=function(g,h)local i,j=0,nil j=
|
||||
function(k)if type(k)=='number'and k>0 and math.floor(k)==k then return true end
|
||||
return false end for k,l in pairs(h)do if not j(k)then return false,'{','}'else
|
||||
i=math.max(i,k)end end return true,'[',']',i end f.WriteTable=function(g,h)local
|
||||
i,j,k,l=g:IsArray(h)g:Append(j)if i then for m=1,l do g:Write(h[m])if m<l then g
|
||||
:Append','end end else local m=true for n,o in pairs(h)do if not m then g:Append
|
||||
','end m=false g:ParseString(n)g:Append':'g:Write(o)end end return g:Append(k)
|
||||
end f.WriteError=function(g,h)return error(string.format(
|
||||
'Encoding of %s unsupported',tostring(h)))end f.WriteFunction=function(g,h)if h
|
||||
==d then return g:WriteNil()else return g:WriteError(h)end end local g={s='',i=0
|
||||
}g.New=function(h,i)local j=setmetatable({},h)h.__index=h j.s=i or j.s return j
|
||||
end g.Peek=function(h)local i=h.i+1 if i<=#h.s then return string.sub(h.s,i,i)
|
||||
end return nil end g.Next=function(h)h.i=h.i+1 if h.i<=#h.s then return string.
|
||||
sub(h.s,h.i,h.i)end return nil end g.All=function(h)return h.s end local h={
|
||||
escapes={['t']='\t',['n']='\n',['f']='\f',['r']='\r',['b']='\b'}}h.New=function(
|
||||
i,j)local k=setmetatable({},i)k.reader=g:New(j)i.__index=i return k end h.Read=
|
||||
function(i)i:SkipWhiteSpace()local j=i:Peek()if not(j~=nil)then return error(
|
||||
string.format("Nil string: '%s'",i:All()))elseif j=='{'then return i:ReadObject(
|
||||
)elseif j=='['then return i:ReadArray()elseif j=='"'then return i:ReadString()
|
||||
elseif string.find(j,'[%+%-%d]')then return i:ReadNumber()elseif j=='t'then
|
||||
return i:ReadTrue()elseif j=='f'then return i:ReadFalse()elseif j=='n'then
|
||||
return i:ReadNull()elseif j=='/'then i:ReadComment()return i:Read()else return
|
||||
nil end end h.ReadTrue=function(i)i:TestReservedWord{'t','r','u','e'}return true
|
||||
end h.ReadFalse=function(i)i:TestReservedWord{'f','a','l','s','e'}return false
|
||||
end h.ReadNull=function(i)i:TestReservedWord{'n','u','l','l'}return nil end h.
|
||||
TestReservedWord=function(i,j)for k,l in ipairs(j)do if i:Next()~=l then error(
|
||||
string.format("Error reading '%s': %s",table.concat(j),i:All()))end end end h.
|
||||
ReadNumber=function(i)local j,k=i:Next(),i:Peek()while(k~=nil)and string.find(k,
|
||||
'[%+%-%d%.eE]')do j=j..i:Next()k=i:Peek()end j=tonumber(j)if not(j~=nil)then
|
||||
return error(string.format("Invalid number: '%s'",j))else return j end end h.
|
||||
ReadString=function(i)local j=''c(i:Next()=='"')while i:Peek()~='"'do local k=i:
|
||||
Next()if k=='\\'then k=i:Next()if i.escapes[k]then k=i.escapes[k]end end j=j..k
|
||||
end c(i:Next()=='"')local k k=function(l)return string.char(tonumber(l,16))end
|
||||
return string.gsub(j,'u%x%x(%x%x)',k)end h.ReadComment=function(i)c(i:Next()==
|
||||
'/')local j=i:Next()if j=='/'then return i:ReadSingleLineComment()elseif j=='*'
|
||||
then return i:ReadBlockComment()else return error(string.format(
|
||||
'Invalid comment: %s',i:All()))end end h.ReadBlockComment=function(i)local j=
|
||||
false while not j do local k=i:Next()if k=='*'and i:Peek()=='/'then j=true end
|
||||
if not j and k=='/'and i:Peek()=='*'then error(string.format(
|
||||
"Invalid comment: %s, '/*' illegal.",i:All()))end end return i:Next()end h.
|
||||
ReadSingleLineComment=function(i)local j=i:Next()while j~='\r'and j~='\n'do j=i:
|
||||
Next()end end h.ReadArray=function(i)local j={}c(i:Next()=='[')local k=false if
|
||||
i:Peek()==']'then k=true end while not k do local l=i:Read()j[#j+1]=l i:
|
||||
SkipWhiteSpace()if i:Peek()==']'then k=true end if not k then local m=i:Next()if
|
||||
m~=','then error(string.format("Invalid array: '%s' due to: '%s'",i:All(),m))end
|
||||
end end c(']'==i:Next())return j end h.ReadObject=function(i)local j={}c(i:Next(
|
||||
)=='{')local k=false if i:Peek()=='}'then k=true end while not k do local l=i:
|
||||
Read()if type(l)~='string'then error(string.format(
|
||||
'Invalid non-string object key: %s',l))end i:SkipWhiteSpace()local m=i:Next()if
|
||||
m~=':'then error(string.format("Invalid object: '%s' due to: '%s'",i:All(),m))
|
||||
end i:SkipWhiteSpace()local n=i:Read()j[l]=n i:SkipWhiteSpace()if i:Peek()=='}'
|
||||
then k=true end if not k then m=i:Next()if m~=','then error(string.format(
|
||||
"Invalid array: '%s' near: '%s'",i:All(),m))end end end c(i:Next()=='}')return j
|
||||
end h.SkipWhiteSpace=function(i)local j=i:Peek()while(j~=nil)and string.find(j,
|
||||
'[%s/]')do if j=='/'then i:ReadComment()else i:Next()end j=i:Peek()end end h.
|
||||
Peek=function(i)return i.reader:Peek()end h.Next=function(i)return i.reader:
|
||||
Next()end h.All=function(i)return i.reader:All()end local i i=function(j)local k
|
||||
=f:New()k:Write(j)k:ToString()return k end local j j=function(k)local l=h:New(k)
|
||||
l:Read()return l end a.DecodeJSON=function(k)pcall(function()return warn
|
||||
[[RbxUtility.DecodeJSON is deprecated, please use Game:GetService("HttpService"):JSONDecode() instead.]]
|
||||
end)if type(k)=='string'then return j(k)end print
|
||||
'RbxUtil.DecodeJSON expects string argument!'return nil end a.EncodeJSON=
|
||||
function(k)pcall(function()return warn
|
||||
[[RbxUtility.EncodeJSON is deprecated, please use Game:GetService("HttpService"):JSONEncode() instead.]]
|
||||
end)return i(k)end a.MakeWedge=function(k,l,m,n)return game:GetService'Terrain':
|
||||
AutoWedgeCell(k,l,m)end a.SelectTerrainRegion=function(k,l,m,n)local o=game.
|
||||
Workspace:FindFirstChild'Terrain'if not o then return end c(k)c(l)if not type(k)
|
||||
=='Region3'then error(
|
||||
[[regionToSelect (first arg), should be of type Region3, but is type]],type(k))
|
||||
end if not type(l)=='BrickColor'then error(
|
||||
[[color (second arg), should be of type BrickColor, but is type]],type(l))end
|
||||
local p,q,r,s,t,u,v,w,x,y,z,A,B,C=o.GetCell,o.WorldToCellPreferSolid,o.
|
||||
CellCenterToWorld,Enum.CellMaterial.Empty,b('Model','SelectionContainer',{
|
||||
Archivable=false,Parent=(function()if n then return n else return game.Workspace
|
||||
end end)()}),nil,nil,0,nil,{},{},b('Part','SelectionPart',{Transparency=1,
|
||||
Anchored=true,Locked=true,CanCollide=false,Size=Vector3.new(4.2,4.2,4.2)}),
|
||||
Instance.new'SelectionBox',nil C=function(D)local E,F if#z>0 then E=z[1]['part']
|
||||
F=z[1]['box']table.remove(z,1)F.Visible=true else E=A:Clone()E.Archivable=false
|
||||
F=B:Clone()F.Archivable=false F.Adornee=E F.Parent=t F.Adornee=E F.Parent=t end
|
||||
if D then F.Color=D end return E,F end local D D=function()for E,F in pairs(y)do
|
||||
if F.KeepAlive~=v then F.SelectionBox.Visible=false table.insert(z,{part=F.
|
||||
SelectionPart,box=F.SelectionBox})y[E]=nil end end end local E E=function()w=w+1
|
||||
if w>1000000 then w=0 end return w end local F F=function(G,H)local I,J=G.CFrame
|
||||
.p-G.Size/2+Vector3.new(2,2,2),G.CFrame.p+G.Size/2-Vector3.new(2,2,2)local K,L=
|
||||
q(o,I),q(o,J)v=E()for M=K.y,L.y do for N=K.z,L.z do for O=K.x,L.x do local P=p(o
|
||||
,O,M,N)if P~=s then local Q,R,S=r(o,O,M,N),Vector3int16.new(O,M,N),false for T,U
|
||||
in pairs(y)do if T==R then U.KeepAlive=v if H then U.SelectionBox.Color=H end S=
|
||||
true break end end if not S then local V,W V,W=C(H)V.Size=Vector3.new(4,4,4)V.
|
||||
CFrame=CFrame.new(Q)local X={SelectionPart=V,SelectionBox=W,KeepAlive=v}y[R]=X
|
||||
end end end end end return D()end x=k if m then local G,H G,H=C(l)G.Size=k.Size
|
||||
G.CFrame=k.CFrame y.SelectionPart=G y.SelectionBox=H u=function(I,J)if I and I~=
|
||||
x then x=I G.Size=I.Size G.CFrame=I.CFrame end if J then H.Color=J end end else
|
||||
F(k,l)u=function(G,H)if G and G~=x then x=G return F(G,H)end end end local G G=
|
||||
function()u=nil if t~=nil then t:Destroy()end y=nil end return u,G end a.
|
||||
CreateSignal=function()local k,l,m={},Instance.new'BindableEvent',{}k.connect=
|
||||
function(n,o)if n~=k then error('connect must be called with `:`, not `.`',2)end
|
||||
if type(o)~='function'then error(
|
||||
'Argument #1 of connect must be a function, got a '..tostring(type(o)),2)end
|
||||
local p=l.Event:connect(o)m[p]=true local q={}q.disconnect=function(r)p:
|
||||
disconnect()m[p]=nil end q.Disconnect=q.disconnect return q end k.disconnect=
|
||||
function(n)if n~=k then error('disconnect must be called with `:`, not `.`',2)
|
||||
end for o,p in pairs(m)do o:disconnect()m[o]=nil end end k.wait=function(n)if n
|
||||
~=k then error('wait must be called with `:`, not `.`',2)end return l.Event:
|
||||
wait()end k.fire=function(n,...)if n~=k then error(
|
||||
'fire must be called with `:`, not `.`',2)end return l:Fire(...)end k.Connect=k.
|
||||
connect k.Disconnect=k.disconnect k.Wait=k.wait k.Fire=k.fire return k end local
|
||||
k k=function(l)if type(l)~='string'then error(
|
||||
'Argument of Create must be a string',2)end return function(m)m=m or{}local n,o,
|
||||
p=Instance.new(l),nil,nil for q,r in pairs(m)do if type(q)=='string'then if q==
|
||||
'Parent'then o=r else n[q]=r end elseif type(q)=='number'then if type(r)~=
|
||||
'userdata'then error(
|
||||
[[Bad entry in Create body: Numeric keys must be paired with children, got a: ]]
|
||||
..tostring(type(r)),2)end r.Parent=n elseif type(q)=='table'and q.__eventname
|
||||
then if type(r)~='function'then error(
|
||||
"Bad entry in Create body: Key `[Create.E'"..tostring(q.__eventname)..
|
||||
"']` must have a function value, got: "..tostring(r),2)end n[q.__eventname]:
|
||||
connect(r)elseif q==a.Create then if type(r)~='function'then error(
|
||||
[[Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: ]]
|
||||
..tostring(r),2)elseif p then error(
|
||||
[[Bad entry in Create body: Only one constructor function is allowed]],2)end p=r
|
||||
else error('Bad entry ('..tostring(q)..' => '..tostring(r)..') in Create body',2
|
||||
)end end if p~=nil then p(n)end if o then n.Parent=o end return n end end a.
|
||||
Create=setmetatable({},{['__call']=function(l,...)return k(...)end})a.Create.E=
|
||||
function(l)return{__eventname=l}end a.Help=function(l)if'DecodeJSON'==l or a.
|
||||
DecodeJSON==l then return
|
||||
[[Function DecodeJSON. Arguments: (string). Side effect: returns a table with all parsed JSON values]]
|
||||
elseif'EncodeJSON'==l or a.EncodeJSON==l then return
|
||||
[[Function EncodeJSON. Arguments: (table). Side effect: returns a string composed of argument table in JSON data format]]
|
||||
elseif'MakeWedge'==l or a.MakeWedge==l then return
|
||||
[[Function MakeWedge. Arguments: (x, y, z, [default material]). Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously was. Returns true if made a wedge, false if the cell remains a block ]]
|
||||
elseif'SelectTerrainRegion'==l or a.SelectTerrainRegion==l then return
|
||||
[[Function SelectTerrainRegion. Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). Description: Selects all terrain via a series of selection boxes within the regionToSelect (this should be a region3 value). The selection box color is detemined by the color argument (should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional).SelectEmptyCells is bool, when true will select all cells in the region, otherwise we only select non-empty cells. Returns a function that can update the selection,arguments to said function are a new region3 to select, and the adornment color (color arg is optional). Also returns a second function that takes no arguments and destroys the selection]]
|
||||
elseif'CreateSignal'==l or a.CreateSignal==l then return
|
||||
[[Function CreateSignal. Arguments: None. Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class used for events in Objects, but is a Lua-side object so it can be used to create custom events inLua code. Methods of the Signal object: :connect, :wait, :fire, :disconnect. For more info you can pass the method name to the Help function, or view the wiki page for this library. EG: Help('Signal:connect').]]
|
||||
elseif'Signal:connect'==l then return
|
||||
[[Method Signal:connect. Arguments: (function handler). Return: A connection object which can be used to disconnect the connection to this handler. Description: Connectes a handler function to this Signal, so that when |fire| is called the handler function will be called with the arguments passed to |fire|.]]
|
||||
elseif'Signal:wait'==l then return
|
||||
[[Method Signal:wait. Arguments: None. Returns: The arguments passed to the next call to |fire|. Description: This call does not return until the next call to |fire| is made, at which point it will return the values which were passed as arguments to that |fire| call.]]
|
||||
elseif'Signal:fire'==l then return
|
||||
[[Method Signal:fire. Arguments: Any number of arguments of any type. Returns: None. Description: This call will invoke any connected handler functions, and notify any waiting code attached to this Signal to continue, with the arguments passed to this function. Note: The calls to handlers are made asynchronously, so this call will return immediately regardless of how long it takes the connected handler functions to complete.]]
|
||||
elseif'Signal:disconnect'==l then return
|
||||
[[Method Signal:disconnect. Arguments: None. Returns: None. Description: This call disconnects all handlers attacched to this function, note however, it does NOT make waiting code continue, as is the behavior of normal Roblox events. This method can also be called on the connection object which is returned from Signal:connect to only disconnect a single handler, as opposed to this method, which will disconnect all handlers.]]
|
||||
elseif'Create'==l then return
|
||||
[[Function Create. Arguments: A table containing information about how to construct a collection of objects. Returns: The constructed objects. Descrition: Create is a very powerfull function, whose description is too long to fit here, and is best described via example, please see the wiki page for a description of how to use it.]]
|
||||
end end return a
|
||||
local t = { }
|
||||
local New
|
||||
New = function(className, name, props)
|
||||
if not (props ~= nil) then
|
||||
props = name
|
||||
name = nil
|
||||
end
|
||||
local obj = Instance.new(className)
|
||||
if name then
|
||||
obj.Name = name
|
||||
end
|
||||
local parent
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" and type(v) == "userdata" then
|
||||
v.Parent = obj
|
||||
end
|
||||
end
|
||||
obj.Parent = parent
|
||||
return obj
|
||||
end
|
||||
local assert = assert
|
||||
local Null
|
||||
Null = function()
|
||||
return Null
|
||||
end
|
||||
local StringBuilder = {
|
||||
buffer = { }
|
||||
}
|
||||
StringBuilder.New = function(self)
|
||||
local o = setmetatable({ }, self)
|
||||
self.__index = self
|
||||
o.buffer = { }
|
||||
return o
|
||||
end
|
||||
StringBuilder.Append = function(self, s)
|
||||
do
|
||||
local _obj_0 = self.buffer
|
||||
_obj_0[#_obj_0 + 1] = s
|
||||
end
|
||||
end
|
||||
StringBuilder.ToString = function(self)
|
||||
return table.concat(self.buffer)
|
||||
end
|
||||
local JsonWriter = {
|
||||
backslashes = {
|
||||
["\b"] = "\\b",
|
||||
["\t"] = "\\t",
|
||||
["\n"] = "\\n",
|
||||
["\f"] = "\\f",
|
||||
["\r"] = "\\r",
|
||||
['"'] = '\\"',
|
||||
["\\"] = "\\\\",
|
||||
["/"] = "\\/"
|
||||
}
|
||||
}
|
||||
JsonWriter.New = function(self)
|
||||
local o = setmetatable({ }, self)
|
||||
o.writer = StringBuilder:New()
|
||||
self.__index = self
|
||||
return o
|
||||
end
|
||||
JsonWriter.Append = function(self, s)
|
||||
return self.writer:Append(s)
|
||||
end
|
||||
JsonWriter.ToString = function(self)
|
||||
return self.writer:ToString()
|
||||
end
|
||||
JsonWriter.Write = function(self, o)
|
||||
local _exp_0 = type(o)
|
||||
if "nil" == _exp_0 then
|
||||
return self:WriteNil()
|
||||
elseif "boolean" == _exp_0 or "number" == _exp_0 then
|
||||
return self:WriteString(o)
|
||||
elseif "string" == _exp_0 then
|
||||
return self:ParseString(o)
|
||||
elseif "table" == _exp_0 then
|
||||
return self:WriteTable(o)
|
||||
elseif "function" == _exp_0 then
|
||||
return self:WriteFunction(o)
|
||||
elseif "thread" == _exp_0 or "userdata" == _exp_0 then
|
||||
return self:WriteError(o)
|
||||
end
|
||||
end
|
||||
JsonWriter.WriteNil = function(self)
|
||||
return self:Append("null")
|
||||
end
|
||||
JsonWriter.WriteString = function(self, o)
|
||||
return self:Append(tostring(o))
|
||||
end
|
||||
JsonWriter.ParseString = function(self, s)
|
||||
self:Append('"')
|
||||
self:Append(string.gsub(s, '[%z%c\\"/]', function(n)
|
||||
local c = self.backslashes[n]
|
||||
if c then
|
||||
return c
|
||||
end
|
||||
return string.format("\\u%.4X", string.byte(n))
|
||||
end))
|
||||
return self:Append('"')
|
||||
end
|
||||
JsonWriter.IsArray = function(self, t)
|
||||
local count = 0
|
||||
local isindex
|
||||
isindex = function(k)
|
||||
if type(k) == "number" and k > 0 and math.floor(k) == k then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
for k, _ in pairs(t) do
|
||||
if not isindex(k) then
|
||||
return false, "{", "}"
|
||||
else
|
||||
count = math.max(count, k)
|
||||
end
|
||||
end
|
||||
return true, "[", "]", count
|
||||
end
|
||||
JsonWriter.WriteTable = function(self, t)
|
||||
local ba, st, et, n = self:IsArray(t)
|
||||
self:Append(st)
|
||||
if ba then
|
||||
for i = 1, n do
|
||||
self:Write(t[i])
|
||||
if i < n then
|
||||
self:Append(",")
|
||||
end
|
||||
end
|
||||
else
|
||||
local first = true
|
||||
for k, v in pairs(t) do
|
||||
if not first then
|
||||
self:Append(",")
|
||||
end
|
||||
first = false
|
||||
self:ParseString(k)
|
||||
self:Append(":")
|
||||
self:Write(v)
|
||||
end
|
||||
end
|
||||
return self:Append(et)
|
||||
end
|
||||
JsonWriter.WriteError = function(self, o)
|
||||
return error(string.format("Encoding of %s unsupported", tostring(o)))
|
||||
end
|
||||
JsonWriter.WriteFunction = function(self, o)
|
||||
if o == Null then
|
||||
return self:WriteNil()
|
||||
else
|
||||
return self:WriteError(o)
|
||||
end
|
||||
end
|
||||
local StringReader = {
|
||||
s = "",
|
||||
i = 0
|
||||
}
|
||||
StringReader.New = function(self, s)
|
||||
local o = setmetatable({ }, self)
|
||||
self.__index = self
|
||||
o.s = s or o.s
|
||||
return o
|
||||
end
|
||||
StringReader.Peek = function(self)
|
||||
local i = self.i + 1
|
||||
if i <= #self.s then
|
||||
return string.sub(self.s, i, i)
|
||||
end
|
||||
return nil
|
||||
end
|
||||
StringReader.Next = function(self)
|
||||
self.i = self.i + 1
|
||||
if self.i <= #self.s then
|
||||
return string.sub(self.s, self.i, self.i)
|
||||
end
|
||||
return nil
|
||||
end
|
||||
StringReader.All = function(self)
|
||||
return self.s
|
||||
end
|
||||
local JsonReader = {
|
||||
escapes = {
|
||||
["t"] = "\t",
|
||||
["n"] = "\n",
|
||||
["f"] = "\f",
|
||||
["r"] = "\r",
|
||||
["b"] = "\b"
|
||||
}
|
||||
}
|
||||
JsonReader.New = function(self, s)
|
||||
local o = setmetatable({ }, self)
|
||||
o.reader = StringReader:New(s)
|
||||
self.__index = self
|
||||
return o
|
||||
end
|
||||
JsonReader.Read = function(self)
|
||||
self:SkipWhiteSpace()
|
||||
local peek = self:Peek()
|
||||
if not (peek ~= nil) then
|
||||
return error(string.format("Nil string: '%s'", self:All()))
|
||||
elseif peek == "{" then
|
||||
return self:ReadObject()
|
||||
elseif peek == "[" then
|
||||
return self:ReadArray()
|
||||
elseif peek == '"' then
|
||||
return self:ReadString()
|
||||
elseif string.find(peek, "[%+%-%d]") then
|
||||
return self:ReadNumber()
|
||||
elseif peek == "t" then
|
||||
return self:ReadTrue()
|
||||
elseif peek == "f" then
|
||||
return self:ReadFalse()
|
||||
elseif peek == "n" then
|
||||
return self:ReadNull()
|
||||
elseif peek == "/" then
|
||||
self:ReadComment()
|
||||
return self:Read()
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
JsonReader.ReadTrue = function(self)
|
||||
self:TestReservedWord({
|
||||
't',
|
||||
'r',
|
||||
'u',
|
||||
'e'
|
||||
})
|
||||
return true
|
||||
end
|
||||
JsonReader.ReadFalse = function(self)
|
||||
self:TestReservedWord({
|
||||
'f',
|
||||
'a',
|
||||
'l',
|
||||
's',
|
||||
'e'
|
||||
})
|
||||
return false
|
||||
end
|
||||
JsonReader.ReadNull = function(self)
|
||||
self:TestReservedWord({
|
||||
'n',
|
||||
'u',
|
||||
'l',
|
||||
'l'
|
||||
})
|
||||
return nil
|
||||
end
|
||||
JsonReader.TestReservedWord = function(self, t)
|
||||
for _, v in ipairs(t) do
|
||||
if self:Next() ~= v then
|
||||
error(string.format("Error reading '%s': %s", table.concat(t), self:All()))
|
||||
end
|
||||
end
|
||||
end
|
||||
JsonReader.ReadNumber = function(self)
|
||||
local result = self:Next()
|
||||
local peek = self:Peek()
|
||||
while (peek ~= nil) and string.find(peek, "[%+%-%d%.eE]") do
|
||||
result = result .. self:Next()
|
||||
peek = self:Peek()
|
||||
end
|
||||
result = tonumber(result)
|
||||
if not (result ~= nil) then
|
||||
return error(string.format("Invalid number: '%s'", result))
|
||||
else
|
||||
return result
|
||||
end
|
||||
end
|
||||
JsonReader.ReadString = function(self)
|
||||
local result = ""
|
||||
assert(self:Next() == '"')
|
||||
while self:Peek() ~= '"' do
|
||||
local ch = self:Next()
|
||||
if ch == "\\" then
|
||||
ch = self:Next()
|
||||
if self.escapes[ch] then
|
||||
ch = self.escapes[ch]
|
||||
end
|
||||
end
|
||||
result = result .. ch
|
||||
end
|
||||
assert(self:Next() == '"')
|
||||
local fromunicode
|
||||
fromunicode = function(m)
|
||||
return string.char(tonumber(m, 16))
|
||||
end
|
||||
return string.gsub(result, "u%x%x(%x%x)", fromunicode)
|
||||
end
|
||||
JsonReader.ReadComment = function(self)
|
||||
assert(self:Next() == "/")
|
||||
local second = self:Next()
|
||||
if second == "/" then
|
||||
return self:ReadSingleLineComment()
|
||||
elseif second == "*" then
|
||||
return self:ReadBlockComment()
|
||||
else
|
||||
return error(string.format("Invalid comment: %s", self:All()))
|
||||
end
|
||||
end
|
||||
JsonReader.ReadBlockComment = function(self)
|
||||
local done = false
|
||||
while not done do
|
||||
local ch = self:Next()
|
||||
if ch == "*" and self:Peek() == "/" then
|
||||
done = true
|
||||
end
|
||||
if not done and ch == "/" and self:Peek() == "*" then
|
||||
error(string.format("Invalid comment: %s, '/*' illegal.", self:All()))
|
||||
end
|
||||
end
|
||||
return self:Next()
|
||||
end
|
||||
JsonReader.ReadSingleLineComment = function(self)
|
||||
local ch = self:Next()
|
||||
while ch ~= "\r" and ch ~= "\n" do
|
||||
ch = self:Next()
|
||||
end
|
||||
end
|
||||
JsonReader.ReadArray = function(self)
|
||||
local result = { }
|
||||
assert(self:Next() == "[")
|
||||
local done = false
|
||||
if self:Peek() == "]" then
|
||||
done = true
|
||||
end
|
||||
while not done do
|
||||
local item = self:Read()
|
||||
result[#result + 1] = item
|
||||
self:SkipWhiteSpace()
|
||||
if self:Peek() == "]" then
|
||||
done = true
|
||||
end
|
||||
if not done then
|
||||
local ch = self:Next()
|
||||
if ch ~= "," then
|
||||
error(string.format("Invalid array: '%s' due to: '%s'", self:All(), ch))
|
||||
end
|
||||
end
|
||||
end
|
||||
assert("]" == self:Next())
|
||||
return result
|
||||
end
|
||||
JsonReader.ReadObject = function(self)
|
||||
local result = { }
|
||||
assert(self:Next() == "{")
|
||||
local done = false
|
||||
if self:Peek() == "}" then
|
||||
done = true
|
||||
end
|
||||
while not done do
|
||||
local key = self:Read()
|
||||
if type(key) ~= "string" then
|
||||
error(string.format("Invalid non-string object key: %s", key))
|
||||
end
|
||||
self:SkipWhiteSpace()
|
||||
local ch = self:Next()
|
||||
if ch ~= ":" then
|
||||
error(string.format("Invalid object: '%s' due to: '%s'", self:All(), ch))
|
||||
end
|
||||
self:SkipWhiteSpace()
|
||||
local val = self:Read()
|
||||
result[key] = val
|
||||
self:SkipWhiteSpace()
|
||||
if self:Peek() == "}" then
|
||||
done = true
|
||||
end
|
||||
if not done then
|
||||
ch = self:Next()
|
||||
if ch ~= "," then
|
||||
error(string.format("Invalid array: '%s' near: '%s'", self:All(), ch))
|
||||
end
|
||||
end
|
||||
end
|
||||
assert(self:Next() == "}")
|
||||
return result
|
||||
end
|
||||
JsonReader.SkipWhiteSpace = function(self)
|
||||
local p = self:Peek()
|
||||
while (p ~= nil) and string.find(p, "[%s/]") do
|
||||
if p == "/" then
|
||||
self:ReadComment()
|
||||
else
|
||||
self:Next()
|
||||
end
|
||||
p = self:Peek()
|
||||
end
|
||||
end
|
||||
JsonReader.Peek = function(self)
|
||||
return self.reader:Peek()
|
||||
end
|
||||
JsonReader.Next = function(self)
|
||||
return self.reader:Next()
|
||||
end
|
||||
JsonReader.All = function(self)
|
||||
return self.reader:All()
|
||||
end
|
||||
local Encode
|
||||
Encode = function(o)
|
||||
local _with_0 = JsonWriter:New()
|
||||
_with_0:Write(o)
|
||||
_with_0:ToString()
|
||||
return _with_0
|
||||
end
|
||||
local Decode
|
||||
Decode = function(s)
|
||||
local _with_0 = JsonReader:New(s)
|
||||
_with_0:Read()
|
||||
return _with_0
|
||||
end
|
||||
t.DecodeJSON = function(jsonString)
|
||||
pcall(function()
|
||||
return warn('RbxUtility.DecodeJSON is deprecated, please use Game:GetService("HttpService"):JSONDecode() instead.')
|
||||
end)
|
||||
if type(jsonString) == "string" then
|
||||
return Decode(jsonString)
|
||||
end
|
||||
print("RbxUtil.DecodeJSON expects string argument!")
|
||||
return nil
|
||||
end
|
||||
t.EncodeJSON = function(jsonTable)
|
||||
pcall(function()
|
||||
return warn('RbxUtility.EncodeJSON is deprecated, please use Game:GetService("HttpService"):JSONEncode() instead.')
|
||||
end)
|
||||
return Encode(jsonTable)
|
||||
end
|
||||
t.MakeWedge = function(x, y, z, _)
|
||||
return game:GetService("Terrain"):AutoWedgeCell(x, y, z)
|
||||
end
|
||||
t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, selectionParent)
|
||||
local terrain = game.Workspace:FindFirstChild("Terrain")
|
||||
if not terrain then
|
||||
return
|
||||
end
|
||||
assert(regionToSelect)
|
||||
assert(color)
|
||||
if not type(regionToSelect) == "Region3" then
|
||||
error("regionToSelect (first arg), should be of type Region3, but is type", type(regionToSelect))
|
||||
end
|
||||
if not type(color) == "BrickColor" then
|
||||
error("color (second arg), should be of type BrickColor, but is type", type(color))
|
||||
end
|
||||
local GetCell = terrain.GetCell
|
||||
local WorldToCellPreferSolid = terrain.WorldToCellPreferSolid
|
||||
local CellCenterToWorld = terrain.CellCenterToWorld
|
||||
local emptyMaterial = Enum.CellMaterial.Empty
|
||||
local selectionContainer = New("Model", "SelectionContainer", {
|
||||
Archivable = false,
|
||||
Parent = (function()
|
||||
if selectionParent then
|
||||
return selectionParent
|
||||
else
|
||||
return game.Workspace
|
||||
end
|
||||
end)()
|
||||
})
|
||||
local updateSelection
|
||||
local currentKeepAliveTag
|
||||
local aliveCounter = 0
|
||||
local lastRegion
|
||||
local adornments = { }
|
||||
local reusableAdorns = { }
|
||||
local selectionPart = New("Part", "SelectionPart", {
|
||||
Transparency = 1,
|
||||
Anchored = true,
|
||||
Locked = true,
|
||||
CanCollide = false,
|
||||
Size = Vector3.new(4.2, 4.2, 4.2)
|
||||
})
|
||||
local selectionBox = Instance.new("SelectionBox")
|
||||
local createAdornment
|
||||
createAdornment = function(theColor)
|
||||
local selectionPartClone
|
||||
local selectionBoxClone
|
||||
if #reusableAdorns > 0 then
|
||||
selectionPartClone = reusableAdorns[1]["part"]
|
||||
selectionBoxClone = reusableAdorns[1]["box"]
|
||||
table.remove(reusableAdorns, 1)
|
||||
selectionBoxClone.Visible = true
|
||||
else
|
||||
selectionPartClone = selectionPart:Clone()
|
||||
selectionPartClone.Archivable = false
|
||||
selectionBoxClone = selectionBox:Clone()
|
||||
selectionBoxClone.Archivable = false
|
||||
selectionBoxClone.Adornee = selectionPartClone
|
||||
selectionBoxClone.Parent = selectionContainer
|
||||
selectionBoxClone.Adornee = selectionPartClone
|
||||
selectionBoxClone.Parent = selectionContainer
|
||||
end
|
||||
if theColor then
|
||||
selectionBoxClone.Color = theColor
|
||||
end
|
||||
return selectionPartClone, selectionBoxClone
|
||||
end
|
||||
local cleanUpAdornments
|
||||
cleanUpAdornments = function()
|
||||
for cellPos, adornTable in pairs(adornments) do
|
||||
if adornTable.KeepAlive ~= currentKeepAliveTag then
|
||||
adornTable.SelectionBox.Visible = false
|
||||
table.insert(reusableAdorns, {
|
||||
part = adornTable.SelectionPart,
|
||||
box = adornTable.SelectionBox
|
||||
})
|
||||
adornments[cellPos] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
local incrementAliveCounter
|
||||
incrementAliveCounter = function()
|
||||
aliveCounter = aliveCounter + 1
|
||||
if aliveCounter > 1000000 then
|
||||
aliveCounter = 0
|
||||
end
|
||||
return aliveCounter
|
||||
end
|
||||
local adornFullCellsInRegion
|
||||
adornFullCellsInRegion = function(region, color)
|
||||
local regionBegin = region.CFrame.p - region.Size / 2 + Vector3.new(2, 2, 2)
|
||||
local regionEnd = region.CFrame.p + region.Size / 2 - Vector3.new(2, 2, 2)
|
||||
local cellPosBegin = WorldToCellPreferSolid(terrain, regionBegin)
|
||||
local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd)
|
||||
currentKeepAliveTag = incrementAliveCounter()
|
||||
for y = cellPosBegin.y, cellPosEnd.y do
|
||||
for z = cellPosBegin.z, cellPosEnd.z do
|
||||
for x = cellPosBegin.x, cellPosEnd.x do
|
||||
local cellMaterial = GetCell(terrain, x, y, z)
|
||||
if cellMaterial ~= emptyMaterial then
|
||||
local cframePos = CellCenterToWorld(terrain, x, y, z)
|
||||
local cellPos = Vector3int16.new(x, y, z)
|
||||
local updated = false
|
||||
for cellPosAdorn, adornTable in pairs(adornments) do
|
||||
if cellPosAdorn == cellPos then
|
||||
adornTable.KeepAlive = currentKeepAliveTag
|
||||
if color then
|
||||
adornTable.SelectionBox.Color = color
|
||||
end
|
||||
updated = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not updated then
|
||||
local selectionPart, selectionBox
|
||||
selectionPart, selectionBox = createAdornment(color)
|
||||
selectionPart.Size = Vector3.new(4, 4, 4)
|
||||
selectionPart.CFrame = CFrame.new(cframePos)
|
||||
local adornTable = {
|
||||
SelectionPart = selectionPart,
|
||||
SelectionBox = selectionBox,
|
||||
KeepAlive = currentKeepAliveTag
|
||||
}
|
||||
adornments[cellPos] = adornTable
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return cleanUpAdornments()
|
||||
end
|
||||
lastRegion = regionToSelect
|
||||
if selectEmptyCells then
|
||||
local selectionPart, selectionBox
|
||||
selectionPart, selectionBox = createAdornment(color)
|
||||
selectionPart.Size = regionToSelect.Size
|
||||
selectionPart.CFrame = regionToSelect.CFrame
|
||||
adornments.SelectionPart = selectionPart
|
||||
adornments.SelectionBox = selectionBox
|
||||
updateSelection = function(newRegion, color)
|
||||
if newRegion and newRegion ~= lastRegion then
|
||||
lastRegion = newRegion
|
||||
selectionPart.Size = newRegion.Size
|
||||
selectionPart.CFrame = newRegion.CFrame
|
||||
end
|
||||
if color then
|
||||
selectionBox.Color = color
|
||||
end
|
||||
end
|
||||
else
|
||||
adornFullCellsInRegion(regionToSelect, color)
|
||||
updateSelection = function(newRegion, color)
|
||||
if newRegion and newRegion ~= lastRegion then
|
||||
lastRegion = newRegion
|
||||
return adornFullCellsInRegion(newRegion, color)
|
||||
end
|
||||
end
|
||||
end
|
||||
local destroyFunc
|
||||
destroyFunc = function()
|
||||
updateSelection = nil
|
||||
if selectionContainer ~= nil then
|
||||
selectionContainer:Destroy()
|
||||
end
|
||||
adornments = nil
|
||||
end
|
||||
return updateSelection, destroyFunc
|
||||
end
|
||||
t.CreateSignal = function()
|
||||
local this = { }
|
||||
local mBindableEvent = Instance.new("BindableEvent")
|
||||
local mAllCns = { }
|
||||
this.connect = function(self, func)
|
||||
if self ~= this then
|
||||
error("connect must be called with `:`, not `.`", 2)
|
||||
end
|
||||
if type(func) ~= "function" then
|
||||
error("Argument #1 of connect must be a function, got a " .. tostring(type(func)), 2)
|
||||
end
|
||||
local cn = mBindableEvent.Event:connect(func)
|
||||
mAllCns[cn] = true
|
||||
local pubCn = { }
|
||||
pubCn.disconnect = function(self)
|
||||
cn:disconnect()
|
||||
mAllCns[cn] = nil
|
||||
end
|
||||
pubCn.Disconnect = pubCn.disconnect
|
||||
return pubCn
|
||||
end
|
||||
this.disconnect = function(self)
|
||||
if self ~= this then
|
||||
error("disconnect must be called with `:`, not `.`", 2)
|
||||
end
|
||||
for cn, _ in pairs(mAllCns) do
|
||||
cn:disconnect()
|
||||
mAllCns[cn] = nil
|
||||
end
|
||||
end
|
||||
this.wait = function(self)
|
||||
if self ~= this then
|
||||
error("wait must be called with `:`, not `.`", 2)
|
||||
end
|
||||
return mBindableEvent.Event:wait()
|
||||
end
|
||||
this.fire = function(self, ...)
|
||||
if self ~= this then
|
||||
error("fire must be called with `:`, not `.`", 2)
|
||||
end
|
||||
return mBindableEvent:Fire(...)
|
||||
end
|
||||
this.Connect = this.connect
|
||||
this.Disconnect = this.disconnect
|
||||
this.Wait = this.wait
|
||||
this.Fire = this.fire
|
||||
return this
|
||||
end
|
||||
local Create_PrivImpl
|
||||
Create_PrivImpl = function(objectType)
|
||||
if type(objectType) ~= "string" then
|
||||
error("Argument of Create must be a string", 2)
|
||||
end
|
||||
return function(dat)
|
||||
dat = dat or { }
|
||||
local obj = Instance.new(objectType)
|
||||
local parent
|
||||
local ctor
|
||||
for k, v in pairs(dat) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
elseif type(k) == "number" then
|
||||
if type(v) ~= "userdata" then
|
||||
error("Bad entry in Create body: Numeric keys must be paired with children, got a: " .. tostring(type(v)), 2)
|
||||
end
|
||||
v.Parent = obj
|
||||
elseif type(k) == "table" and k.__eventname then
|
||||
if type(v) ~= "function" then
|
||||
error("Bad entry in Create body: Key `[Create.E'" .. tostring(k.__eventname) .. "']` must have a function value, got: " .. tostring(v), 2)
|
||||
end
|
||||
obj[k.__eventname]:connect(v)
|
||||
elseif k == t.Create then
|
||||
if type(v) ~= "function" then
|
||||
error("Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: " .. tostring(v), 2)
|
||||
elseif ctor then
|
||||
error("Bad entry in Create body: Only one constructor function is allowed", 2)
|
||||
end
|
||||
ctor = v
|
||||
else
|
||||
error("Bad entry (" .. tostring(k) .. " => " .. tostring(v) .. ") in Create body", 2)
|
||||
end
|
||||
end
|
||||
if ctor ~= nil then
|
||||
ctor(obj)
|
||||
end
|
||||
if parent then
|
||||
obj.Parent = parent
|
||||
end
|
||||
return obj
|
||||
end
|
||||
end
|
||||
t.Create = setmetatable({ }, {
|
||||
["__call"] = function(_, ...)
|
||||
return Create_PrivImpl(...)
|
||||
end
|
||||
})
|
||||
t.Create.E = function(eventName)
|
||||
return {
|
||||
__eventname = eventName
|
||||
}
|
||||
end
|
||||
t.Help = function(funcNameOrFunc)
|
||||
if "DecodeJSON" == funcNameOrFunc or t.DecodeJSON == funcNameOrFunc then
|
||||
return "Function DecodeJSON. " .. "Arguments: (string). " .. "Side effect: returns a table with all parsed JSON values"
|
||||
elseif "EncodeJSON" == funcNameOrFunc or t.EncodeJSON == funcNameOrFunc then
|
||||
return "Function EncodeJSON. " .. "Arguments: (table). " .. "Side effect: returns a string composed of argument table in JSON data format"
|
||||
elseif "MakeWedge" == funcNameOrFunc or t.MakeWedge == funcNameOrFunc then
|
||||
return "Function MakeWedge. " .. "Arguments: (x, y, z, [default material]). " .. "Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if " .. "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. " .. "Returns true if made a wedge, false if the cell remains a block "
|
||||
elseif "SelectTerrainRegion" == funcNameOrFunc or t.SelectTerrainRegion == funcNameOrFunc then
|
||||
return "Function SelectTerrainRegion. " .. "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " .. "Description: Selects all terrain via a series of selection boxes within the regionToSelect " .. "(this should be a region3 value). The selection box color is detemined by the color argument " .. "(should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional)." .. "SelectEmptyCells is bool, when true will select all cells in the " .. "region, otherwise we only select non-empty cells. Returns a function that can update the selection," .. "arguments to said function are a new region3 to select, and the adornment color (color arg is optional). " .. "Also returns a second function that takes no arguments and destroys the selection"
|
||||
elseif "CreateSignal" == funcNameOrFunc or t.CreateSignal == funcNameOrFunc then
|
||||
return "Function CreateSignal. " .. "Arguments: None. " .. "Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class " .. "used for events in Objects, but is a Lua-side object so it can be used to create custom events in" .. "Lua code. " .. "Methods of the Signal object: :connect, :wait, :fire, :disconnect. " .. "For more info you can pass the method name to the Help function, or view the wiki page " .. "for this library. EG: Help('Signal:connect')."
|
||||
elseif "Signal:connect" == funcNameOrFunc then
|
||||
return "Method Signal:connect. " .. "Arguments: (function handler). " .. "Return: A connection object which can be used to disconnect the connection to this handler. " .. "Description: Connectes a handler function to this Signal, so that when |fire| is called the " .. "handler function will be called with the arguments passed to |fire|."
|
||||
elseif "Signal:wait" == funcNameOrFunc then
|
||||
return "Method Signal:wait. " .. "Arguments: None. " .. "Returns: The arguments passed to the next call to |fire|. " .. "Description: This call does not return until the next call to |fire| is made, at which point it " .. "will return the values which were passed as arguments to that |fire| call."
|
||||
elseif "Signal:fire" == funcNameOrFunc then
|
||||
return "Method Signal:fire. " .. "Arguments: Any number of arguments of any type. " .. "Returns: None. " .. "Description: This call will invoke any connected handler functions, and notify any waiting code " .. "attached to this Signal to continue, with the arguments passed to this function. Note: The calls " .. "to handlers are made asynchronously, so this call will return immediately regardless of how long " .. "it takes the connected handler functions to complete."
|
||||
elseif "Signal:disconnect" == funcNameOrFunc then
|
||||
return "Method Signal:disconnect. " .. "Arguments: None. " .. "Returns: None. " .. "Description: This call disconnects all handlers attacched to this function, note however, it " .. "does NOT make waiting code continue, as is the behavior of normal Roblox events. This method " .. "can also be called on the connection object which is returned from Signal:connect to only " .. "disconnect a single handler, as opposed to this method, which will disconnect all handlers."
|
||||
elseif "Create" == funcNameOrFunc then
|
||||
return "Function Create. " .. "Arguments: A table containing information about how to construct a collection of objects. " .. "Returns: The constructed objects. " .. "Descrition: Create is a very powerfull function, whose description is too long to fit here, and " .. "is best described via example, please see the wiki page for a description of how to use it."
|
||||
end
|
||||
end
|
||||
return t
|
||||
|
|
|
|||
|
|
@ -1,7 +1,21 @@
|
|||
local a,b,c=3569749,game:GetService'ScriptContext',0 while not(b or c>2)do c=c+1
|
||||
b=game:GetService'ScriptContext'wait(0.2)end if b then b:RegisterLibrary(
|
||||
'Libraries/RbxGui','45284430')b:RegisterLibrary('Libraries/RbxGear','45374389')
|
||||
if game.PlaceId==a then b:RegisterLibrary('Libraries/RbxStatus','52177566')end b
|
||||
:RegisterLibrary('Libraries/RbxUtility','60595411')b:RegisterLibrary(
|
||||
'Libraries/RbxStamper','73157242')b:LibraryRegistrationComplete()else print
|
||||
'failed to find script context, libraries did not load'end return b
|
||||
local deepakTestingPlace = 3569749
|
||||
local sc = game:GetService("ScriptContext")
|
||||
local tries = 0
|
||||
while not (sc or tries > 2) do
|
||||
tries = tries + 1
|
||||
sc = game:GetService("ScriptContext")
|
||||
wait(0.2)
|
||||
end
|
||||
if sc then
|
||||
sc:RegisterLibrary("Libraries/RbxGui", "45284430")
|
||||
sc:RegisterLibrary("Libraries/RbxGear", "45374389")
|
||||
if game.PlaceId == deepakTestingPlace then
|
||||
sc:RegisterLibrary("Libraries/RbxStatus", "52177566")
|
||||
end
|
||||
sc:RegisterLibrary("Libraries/RbxUtility", "60595411")
|
||||
sc:RegisterLibrary("Libraries/RbxStamper", "73157242")
|
||||
sc:LibraryRegistrationComplete()
|
||||
else
|
||||
print("failed to find script context, libraries did not load")
|
||||
end
|
||||
return sc
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,86 +1,389 @@
|
|||
if game.CoreGui.Version<7 then return end local a a=function(b,c)while not b:
|
||||
FindFirstChild(c)do b.ChildAdded:wait()end return b:FindFirstChild(c)end local b
|
||||
b=function(c,d)while not c[d]do c.Changed:wait()end end a(game,'Players')if#game
|
||||
.Players:GetChildren()<1 then game.Players.ChildAdded:wait()end b(game.Players,
|
||||
'LocalPlayer')local c=script.Parent a(c,'Gear')local d=script.Parent.Parent
|
||||
assert(d:IsA'ScreenGui')a(c,'Tabs')a(c.Tabs,'CloseButton')local e=c.Tabs.
|
||||
CloseButton a(c.Tabs,'InventoryButton')local f,g=c.Tabs.InventoryButton,nil if
|
||||
game.CoreGui.Version>=8 then a(c.Tabs,'WardrobeButton')g=c.Tabs.WardrobeButton
|
||||
end a(c.Parent,'ControlFrame')local h,i,j=a(c.Parent.ControlFrame,
|
||||
'BackpackButton'),'gear',a(c,'SearchFrame')a(c.SearchFrame,'SearchBoxFrame')
|
||||
local k,l,m,n=a(c.SearchFrame.SearchBoxFrame,'SearchBox'),a(c.SearchFrame,
|
||||
'SearchButton'),a(c.SearchFrame,'ResetButton'),a(Game.CoreGui,'RobloxGui')local
|
||||
o=a(n,'CurrentLoadout')local p,q,r,s,t,u,v,w,x,y,z,A=a(o,'Background'),true,true
|
||||
,false,true,false,nil,0.25,'Search...','~','`',UDim2.new(0,600,0,400)if n.
|
||||
AbsoluteSize.Y<=320 then A=UDim2.new(0,200,0,140)end local B B=function(C)
|
||||
assert(C,'eventName is nil')assert(tostring(C),'eventName is not a string')local
|
||||
D=Instance.new'BindableEvent'D.Name=tostring(C)D.Parent=script return D end
|
||||
local C C=function(D,E)assert(D,'funcName is nil')assert(tostring(D),
|
||||
'funcName is not a string')assert(E,'invokeFunc is nil')assert(type(E)==
|
||||
'function',"invokeFunc should be of type 'function'")local F=Instance.new
|
||||
'BindableFunction'F.Name=tostring(D)F.OnInvoke=E F.Parent=script return F end
|
||||
local D,E,F,G,H,I=B'ResizeEvent',B'BackpackOpenEvent',B'BackpackCloseEvent',B
|
||||
'TabClickedEvent',B'SearchRequestedEvent',nil I=function()m.Visible=false k.Text
|
||||
=x end local J J=function()I()return H:Fire()end local K K=function()c.Visible=
|
||||
false t=false end local L L=function()if v then v:disconnect()end b(game.Players
|
||||
.LocalPlayer,'Character')a(game.Players.LocalPlayer.Character,'Humanoid')v=game.
|
||||
Players.LocalPlayer.Character.Humanoid.Died:connect(K)end local M M=function()s=
|
||||
false r=false h.Selected=false J()F:Fire(i)c.Tabs.Visible=false j.Visible=false
|
||||
c:TweenSizeAndPosition(UDim2.new(0,A.X.Offset,0,0),UDim2.new(0.5,-A.X.Offset/2,1
|
||||
,-85),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,w,true,function()game.
|
||||
GuiService:RemoveCenterDialog(c)c.Visible=false h.Selected=false end)return
|
||||
delay(w,function()game.GuiService:RemoveCenterDialog(c)c.Visible=false h.
|
||||
Selected=false r=true q=true end)end local N N=function()game.GuiService:
|
||||
AddCenterDialog(c,Enum.CenterDialogType.PlayerInitiatedDialog,function()c.
|
||||
Visible=true h.Selected=true end,function()c.Visible=false h.Selected=false end)
|
||||
c.Visible=true h.Selected=true c:TweenSizeAndPosition(A,UDim2.new(0.5,-A.X.
|
||||
Offset/2,1,-A.Y.Offset-88),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,w,true
|
||||
)return delay(w,function()c.Tabs.Visible=false j.Visible=true E:Fire(i)q=true r=
|
||||
true h.Image='http://www.roblox.com/asset/?id=97644093'h.Position=UDim2.new(0.5,
|
||||
-60,1,-A.Y.Offset-103)end)end local O O=function()if not game.Players.
|
||||
LocalPlayer then return end if not game.Players.LocalPlayer['Character']then
|
||||
return end if not q then return end if not r then return end r=false q=false s=
|
||||
not s if s then p.Image='http://www.roblox.com/asset/?id=97623721'p.Position=
|
||||
UDim2.new(-3E-2,0,-0.17,0)p.Size=UDim2.new(1.05,0,1.25,0)p.ZIndex=2 p.Visible=
|
||||
true return N()else h.Position=UDim2.new(0.5,-60,1,-44)p.Visible=false h.
|
||||
Selected=false h.Image='http://www.roblox.com/asset/?id=97617958'p.Image=
|
||||
'http://www.roblox.com/asset/?id=96536002'p.Position=UDim2.new(-0.1,0,-0.1,0)p.
|
||||
Size=UDim2.new(1.2,0,1.2,0)M()local P=o:GetChildren()for Q=1,#P do if P[Q]and P[
|
||||
Q]:IsA'Frame'then local R=P[Q]if#R:GetChildren()>0 then h.Position=UDim2.new(0.5
|
||||
,-60,1,-108)h.Visible=true p.Visible=true if R:GetChildren()[1]:IsA'ImageButton'
|
||||
then local S=R:GetChildren()[1]S.Active=true S.Draggable=false end end end end
|
||||
end end local P P=function()L()t=true c.Visible=s if s then return O()end end
|
||||
local Q Q=function()if s then return O()end end local R R=function(S)assert(S)
|
||||
assert(S:IsA'TextButton')S.BackgroundColor3=Color3.new(1,1,1)S.TextColor3=Color3
|
||||
.new(0,0,0)S.Selected=true S.ZIndex=3 return S end local S S=function(T)assert(T
|
||||
)assert(T:IsA'TextButton')T.BackgroundColor3=Color3.new(0,0,0)T.TextColor3=
|
||||
Color3.new(1,1,1)T.Selected=false T.ZIndex=1 return T end local T T=function(U)
|
||||
assert(U)if U=='gear'then R(f)return S(g)elseif U=='wardrobe'then R(g)return S(f
|
||||
)end end local U U=function(V)assert(V)assert(V:IsA'TextButton')if V.Selected
|
||||
then return end V.BackgroundColor3=Color3.new(0,0,0)end local V V=function(W)
|
||||
assert(W)assert(W:IsA'TextButton')if W.Selected then return end W.
|
||||
BackgroundColor3=Color3.new(0.15294117647058825,0.15294117647058825,
|
||||
0.15294117647058825)end local W W=function(X)assert(X)X=string.lower(X)i=X T(X)G
|
||||
:Fire(X)return J()end local X X=function(Y)return Y:gsub('^%s*(.-)%s*$','%1')end
|
||||
local Y Y=function()local Z=k.Text if Z==''then J()return end Z=X(Z)m.Visible=
|
||||
true return H:Fire(Z)end local Z Z=function()r=true end local _ _=function(aa,ab
|
||||
)if aa==Enum.CoreGuiType.Backpack or aa==Enum.CoreGuiType.All then t=ab u=not ab
|
||||
do local ac=game:GetService'GuiService'if u then pcall(function()ac:RemoveKey(y)
|
||||
return ac:RemoveKey(z)end)else ac:AddKey(y)ac:AddKey(z)end end J()j.Visible=ab
|
||||
and s o.Visible=ab c.Visible=ab h.Visible=ab end end C('CloseBackpack',M)C(
|
||||
'BackpackReady',Z)pcall(function()_(Enum.CoreGuiType.Backpack,Game.StarterGui:
|
||||
GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))return Game.StarterGui.
|
||||
CoreGuiChangedSignal:connect(_)end)f.MouseButton1Click:connect(function()return
|
||||
W'gear'end)f.MouseEnter:connect(function()return V(f)end)f.MouseLeave:connect(
|
||||
function()return U(f)end)if game.CoreGui.Version>=8 then g.MouseButton1Click:
|
||||
connect(function()return W'wardrobe'end)g.MouseEnter:connect(function()return V(
|
||||
g)end)g.MouseLeave:connect(function()return U(g)end)end e.MouseButton1Click:
|
||||
connect(Q)d.Changed:connect(function(aa)if aa=='AbsoluteSize'then return D:Fire(
|
||||
d.AbsoluteSize)end end)do local aa=game:GetService'GuiService'aa:AddKey(y)aa:
|
||||
AddKey(z)aa.KeyPressed:connect(function(ab)if not t or u then return end if ab==
|
||||
y or ab==z then return O()end end)end h.MouseButton1Click:connect(function()if
|
||||
not t or u then return end return O()end)if game.Players.LocalPlayer['Character'
|
||||
]then P()end game.Players.LocalPlayer.CharacterAdded:connect(P)k.FocusLost:
|
||||
connect(function(aa)if aa or k.Text~=''then return Y()elseif k.Text==''then
|
||||
return J()end end)l.MouseButton1Click:connect(Y)m.MouseButton1Click:connect(J)if
|
||||
j and n.AbsoluteSize.Y<=320 then j.RobloxLocked=false return j:Destroy()end
|
||||
if game.CoreGui.Version < 7 then
|
||||
return
|
||||
end
|
||||
local waitForChild
|
||||
waitForChild = function(instance, name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
instance.ChildAdded:wait()
|
||||
end
|
||||
return instance:FindFirstChild(name)
|
||||
end
|
||||
local waitForProperty
|
||||
waitForProperty = function(instance, property)
|
||||
while not instance[property] do
|
||||
instance.Changed:wait()
|
||||
end
|
||||
end
|
||||
waitForChild(game, "Players")
|
||||
if #game.Players:GetChildren() < 1 then
|
||||
game.Players.ChildAdded:wait()
|
||||
end
|
||||
waitForProperty(game.Players, "LocalPlayer")
|
||||
local backpack = script.Parent
|
||||
waitForChild(backpack, "Gear")
|
||||
local screen = script.Parent.Parent
|
||||
assert(screen:IsA("ScreenGui"))
|
||||
waitForChild(backpack, "Tabs")
|
||||
waitForChild(backpack.Tabs, "CloseButton")
|
||||
local closeButton = backpack.Tabs.CloseButton
|
||||
waitForChild(backpack.Tabs, "InventoryButton")
|
||||
local inventoryButton = backpack.Tabs.InventoryButton
|
||||
local wardrobeButton
|
||||
if game.CoreGui.Version >= 8 then
|
||||
waitForChild(backpack.Tabs, "WardrobeButton")
|
||||
wardrobeButton = backpack.Tabs.WardrobeButton
|
||||
end
|
||||
waitForChild(backpack.Parent, "ControlFrame")
|
||||
local backpackButton = waitForChild(backpack.Parent.ControlFrame, "BackpackButton")
|
||||
local currentTab = "gear"
|
||||
local searchFrame = waitForChild(backpack, "SearchFrame")
|
||||
waitForChild(backpack.SearchFrame, "SearchBoxFrame")
|
||||
local searchBox = waitForChild(backpack.SearchFrame.SearchBoxFrame, "SearchBox")
|
||||
local searchButton = waitForChild(backpack.SearchFrame, "SearchButton")
|
||||
local resetButton = waitForChild(backpack.SearchFrame, "ResetButton")
|
||||
local robloxGui = waitForChild(Game.CoreGui, "RobloxGui")
|
||||
local currentLoadout = waitForChild(robloxGui, "CurrentLoadout")
|
||||
local loadoutBackground = waitForChild(currentLoadout, "Background")
|
||||
local canToggle = true
|
||||
local readyForNextEvent = true
|
||||
local backpackIsOpen = false
|
||||
local active = true
|
||||
local disabledByDeveloper = false
|
||||
local humanoidDiedCon
|
||||
local guiTweenSpeed = 0.25
|
||||
local searchDefaultText = "Search..."
|
||||
local tilde = "~"
|
||||
local backquote = "`"
|
||||
local backpackSize = UDim2.new(0, 600, 0, 400)
|
||||
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||
backpackSize = UDim2.new(0, 200, 0, 140)
|
||||
end
|
||||
local createPublicEvent
|
||||
createPublicEvent = function(eventName)
|
||||
assert(eventName, "eventName is nil")
|
||||
assert(tostring(eventName), "eventName is not a string")
|
||||
local _with_0 = Instance.new("BindableEvent")
|
||||
_with_0.Name = tostring(eventName)
|
||||
_with_0.Parent = script
|
||||
return _with_0
|
||||
end
|
||||
local createPublicFunction
|
||||
createPublicFunction = function(funcName, invokeFunc)
|
||||
assert(funcName, "funcName is nil")
|
||||
assert(tostring(funcName), "funcName is not a string")
|
||||
assert(invokeFunc, "invokeFunc is nil")
|
||||
assert(type(invokeFunc) == "function", "invokeFunc should be of type 'function'")
|
||||
local _with_0 = Instance.new("BindableFunction")
|
||||
_with_0.Name = tostring(funcName)
|
||||
_with_0.OnInvoke = invokeFunc
|
||||
_with_0.Parent = script
|
||||
return _with_0
|
||||
end
|
||||
local resizeEvent = createPublicEvent("ResizeEvent")
|
||||
local backpackOpenEvent = createPublicEvent("BackpackOpenEvent")
|
||||
local backpackCloseEvent = createPublicEvent("BackpackCloseEvent")
|
||||
local tabClickedEvent = createPublicEvent("TabClickedEvent")
|
||||
local searchRequestedEvent = createPublicEvent("SearchRequestedEvent")
|
||||
local resetSearchBoxGui
|
||||
resetSearchBoxGui = function()
|
||||
resetButton.Visible = false
|
||||
searchBox.Text = searchDefaultText
|
||||
end
|
||||
local resetSearch
|
||||
resetSearch = function()
|
||||
resetSearchBoxGui()
|
||||
return searchRequestedEvent:Fire()
|
||||
end
|
||||
local deactivateBackpack
|
||||
deactivateBackpack = function()
|
||||
backpack.Visible = false
|
||||
active = false
|
||||
end
|
||||
local initHumanoidDiedConnections
|
||||
initHumanoidDiedConnections = function()
|
||||
if humanoidDiedCon then
|
||||
humanoidDiedCon:disconnect()
|
||||
end
|
||||
waitForProperty(game.Players.LocalPlayer, "Character")
|
||||
waitForChild(game.Players.LocalPlayer.Character, "Humanoid")
|
||||
humanoidDiedCon = game.Players.LocalPlayer.Character.Humanoid.Died:connect(deactivateBackpack)
|
||||
end
|
||||
local hideBackpack
|
||||
hideBackpack = function()
|
||||
backpackIsOpen = false
|
||||
readyForNextEvent = false
|
||||
backpackButton.Selected = false
|
||||
resetSearch()
|
||||
backpackCloseEvent:Fire(currentTab)
|
||||
backpack.Tabs.Visible = false
|
||||
searchFrame.Visible = false
|
||||
backpack:TweenSizeAndPosition(UDim2.new(0, backpackSize.X.Offset, 0, 0), UDim2.new(0.5, -backpackSize.X.Offset / 2, 1, -85), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, guiTweenSpeed, true, function()
|
||||
game.GuiService:RemoveCenterDialog(backpack)
|
||||
backpack.Visible = false
|
||||
backpackButton.Selected = false
|
||||
end)
|
||||
return delay(guiTweenSpeed, function()
|
||||
game.GuiService:RemoveCenterDialog(backpack)
|
||||
backpack.Visible = false
|
||||
backpackButton.Selected = false
|
||||
readyForNextEvent = true
|
||||
canToggle = true
|
||||
end)
|
||||
end
|
||||
local showBackpack
|
||||
showBackpack = function()
|
||||
game.GuiService:AddCenterDialog(backpack, Enum.CenterDialogType.PlayerInitiatedDialog, function()
|
||||
backpack.Visible = true
|
||||
backpackButton.Selected = true
|
||||
end, function()
|
||||
backpack.Visible = false
|
||||
backpackButton.Selected = false
|
||||
end)
|
||||
backpack.Visible = true
|
||||
backpackButton.Selected = true
|
||||
backpack:TweenSizeAndPosition(backpackSize, UDim2.new(0.5, -backpackSize.X.Offset / 2, 1, -backpackSize.Y.Offset - 88), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, guiTweenSpeed, true)
|
||||
return delay(guiTweenSpeed, function()
|
||||
backpack.Tabs.Visible = false
|
||||
searchFrame.Visible = true
|
||||
backpackOpenEvent:Fire(currentTab)
|
||||
canToggle = true
|
||||
readyForNextEvent = true
|
||||
backpackButton.Image = "http://www.roblox.com/asset/?id=97644093"
|
||||
backpackButton.Position = UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103)
|
||||
end)
|
||||
end
|
||||
local toggleBackpack
|
||||
toggleBackpack = function()
|
||||
if not game.Players.LocalPlayer then
|
||||
return
|
||||
end
|
||||
if not game.Players.LocalPlayer["Character"] then
|
||||
return
|
||||
end
|
||||
if not canToggle then
|
||||
return
|
||||
end
|
||||
if not readyForNextEvent then
|
||||
return
|
||||
end
|
||||
readyForNextEvent = false
|
||||
canToggle = false
|
||||
backpackIsOpen = not backpackIsOpen
|
||||
if backpackIsOpen then
|
||||
loadoutBackground.Image = "http://www.roblox.com/asset/?id=97623721"
|
||||
loadoutBackground.Position = UDim2.new(-0.03, 0, -0.17, 0)
|
||||
loadoutBackground.Size = UDim2.new(1.05, 0, 1.25, 0)
|
||||
loadoutBackground.ZIndex = 2.0
|
||||
loadoutBackground.Visible = true
|
||||
return showBackpack()
|
||||
else
|
||||
backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
|
||||
loadoutBackground.Visible = false
|
||||
backpackButton.Selected = false
|
||||
backpackButton.Image = "http://www.roblox.com/asset/?id=97617958"
|
||||
loadoutBackground.Image = "http://www.roblox.com/asset/?id=96536002"
|
||||
loadoutBackground.Position = UDim2.new(-0.1, 0, -0.1, 0)
|
||||
loadoutBackground.Size = UDim2.new(1.2, 0, 1.2, 0)
|
||||
hideBackpack()
|
||||
local clChildren = currentLoadout:GetChildren()
|
||||
for i = 1, #clChildren do
|
||||
if clChildren[i] and clChildren[i]:IsA("Frame") then
|
||||
local frame = clChildren[i]
|
||||
if #frame:GetChildren() > 0 then
|
||||
backpackButton.Position = UDim2.new(0.5, -60, 1, -108)
|
||||
backpackButton.Visible = true
|
||||
loadoutBackground.Visible = true
|
||||
if frame:GetChildren()[1]:IsA("ImageButton") then
|
||||
local imgButton = frame:GetChildren()[1]
|
||||
imgButton.Active = true
|
||||
imgButton.Draggable = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local activateBackpack
|
||||
activateBackpack = function()
|
||||
initHumanoidDiedConnections()
|
||||
active = true
|
||||
backpack.Visible = backpackIsOpen
|
||||
if backpackIsOpen then
|
||||
return toggleBackpack()
|
||||
end
|
||||
end
|
||||
local closeBackpack
|
||||
closeBackpack = function()
|
||||
if backpackIsOpen then
|
||||
return toggleBackpack()
|
||||
end
|
||||
end
|
||||
local setSelected
|
||||
setSelected = function(tab)
|
||||
assert(tab)
|
||||
assert(tab:IsA("TextButton"))
|
||||
tab.BackgroundColor3 = Color3.new(1, 1, 1)
|
||||
tab.TextColor3 = Color3.new(0, 0, 0)
|
||||
tab.Selected = true
|
||||
tab.ZIndex = 3
|
||||
return tab
|
||||
end
|
||||
local setUnselected
|
||||
setUnselected = function(tab)
|
||||
assert(tab)
|
||||
assert(tab:IsA("TextButton"))
|
||||
tab.BackgroundColor3 = Color3.new(0, 0, 0)
|
||||
tab.TextColor3 = Color3.new(1, 1, 1)
|
||||
tab.Selected = false
|
||||
tab.ZIndex = 1
|
||||
return tab
|
||||
end
|
||||
local updateTabGui
|
||||
updateTabGui = function(selectedTab)
|
||||
assert(selectedTab)
|
||||
if selectedTab == "gear" then
|
||||
setSelected(inventoryButton)
|
||||
return setUnselected(wardrobeButton)
|
||||
elseif selectedTab == "wardrobe" then
|
||||
setSelected(wardrobeButton)
|
||||
return setUnselected(inventoryButton)
|
||||
end
|
||||
end
|
||||
local mouseLeaveTab
|
||||
mouseLeaveTab = function(button)
|
||||
assert(button)
|
||||
assert(button:IsA("TextButton"))
|
||||
if button.Selected then
|
||||
return
|
||||
end
|
||||
button.BackgroundColor3 = Color3.new(0, 0, 0)
|
||||
end
|
||||
local mouseOverTab
|
||||
mouseOverTab = function(button)
|
||||
assert(button)
|
||||
assert(button:IsA("TextButton"))
|
||||
if button.Selected then
|
||||
return
|
||||
end
|
||||
button.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255)
|
||||
end
|
||||
local newTabClicked
|
||||
newTabClicked = function(tabName)
|
||||
assert(tabName)
|
||||
tabName = string.lower(tabName)
|
||||
currentTab = tabName
|
||||
updateTabGui(tabName)
|
||||
tabClickedEvent:Fire(tabName)
|
||||
return resetSearch()
|
||||
end
|
||||
local trim
|
||||
trim = function(s)
|
||||
return s:gsub("^%s*(.-)%s*$", "%1")
|
||||
end
|
||||
local doSearch
|
||||
doSearch = function()
|
||||
local searchText = searchBox.Text
|
||||
if searchText == "" then
|
||||
resetSearch()
|
||||
return
|
||||
end
|
||||
searchText = trim(searchText)
|
||||
resetButton.Visible = true
|
||||
return searchRequestedEvent:Fire(searchText)
|
||||
end
|
||||
local backpackReady
|
||||
backpackReady = function()
|
||||
readyForNextEvent = true
|
||||
end
|
||||
local coreGuiChanged
|
||||
coreGuiChanged = function(coreGuiType, enabled)
|
||||
if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then
|
||||
active = enabled
|
||||
disabledByDeveloper = not enabled
|
||||
do
|
||||
local _with_0 = game:GetService("GuiService")
|
||||
if disabledByDeveloper then
|
||||
pcall(function()
|
||||
_with_0:RemoveKey(tilde)
|
||||
return _with_0:RemoveKey(backquote)
|
||||
end)
|
||||
else
|
||||
_with_0:AddKey(tilde)
|
||||
_with_0:AddKey(backquote)
|
||||
end
|
||||
end
|
||||
resetSearch()
|
||||
searchFrame.Visible = enabled and backpackIsOpen
|
||||
currentLoadout.Visible = enabled
|
||||
backpack.Visible = enabled
|
||||
backpackButton.Visible = enabled
|
||||
end
|
||||
end
|
||||
createPublicFunction("CloseBackpack", hideBackpack)
|
||||
createPublicFunction("BackpackReady", backpackReady)
|
||||
pcall(function()
|
||||
coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))
|
||||
return Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
||||
end)
|
||||
inventoryButton.MouseButton1Click:connect(function()
|
||||
return newTabClicked("gear")
|
||||
end)
|
||||
inventoryButton.MouseEnter:connect(function()
|
||||
return mouseOverTab(inventoryButton)
|
||||
end)
|
||||
inventoryButton.MouseLeave:connect(function()
|
||||
return mouseLeaveTab(inventoryButton)
|
||||
end)
|
||||
if game.CoreGui.Version >= 8 then
|
||||
wardrobeButton.MouseButton1Click:connect(function()
|
||||
return newTabClicked("wardrobe")
|
||||
end)
|
||||
wardrobeButton.MouseEnter:connect(function()
|
||||
return mouseOverTab(wardrobeButton)
|
||||
end)
|
||||
wardrobeButton.MouseLeave:connect(function()
|
||||
return mouseLeaveTab(wardrobeButton)
|
||||
end)
|
||||
end
|
||||
closeButton.MouseButton1Click:connect(closeBackpack)
|
||||
screen.Changed:connect(function(prop)
|
||||
if prop == "AbsoluteSize" then
|
||||
return resizeEvent:Fire(screen.AbsoluteSize)
|
||||
end
|
||||
end)
|
||||
do
|
||||
local _with_0 = game:GetService("GuiService")
|
||||
_with_0:AddKey(tilde)
|
||||
_with_0:AddKey(backquote)
|
||||
_with_0.KeyPressed:connect(function(key)
|
||||
if not active or disabledByDeveloper then
|
||||
return
|
||||
end
|
||||
if key == tilde or key == backquote then
|
||||
return toggleBackpack()
|
||||
end
|
||||
end)
|
||||
end
|
||||
backpackButton.MouseButton1Click:connect(function()
|
||||
if not active or disabledByDeveloper then
|
||||
return
|
||||
end
|
||||
return toggleBackpack()
|
||||
end)
|
||||
if game.Players.LocalPlayer["Character"] then
|
||||
activateBackpack()
|
||||
end
|
||||
game.Players.LocalPlayer.CharacterAdded:connect(activateBackpack)
|
||||
searchBox.FocusLost:connect(function(enterPressed)
|
||||
if enterPressed or searchBox.Text ~= "" then
|
||||
return doSearch()
|
||||
elseif searchBox.Text == "" then
|
||||
return resetSearch()
|
||||
end
|
||||
end)
|
||||
searchButton.MouseButton1Click:connect(doSearch)
|
||||
resetButton.MouseButton1Click:connect(resetSearch)
|
||||
if searchFrame and robloxGui.AbsoluteSize.Y <= 320 then
|
||||
searchFrame.RobloxLocked = false
|
||||
return searchFrame:Destroy()
|
||||
end
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue