Test out updated corescripts
This commit is contained in:
parent
2c8762b878
commit
005f005eb0
|
|
@ -1,292 +1,270 @@
|
||||||
while not Game do wait(0.1)end while not game:GetService'MarketplaceService'do
|
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=a(b)if c then
|
||||||
wait(0.1)end while not game:FindFirstChild'CoreGui'do wait(0.1)end while not
|
e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then if g==
|
||||||
game.CoreGui:FindFirstChild'RobloxGui'do wait(0.1)end local a,b,c,d,e,f,g,h,i,j,
|
'Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)=='userdata'
|
||||||
k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=nil,game:GetService'ContentProvider'.BaseUrl:
|
then h.Parent=e end end e.Parent=f return e end while not Game do wait(0.1)end
|
||||||
lower(),nil,nil,nil,nil,nil,nil,nil,false,nil,false,true,nil,false,nil,0.3,UDim2
|
while not game:GetService'MarketplaceService'do wait(0.1)end while not game:
|
||||||
.new(0.5,-330,0.5,-200),UDim2.new(0.5,-330,1,25),nil,false,nil,450,{},
|
FindFirstChild'CoreGui'do wait(0.1)end while not game.CoreGui:FindFirstChild
|
||||||
'http://www.roblox.com/Asset/?id='local z=y..'42557901'table.insert(x,z)local A=
|
'RobloxGui'do wait(0.1)end local b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y
|
||||||
y..'104651457'table.insert(x,A)local B=y..'104651515'table.insert(x,B)local C=y
|
,z=nil,game:GetService'ContentProvider'.BaseUrl:lower(),nil,nil,nil,nil,nil,nil,
|
||||||
..'104651532'table.insert(x,C)local D=y..'104651592'table.insert(x,D)local E=y..
|
nil,false,nil,false,true,nil,false,nil,0.3,UDim2.new(0.5,-330,0.5,-200),UDim2.
|
||||||
'104651639'table.insert(x,E)local F=y..'104651665'table.insert(x,F)local G=y..
|
new(0.5,-330,1,25),nil,false,nil,450,{},nil z=function(A)return
|
||||||
'104651707'table.insert(x,G)local H=y..'104651733'table.insert(x,H)local I=y..
|
'http://www.roblox.com/Asset/?id='..tostring(A)end local A=z'42557901'table.
|
||||||
'104651761'table.insert(x,I)local J=y..'102481431'table.insert(x,J)local K=y..
|
insert(y,A)local B=z'104651457'table.insert(y,B)local C=z'104651515'table.
|
||||||
'102481419'table.insert(x,K)local L,M,N,O,P,Q,R,S,T,U='Buy','Take',
|
insert(y,C)local D=z'104651532'table.insert(y,D)local E=z'104651592'table.
|
||||||
'An Error Occurred','in-game purchases are disabled',
|
insert(y,E)local F=z'104651639'table.insert(y,F)local G=z'104651665'table.
|
||||||
|
insert(y,G)local H=z'104651707'table.insert(y,H)local I=z'104651733'table.
|
||||||
|
insert(y,I)local J=z'104651761'table.insert(y,J)local K=z'102481431'table.
|
||||||
|
insert(y,K)local L=z'102481419'table.insert(y,L)local M,N,O,P,Q,R,S,T,U,V,W=
|
||||||
|
'Buy','Take','An Error Occurred','in-game purchases are disabled',
|
||||||
'Roblox is performing maintenance','Your purchase of itemName succeeded!',
|
'Roblox is performing maintenance','Your purchase of itemName succeeded!',
|
||||||
[[Your purchase of itemName failed because errorReason. Your account has not been charged. Please try again soon.]]
|
[[Your purchase of itemName failed because errorReason. Your account has not been charged. Please try again soon.]]
|
||||||
,[[Would you like to buy 'itemName' for currencyType currencyAmount?]],
|
,[[Would you like to buy 'itemName' for currencyType currencyAmount?]],
|
||||||
"Would you like to take the assetType 'itemName' for FREE?",
|
"Would you like to take the assetType 'itemName' for FREE?",
|
||||||
[[Your balance of Robux or Tix will not be affected by this transaction.]]
|
[[Your balance of Robux or Tix will not be affected by this transaction.]],nil W
|
||||||
function getSecureApiBaseUrl()local V=b V=string.gsub(V,'http','https')V=string.
|
=function()local X=string.gsub(c,'http','https')X=string.gsub(X,'www','api')
|
||||||
gsub(V,'www','api')return V end function getRbxUtility()if not a then a=
|
return X end local X X=function()if not b then b=LoadLibrary'RbxUtility'end
|
||||||
LoadLibrary'RbxUtility'end return a end function preloadAssets()for V=1,#x do
|
return b end local Y Y=function()for Z=1,#y do game:GetService'ContentProvider':
|
||||||
game:GetService'ContentProvider':Preload(x[V])end end function
|
Preload(y[Z])end end local Z Z=function()e=nil f=nil g=nil h=nil i=nil d=nil j=
|
||||||
removeCurrentPurchaseInfo()d=nil e=nil f=nil g=nil h=nil c=nil i=nil j=false end
|
nil k=false end local _ _=function()q.PurchasingFrame.Visible=false v=false end
|
||||||
function closePurchasePrompt()p:TweenPosition(s,Enum.EasingDirection.Out,Enum.
|
local aa aa=function()return q:TweenPosition(t,Enum.EasingDirection.Out,Enum.
|
||||||
EasingStyle.Quad,q,true,function()game.GuiService:RemoveCenterDialog(p)
|
EasingStyle.Quad,r,true,function()game.GuiService:RemoveCenterDialog(q)_()q.
|
||||||
hidePurchasing()p.Visible=false o=false end)end function
|
Visible=false p=false end)end local ab ab=function(...)local ac,ad,ae={...},
|
||||||
userPurchaseActionsEnded(V)j=false if V then local W=string.gsub(Q,'itemName',
|
select('#',...),q.BodyFrame:GetChildren()for af=1,#ae do if ae[af]:IsA
|
||||||
tostring(c['Name']))p.BodyFrame.ItemPreview.ItemDescription.Text=W
|
'GuiButton'then ae[af].Visible=false for ag=1,ad do if ae[af]==ac[ag]then ae[af]
|
||||||
setButtonsVisible(p.BodyFrame.OkPurchasedButton)hidePurchasing()else
|
.Visible=true break end end end end end local ac ac=function(ad)aa()if m then
|
||||||
signalPromptEnded(V)end end function signalPromptEnded(V)closePurchasePrompt()if
|
game:GetService'MarketplaceService':SignalPromptProductPurchaseFinished(game.
|
||||||
l then game:GetService'MarketplaceService':SignalPromptProductPurchaseFinished(
|
Players.LocalPlayer.userId,i,ad)else game:GetService'MarketplaceService':
|
||||||
game.Players.LocalPlayer.userId,h,V)else game:GetService'MarketplaceService':
|
SignalPromptPurchaseFinished(game.Players.LocalPlayer,e,ad)end return Z()end
|
||||||
SignalPromptPurchaseFinished(game.Players.LocalPlayer,d,V)end
|
local ad ad=function(ae)k=false if ae then local af=string.gsub(R,'itemName',
|
||||||
removeCurrentPurchaseInfo()end function updatePurchasePromptData(V)local W=''if
|
tostring(d['Name']))q.BodyFrame.ItemPreview.ItemDescription.Text=af ab(q.
|
||||||
not h then h=c['ProductId']end if isFreeItem()then W=string.gsub(T,'itemName',
|
BodyFrame.OkPurchasedButton)return _()else return ac(ae)end end local ae ae=
|
||||||
tostring(c['Name']))W=string.gsub(W,'assetType',tostring(assetTypeToString(c[
|
function()return d and d['IsForSale']==true and d['IsPublicDomain']==true end
|
||||||
'AssetTypeId'])))setHeaderText(M)else W=string.gsub(S,'itemName',tostring(c[
|
local af af=function(ag)q.TitleLabel.Text=ag q.TitleBackdrop.Text=ag end local
|
||||||
'Name']))W=string.gsub(W,'currencyType',tostring(currencyTypeToString(e)))W=
|
ag ag=function(ah)if 1==ah then return'Image'elseif 2==ah then return'T-Shirt'
|
||||||
string.gsub(W,'currencyAmount',tostring(f))setHeaderText(L)end p.BodyFrame.
|
elseif 3==ah then return'Audio'elseif 4==ah then return'Mesh'elseif 5==ah then
|
||||||
ItemPreview.ItemDescription.Text=W if l then p.BodyFrame.ItemPreview.Image=b..
|
return'Lua'elseif 6==ah then return'HTML'elseif 7==ah then return'Text'elseif 8
|
||||||
'thumbs/asset.ashx?assetid='..tostring(c['IconImageAssetId'])..
|
==ah then return'Hat'elseif 9==ah then return'Place'elseif 10==ah then return
|
||||||
'&x=100&y=100&format=png'else p.BodyFrame.ItemPreview.Image=b..
|
'Model'elseif 11==ah then return'Shirt'elseif 12==ah then return'Pants'elseif 13
|
||||||
'thumbs/asset.ashx?assetid='..tostring(d)..'&x=100&y=100&format=png'end end
|
==ah then return'Decal'elseif 16==ah then return'Avatar'elseif 17==ah then
|
||||||
function doPlayerFundsCheck(V)if j then local W,X=canPurchaseItem()if W and X
|
return'Head'elseif 18==ah then return'Face'elseif 19==ah then return'Gear'elseif
|
||||||
then local Y=1000 while(Y>0 or V)and X and j and W do wait(0.1)W,X=
|
21==ah then return'Badge'elseif 22==ah then return'Group Emblem'elseif 24==ah
|
||||||
canPurchaseItem()Y=Y-1 end end if W and not X then setButtonsVisible(p.BodyFrame
|
then return'Animation'elseif 25==ah then return'Arms'elseif 26==ah then return
|
||||||
.BuyButton,p.BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)end end end
|
'Legs'elseif 27==ah then return'Torso'elseif 28==ah then return'Right Arm'elseif
|
||||||
function showPurchasePrompt()local V,W,X,Y,Z=canPurchaseItem()if V then
|
29==ah then return'Left Arm'elseif 30==ah then return'Left Leg'elseif 31==ah
|
||||||
updatePurchasePromptData()if Y and Z then p.BodyFrame.ItemPreview.
|
then return'Right Leg'elseif 32==ah then return'Package'elseif 33==ah then
|
||||||
ItemDescription.Text=Z p.BodyFrame.AfterBalanceButton.Visible=false end game.
|
return'YouTube Video'elseif 34==ah then return'Game Pass'elseif 0==ah then
|
||||||
GuiService:AddCenterDialog(p,Enum.CenterDialogType.ModalDialog,function()p.
|
return'Product'else return''end end local ah ah=function(ai)if ai==Enum.
|
||||||
Visible=true if isFreeItem()then setButtonsVisible(p.BodyFrame.FreeButton,p.
|
CurrencyType.Tix then return'Tix'else return'R$'end end local ai ai=function(aj)
|
||||||
BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)elseif X then p.BodyFrame.
|
local ak=''if not i then i=d['ProductId']end if ae()then ak=string.gsub(U,
|
||||||
AfterBalanceButton.Text=
|
'itemName',tostring(d['Name']))ak=string.gsub(ak,'assetType',tostring(ag(d[
|
||||||
[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]]
|
'AssetTypeId'])))af(N)else ak=string.gsub(T,'itemName',tostring(d['Name']))ak=
|
||||||
if not k then k=p.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(
|
string.gsub(ak,'currencyType',tostring(ah(f)))ak=string.gsub(ak,'currencyAmount'
|
||||||
function()if p.BodyFrame.AfterBalanceButton.Text==
|
,tostring(g))af(M)end q.BodyFrame.ItemPreview.ItemDescription.Text=ak if m then
|
||||||
[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]]
|
q.BodyFrame.ItemPreview.Image=c..'thumbs/asset.ashx?assetid='..tostring(d[
|
||||||
then openBCUpSellWindow()end end)end setButtonsVisible(p.BodyFrame.
|
'IconImageAssetId'])..'&x=100&y=100&format=png'else q.BodyFrame.ItemPreview.
|
||||||
BuyDisabledButton,p.BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)elseif
|
Image=c..'thumbs/asset.ashx?assetid='..tostring(e)..'&x=100&y=100&format=png'end
|
||||||
W then setButtonsVisible(p.BodyFrame.BuyDisabledButton,p.BodyFrame.CancelButton,
|
end local aj aj=function(ak,al)if f==Enum.CurrencyType.Default or f==Enum.
|
||||||
p.BodyFrame.AfterBalanceButton)elseif Y then setButtonsVisible(p.BodyFrame.
|
CurrencyType.Robux then if(ak~=nil)and ak~=0 then g=ak f=Enum.CurrencyType.Robux
|
||||||
BuyDisabledButton,p.BodyFrame.CancelButton)else setButtonsVisible(p.BodyFrame.
|
else g=al f=Enum.CurrencyType.Tix end elseif f==Enum.CurrencyType.Tix then if(al
|
||||||
BuyButton,p.BodyFrame.CancelButton)end p:TweenPosition(r,Enum.EasingDirection.
|
~=nil)and al~=0 then g=al f=Enum.CurrencyType.Tix else g=ak f=Enum.CurrencyType.
|
||||||
Out,Enum.EasingStyle.Quad,q,true)if V and W and not m then j=true
|
Robux end else return false end if not(g~=nil)then return false end return true
|
||||||
doPlayerFundsCheck(true)end end,function()p.Visible=false end)else
|
end local ak ak=function()local al,am,an am,an=pcall(function()al=game:
|
||||||
doDeclinePurchase()end end function getToolAssetID(V)local W=game:GetService
|
HttpGetAsync(tostring(W())..'currency/balance')end)if not am then print(
|
||||||
'InsertService':LoadAsset(V)if not W then return nil end if W:IsA'Tool'then
|
'Get player balance failed because',an)return nil end if al==''then return nil
|
||||||
return W end local X=W:GetChildren()for Y=1,#X do if X[Y]:IsA'Tool'then return X
|
end al=X().DecodeJSON(al)return al end local al al=function(am)if Enum.
|
||||||
[Y]end end return nil end function purchaseFailed(V)local W='Item'if c then W=c[
|
MembershipType.None==am then return 0 elseif Enum.MembershipType.BuildersClub==
|
||||||
'Name']end local X=string.gsub(R,'itemName',tostring(W))if V then X=string.gsub(
|
am then return 1 elseif Enum.MembershipType.TurboBuildersClub==am then return 2
|
||||||
X,'errorReason',tostring(O))else X=string.gsub(X,'errorReason',tostring(P))end p
|
elseif Enum.MembershipType.OutrageousBuildersClub==am then return 3 else return-
|
||||||
.BodyFrame.ItemPreview.ItemDescription.Text=X p.BodyFrame.ItemPreview.Image=z
|
1 end end local am am=function()k=true return game:GetService'GuiService':
|
||||||
setButtonsVisible(p.BodyFrame.OkButton)setHeaderText(N)hidePurchasing()end
|
OpenBrowserWindow(tostring(c)..'Upgrades/Robux.aspx')end local an an=function(ao
|
||||||
function doAcceptPurchase(V)showPurchasing()local W,X,Y=tick(),'none',nil if l
|
,ap)if ae()then q.BodyFrame.AfterBalanceButton.Text=V return true,false end
|
||||||
then Y=getSecureApiBaseUrl()..'marketplace/submitpurchase?productId='..tostring(
|
local aq if f==Enum.CurrencyType.Robux then aq='robux'elseif f==Enum.
|
||||||
h)..'¤cyTypeId='..tostring(currencyEnumToInt(e))..'&expectedUnitPrice='..
|
CurrencyType.Tix then aq='tickets'end if not aq then return false end local ar=
|
||||||
tostring(f)..'&placeId='..tostring(Game.PlaceId)else Y=getSecureApiBaseUrl()..
|
tonumber(ao[aq])if not ar then return false end local as=ar-g if not ap then if
|
||||||
'marketplace/purchase?productId='..tostring(h)..'¤cyTypeId='..tostring(
|
as<0 and aq=='robux'then if not(o~=nil)then o=q.BodyFrame.AfterBalanceButton.
|
||||||
currencyEnumToInt(e))..'&purchasePrice='..tostring(f)..'&locationType=Game'..
|
MouseButton1Click:connect(am)end q.BodyFrame.AfterBalanceButton.Text='You need '
|
||||||
'&locationId='..Game.PlaceId end local Z,_=ypcall(function()X=game:
|
..tostring(ah(f))..' '..tostring(-as)..
|
||||||
HttpPostAsync(Y,'RobloxPurchaseRequest')end)print(
|
' more to buy this, click here to purchase more.'return true,true elseif as<0
|
||||||
'doAcceptPurchase success from ypcall is ',Z,'reason is',_)if(tick()-W)<1 then
|
and aq=='tickets'then q.BodyFrame.AfterBalanceButton.Text='You need '..tostring(
|
||||||
wait(1)end if X=='none'or X==nil or X==''then print(
|
-as)..' '..tostring(ah(f))..' more to buy this item.'return true,true end end if
|
||||||
'did not get a proper response from web on purchase of',d,h)purchaseFailed()
|
o then o:disconnect()o=nil end q.BodyFrame.AfterBalanceButton.Text=
|
||||||
return end X=getRbxUtility().DecodeJSON(X)if X then if X['success']==false then
|
'Your balance after this transaction will be '..tostring(ah(f))..' '..tostring(
|
||||||
if X['status']~='AlreadyOwned'then print(
|
as)..'.'return true,false end local ao ao=function()local ap,aq,ar,as=false,
|
||||||
'web return response of fail on purchase of',d,h)purchaseFailed((X['status']==
|
false,nil,false if m then local at as=pcall(function()at=Game:HttpGetAsync(
|
||||||
'EconomyDisabled'))return end end else print(
|
tostring(W())..'marketplace/productDetails?productid='..tostring(i))end)if as
|
||||||
'web return response of non parsable JSON on purchase of',d)purchaseFailed()
|
then d=X().DecodeJSON(at)end else as=pcall(function()d=game:GetService
|
||||||
return end if g and Z and d and tonumber(c['AssetTypeId'])==19 then local aa=
|
'MarketplaceService':GetProductInfo(e)end)end if not(d~=nil)or not as then ar=
|
||||||
getToolAssetID(tonumber(d))if aa then aa.Parent=game.Players.LocalPlayer.
|
|
||||||
Backpack end end if l then if not X['receipt']then print(
|
|
||||||
[[tried to buy productId, but no receipt returned. productId was]],h)
|
|
||||||
purchaseFailed()return end Game:GetService'MarketplaceService':
|
|
||||||
SignalClientPurchaseSuccess(tostring(X['receipt']),game.Players.LocalPlayer.
|
|
||||||
userId,h)else userPurchaseActionsEnded(Z)end end function doDeclinePurchase()
|
|
||||||
userPurchaseActionsEnded(false)end function currencyEnumToInt(aa)if aa==Enum.
|
|
||||||
CurrencyType.Robux or aa==Enum.CurrencyType.Default then return 1 elseif aa==
|
|
||||||
Enum.CurrencyType.Tix then return 2 end end function assetTypeToString(aa)if aa
|
|
||||||
==1 then return'Image'elseif aa==2 then return'T-Shirt'elseif aa==3 then return
|
|
||||||
'Audio'elseif aa==4 then return'Mesh'elseif aa==5 then return'Lua'elseif aa==6
|
|
||||||
then return'HTML'elseif aa==7 then return'Text'elseif aa==8 then return'Hat'
|
|
||||||
elseif aa==9 then return'Place'elseif aa==10 then return'Model'elseif aa==11
|
|
||||||
then return'Shirt'elseif aa==12 then return'Pants'elseif aa==13 then return
|
|
||||||
'Decal'elseif aa==16 then return'Avatar'elseif aa==17 then return'Head'elseif aa
|
|
||||||
==18 then return'Face'elseif aa==19 then return'Gear'elseif aa==21 then return
|
|
||||||
'Badge'elseif aa==22 then return'Group Emblem'elseif aa==24 then return
|
|
||||||
'Animation'elseif aa==25 then return'Arms'elseif aa==26 then return'Legs'elseif
|
|
||||||
aa==27 then return'Torso'elseif aa==28 then return'Right Arm'elseif aa==29 then
|
|
||||||
return'Left Arm'elseif aa==30 then return'Left Leg'elseif aa==31 then return
|
|
||||||
'Right Leg'elseif aa==32 then return'Package'elseif aa==33 then return
|
|
||||||
'YouTube Video'elseif aa==34 then return'Game Pass'elseif aa==0 then return
|
|
||||||
'Product'end return''end function currencyTypeToString(aa)if aa==Enum.
|
|
||||||
CurrencyType.Tix then return'Tix'else return'R$'end end function
|
|
||||||
setCurrencyAmountAndType(aa,V)if e==Enum.CurrencyType.Default or e==Enum.
|
|
||||||
CurrencyType.Robux then if aa~=nil and aa~=0 then f=aa e=Enum.CurrencyType.Robux
|
|
||||||
else f=V e=Enum.CurrencyType.Tix end elseif e==Enum.CurrencyType.Tix then if V~=
|
|
||||||
nil and V~=0 then f=V e=Enum.CurrencyType.Tix else f=aa e=Enum.CurrencyType.
|
|
||||||
Robux end else return false end if f==nil then return false end return true end
|
|
||||||
function getPlayerBalance()local aa=nil local V,W=ypcall(function()aa=game:
|
|
||||||
HttpGetAsync(getSecureApiBaseUrl()..'currency/balance')end)if not V then print(
|
|
||||||
'Get player balance failed because',W)return nil end if aa==''then return nil
|
|
||||||
end aa=getRbxUtility().DecodeJSON(aa)return aa end function
|
|
||||||
openBuyCurrencyWindow()j=true game:GetService'GuiService':OpenBrowserWindow(b..
|
|
||||||
'Upgrades/Robux.aspx')end function openBCUpSellWindow()Game:GetService
|
|
||||||
'GuiService':OpenBrowserWindow(b..'Upgrades/BuildersClubMemberships.aspx')end
|
|
||||||
function updateAfterBalanceText(aa,V)if isFreeItem()then p.BodyFrame.
|
|
||||||
AfterBalanceButton.Text=U return true,false end local W=nil if e==Enum.
|
|
||||||
CurrencyType.Robux then W='robux'elseif e==Enum.CurrencyType.Tix then W=
|
|
||||||
'tickets'end if not W then return false end local X=tonumber(aa[W])if not X then
|
|
||||||
return false end local Y=X-f if not V then if Y<0 and W=='robux'then if n==nil
|
|
||||||
then n=p.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(
|
|
||||||
openBuyCurrencyWindow)end p.BodyFrame.AfterBalanceButton.Text='You need '..
|
|
||||||
currencyTypeToString(e)..' '..tostring(-Y)..
|
|
||||||
' more to buy this, click here to purchase more.'return true,true elseif Y<0 and
|
|
||||||
W=='tickets'then p.BodyFrame.AfterBalanceButton.Text='You need '..tostring(-Y)..
|
|
||||||
' '..currencyTypeToString(e)..' more to buy this item.'return true,true end end
|
|
||||||
if n then n:disconnect()n=nil end p.BodyFrame.AfterBalanceButton.Text=
|
|
||||||
'Your balance after this transaction will be '..currencyTypeToString(e)..' '..
|
|
||||||
tostring(Y)..'.'return true,false end function isFreeItem()return c and c[
|
|
||||||
'IsForSale']==true and c['IsPublicDomain']==true end function
|
|
||||||
membershipTypeToNumber(aa)if aa==Enum.MembershipType.None then return 0 elseif
|
|
||||||
aa==Enum.MembershipType.BuildersClub then return 1 elseif aa==Enum.
|
|
||||||
MembershipType.TurboBuildersClub then return 2 elseif aa==Enum.MembershipType.
|
|
||||||
OutrageousBuildersClub then return 3 end return-1 end function canPurchaseItem()
|
|
||||||
local aa,V,W,X=false,false,nil,false if l then local Y=nil X=ypcall(function()Y=
|
|
||||||
Game:HttpGetAsync(getSecureApiBaseUrl()..'marketplace/productDetails?productid='
|
|
||||||
..tostring(h))end)if X then c=getRbxUtility().DecodeJSON(Y)end else X=ypcall(
|
|
||||||
function()c=game:GetService'MarketplaceService':GetProductInfo(d)end)end if c==
|
|
||||||
nil or not X then W=
|
|
||||||
[[In-game sales are temporarily disabled. Please try again later.]]return true,
|
[[In-game sales are temporarily disabled. Please try again later.]]return true,
|
||||||
nil,nil,true,W end if not l then if not d then print
|
nil,nil,true,ar end if not m then if not e then print
|
||||||
'current asset id is nil, this should always have a value'return false end if d
|
'current asset id is nil, this should always have a value'return false end if e
|
||||||
<=0 then print[[current asset id is negative, this should always be positive]]
|
<=0 then print[[current asset id is negative, this should always be positive]]
|
||||||
return false end local Y,Z=ypcall(function()aa=game:HttpGetAsync(
|
return false end local at,au at,au=pcall(function()ap=game:HttpGetAsync(W()..
|
||||||
getSecureApiBaseUrl()..'ownership/hasAsset?userId='..tostring(game.Players.
|
'ownership/hasAsset?userId='..tostring(game.Players.LocalPlayer.userId)..
|
||||||
LocalPlayer.userId)..'&assetId='..tostring(d))end)if not Y then print(
|
'&assetId='..tostring(e))end)if not at then print(
|
||||||
'could not tell if player owns asset because',Z)return false end if aa==true or
|
'could not tell if player owns asset because',au)return false end if ap==true or
|
||||||
aa=='true'then W='You already own this item.'return true,nil,nil,true,W end end
|
ap=='true'then ar='You already own this item.'return true,nil,nil,true,ar end
|
||||||
p.BodyFrame.AfterBalanceButton.Visible=true if type(c)~='table'then c=
|
end q.BodyFrame.AfterBalanceButton.Visible=true if type(d)~='table'then d=X().
|
||||||
getRbxUtility().DecodeJSON(c)end if not c then W=
|
DecodeJSON(d)end if not d then ar=
|
||||||
'Could not get product info. Please try again later.'return true,nil,nil,true,W
|
'Could not get product info. Please try again later.'return true,nil,nil,true,ar
|
||||||
end if c['IsForSale']==false and c['IsPublicDomain']==false then W=
|
end if d['IsForSale']==false and d['IsPublicDomain']==false then ar=
|
||||||
'This item is no longer for sale.'return true,nil,nil,true,W end if not
|
'This item is no longer for sale.'return true,nil,nil,true,ar end if not aj(
|
||||||
setCurrencyAmountAndType(tonumber(c['PriceInRobux']),tonumber(c['PriceInTickets'
|
tonumber(d['PriceInRobux']),tonumber(d['PriceInTickets']))then ar=
|
||||||
]))then W=
|
|
||||||
[[We could retrieve the price of the item correctly. Please try again later.]]
|
[[We could retrieve the price of the item correctly. Please try again later.]]
|
||||||
return true,nil,nil,true,W end local Y=getPlayerBalance()if not Y then W=
|
return true,nil,nil,true,ar end local at=ak()if not at then ar=
|
||||||
'Could not retrieve your balance. Please try again later.'return true,nil,nil,
|
'Could not retrieve your balance. Please try again later.'return true,nil,nil,
|
||||||
true,W end if tonumber(c['MinimumMembershipLevel'])>membershipTypeToNumber(game.
|
true,ar end if tonumber(d['MinimumMembershipLevel'])>al(game.Players.LocalPlayer
|
||||||
Players.LocalPlayer.MembershipType)then V=true end local Z,_=
|
.MembershipType)then aq=true end local au,av au,av=an(at,aq)if aq then q.
|
||||||
updateAfterBalanceText(Y,V)if V then p.BodyFrame.AfterBalanceButton.Active=true
|
BodyFrame.AfterBalanceButton.Active=true return true,av,aq,false end if d[
|
||||||
return true,_,V,false end if c['ContentRatingTypeId']==1 then if game.Players.
|
'ContentRatingTypeId']==1 then if game.Players.LocalPlayer:GetUnder13()then ar=
|
||||||
LocalPlayer:GetUnder13()then W=
|
|
||||||
[[Your account is under 13 so purchase of this item is not allowed.]]return true
|
[[Your account is under 13 so purchase of this item is not allowed.]]return true
|
||||||
,nil,nil,true,W end end if(c['IsLimited']==true or c['IsLimitedUnique']==true)
|
,nil,nil,true,ar end end if(d['IsLimited']==true or d['IsLimitedUnique']==true)
|
||||||
and(c['Remaining']==''or c['Remaining']==0 or c['Remaining']==nil)then W=
|
and(d['Remaining']==''or d['Remaining']==0 or not(d['Remaining']~=nil))then ar=
|
||||||
[[All copies of this item have been sold out! Try buying from other users on the website.]]
|
[[All copies of this item have been sold out! Try buying from other users on the website.]]
|
||||||
return true,nil,nil,true,W end if not Z then W=
|
return true,nil,nil,true,ar end if not au then ar=
|
||||||
[[Could not update your balance. Please check back after some time.]]return true
|
[[Could not update your balance. Please check back after some time.]]return true
|
||||||
,nil,nil,true,W end p.BodyFrame.AfterBalanceButton.Active=true return true,_ end
|
,nil,nil,true,ar end q.BodyFrame.AfterBalanceButton.Active=true return true,av
|
||||||
function startSpinner()u=true Spawn(function()local aa=0 while u do local V=0
|
end local ap ap=function(aq)if k then local ar,as ar,as=ao()if ar and as then
|
||||||
while V<8 do if V==aa or V==((aa+1)%8)then v[V+1].Image=
|
local at=1000 while(at>0 or aq)and as and k and ar do wait(0.1)ar,as=ao()at=at-1
|
||||||
'http://www.roblox.com/Asset/?id=45880668'else v[V+1].Image=
|
end end if ar and not as then return ab(q.BodyFrame.BuyButton,q.BodyFrame.
|
||||||
'http://www.roblox.com/Asset/?id=45880710'end V=V+1 end aa=(aa+1)%8 wait(
|
CancelButton,q.BodyFrame.AfterBalanceButton)end end end local aq aq=function()
|
||||||
6.666666666666666E-2)end end)end function stopSpinner()u=false end function
|
return Game:GetService'GuiService':OpenBrowserWindow(tostring(c)..
|
||||||
setButtonsVisible(...)local aa,V,W={...},select('#',...),p.BodyFrame:
|
'Upgrades/BuildersClubMemberships.aspx')end local ar ar=function()return ad(
|
||||||
GetChildren()for X=1,#W do if W[X]:IsA'GuiButton'then W[X].Visible=false for Y=1
|
false)end local as as=function()local at,au,av,aw,ax at,au,av,aw,ax=ao()if at
|
||||||
,V do if W[X]==aa[Y]then W[X].Visible=true break end end end end end function
|
then ai()if aw and ax then q.BodyFrame.ItemPreview.ItemDescription.Text=ax q.
|
||||||
createSpinner(aa,V,W)local X=Instance.new'Frame'X.Name='Spinner'X.Size=aa X.
|
BodyFrame.AfterBalanceButton.Visible=false end game.GuiService:AddCenterDialog(q
|
||||||
Position=V X.BackgroundTransparency=1 X.ZIndex=10 X.Parent=W v={}local Y=1 while
|
,Enum.CenterDialogType.ModalDialog,function()q.Visible=true if ae()then ab(q.
|
||||||
Y<=8 do local Z=Instance.new'ImageLabel'Z.Name='Spinner'..Y Z.Size=UDim2.new(0,
|
BodyFrame.FreeButton,q.BodyFrame.CancelButton,q.BodyFrame.AfterBalanceButton)
|
||||||
16,0,16)Z.Position=UDim2.new(0.5+0.3*math.cos(math.rad(45*Y)),-8,0.5+0.3*math.
|
elseif av then q.BodyFrame.AfterBalanceButton.Text=
|
||||||
sin(math.rad(45*Y)),-8)Z.BackgroundTransparency=1 Z.ZIndex=10 Z.Image=
|
[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]]
|
||||||
'http://www.roblox.com/Asset/?id=45880710'Z.Parent=X v[Y]=Z Y=Y+1 end end
|
if not l then l=q.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(
|
||||||
function createPurchasePromptGui()p=Instance.new'Frame'p.Name='PurchaseFrame'p.
|
function()if q.BodyFrame.AfterBalanceButton.Text==
|
||||||
Size=UDim2.new(0,660,0,400)p.Position=s p.Visible=false p.BackgroundColor3=
|
[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]]
|
||||||
Color3.new(0.5529411764705883,0.5529411764705883,0.5529411764705883)p.
|
then return aq()end end)end ab(q.BodyFrame.BuyDisabledButton,q.BodyFrame.
|
||||||
BorderColor3=Color3.new(0.8,0.8,0.8)p.Parent=game.CoreGui.RobloxGui local aa=
|
CancelButton,q.BodyFrame.AfterBalanceButton)elseif au then ab(q.BodyFrame.
|
||||||
Instance.new'Frame'aa.Name='BodyFrame'aa.Size=UDim2.new(1,0,1,-60)aa.Position=
|
BuyDisabledButton,q.BodyFrame.CancelButton,q.BodyFrame.AfterBalanceButton)elseif
|
||||||
UDim2.new(0,0,0,60)aa.BackgroundColor3=Color3.new(0.2627450980392157,
|
aw then ab(q.BodyFrame.BuyDisabledButton,q.BodyFrame.CancelButton)else ab(q.
|
||||||
0.2627450980392157,0.2627450980392157)aa.BorderSizePixel=0 aa.ZIndex=8 aa.Parent
|
BodyFrame.BuyButton,q.BodyFrame.CancelButton)end q:TweenPosition(s,Enum.
|
||||||
=p local V=createTextObject('TitleLabel','Buy Item','TextLabel',Enum.FontSize.
|
EasingDirection.Out,Enum.EasingStyle.Quad,r,true)if at and au and not n then k=
|
||||||
Size48)V.ZIndex=8 V.Size=UDim2.new(1,0,0,60)local W=V:Clone()W.Name=
|
true return ap(true)end end,function()q.Visible=false end)return q else return
|
||||||
'TitleBackdrop'W.TextColor3=Color3.new(0.12549019607843137,0.12549019607843137,
|
ar()end end local at at=function(au)local av=game:GetService'InsertService':
|
||||||
0.12549019607843137)W.BackgroundTransparency=0 W.BackgroundColor3=Color3.new(
|
LoadAsset(au)if not av then return nil end if av:IsA'Tool'then return av end
|
||||||
0.21176470588235294,0.3764705882352941,0.6705882352941176)W.Position=UDim2.new(0
|
local aw=av:GetChildren()for ax=1,#aw do if aw[ax]:IsA'Tool'then return aw[ax]
|
||||||
,0,0,-2)W.ZIndex=8 W.Parent=p V.Parent=p local X,Y=90,createImageButton
|
end end return nil end local au au=function(av)local aw='Item'if d then aw=d[
|
||||||
'CancelButton'Y.Position=UDim2.new(0.5,(X/2),1,-120)Y.BackgroundTransparency=1 Y
|
'Name']end local ax=string.gsub(S,'itemName',tostring(aw))if av then ax=string.
|
||||||
.BorderSizePixel=0 Y.Parent=aa Y.Modal=true Y.ZIndex=8 Y.Image=D Y.
|
gsub(ax,'errorReason',tostring(P))else ax=string.gsub(ax,'errorReason',tostring(
|
||||||
MouseButton1Down:connect(function()Y.Image=E end)Y.MouseButton1Up:connect(
|
Q))end q.BodyFrame.ItemPreview.ItemDescription.Text=ax q.BodyFrame.ItemPreview.
|
||||||
function()Y.Image=D end)Y.MouseLeave:connect(function()Y.Image=D end)Y.
|
Image=A ab(q.BodyFrame.OkButton)af(O)return _()end local av av=function()v=true
|
||||||
MouseButton1Click:connect(doDeclinePurchase)local Z=createImageButton'BuyButton'
|
return Spawn(function()local aw=0 while v do local ax=0 while ax<8 do w[ax+1].
|
||||||
Z.Position=UDim2.new(0.5,-153-(X/2),1,-120)Z.BackgroundTransparency=1 Z.
|
Image='http://www.roblox.com/Asset/?id='..(function()if ax==aw or ax==(aw+1)%8
|
||||||
BorderSizePixel=0 Z.Image=A Z.ZIndex=8 Z.MouseButton1Down:connect(function()Z.
|
then return'45880668'else return'45880710'end end)()ax=ax+1 end aw=(aw+1)%8
|
||||||
Image=B end)Z.MouseButton1Up:connect(function()Z.Image=A end)Z.MouseLeave:
|
wait(6.666666666666666E-2)end end)end local aw aw=function()av()q.
|
||||||
connect(function()Z.Image=A end)Z.Parent=aa local _=Z:Clone()_.Name=
|
PurchasingFrame.Visible=true end local ax ax=function(ay)if ay==Enum.
|
||||||
'BuyDisabledButton'_.AutoButtonColor=false _.Visible=false _.Active=false _.
|
CurrencyType.Robux or ay==Enum.CurrencyType.Default then return 1 elseif ay==
|
||||||
Image=C _.ZIndex=8 _.Parent=aa local ab=Z:Clone()ab.BackgroundTransparency=1 ab.
|
Enum.CurrencyType.Tix then return 2 end end local ay ay=function(az)aw()local aA
|
||||||
Name='FreeButton'ab.Visible=false ab.ZIndex=8 ab.Image=H ab.MouseButton1Down:
|
,aB,aC=tick(),'none',nil if m then aC=W()..
|
||||||
connect(function()ab.Image=I end)ab.MouseButton1Up:connect(function()ab.Image=H
|
'marketplace/submitpurchase?productId='..tostring(i)..'¤cyTypeId='..
|
||||||
end)ab.MouseLeave:connect(function()ab.Image=H end)ab.Parent=aa local ac=Z:
|
tostring(ax(f))..'&expectedUnitPrice='..tostring(g)..'&placeId='..tostring(Game.
|
||||||
Clone()ac.Name='OkButton'ac.BackgroundTransparency=1 ac.Visible=false ac.
|
PlaceId)else aC=W()..'marketplace/purchase?productId='..tostring(i)..
|
||||||
Position=UDim2.new(0.5,-ac.Size.X.Offset/2,1,-120)ac.Modal=true ac.Image=F ac.
|
'¤cyTypeId='..tostring(ax(f))..'&purchasePrice='..tostring(g)..
|
||||||
ZIndex=8 ac.MouseButton1Down:connect(function()ac.Image=G end)ac.MouseButton1Up:
|
'&locationType=Game'..'&locationId='..tostring(Game.PlaceId)end local aD,aE aD,
|
||||||
connect(function()ac.Image=F end)ac.MouseLeave:connect(function()ac.Image=F end)
|
aE=pcall(function()aB=game:HttpPostAsync(aC,'RobloxPurchaseRequest')end)print(
|
||||||
ac.Parent=aa local ad=ac:Clone()ad.ZIndex=8 ad.Name='OkPurchasedButton'ad.
|
'doAcceptPurchase success from ypcall is ',aD,'reason is',aE)if(tick()-aA)<1
|
||||||
MouseButton1Down:connect(function()ad.Image=G end)ad.MouseButton1Up:connect(
|
then wait(1)end if aB=='none'or not(aB~=nil)or aB==''then print(
|
||||||
function()ad.Image=F end)ad.MouseLeave:connect(function()ad.Image=F end)ad.
|
'did not get a proper response from web on purchase of',e,i)au()return end aB=X(
|
||||||
Parent=aa ac.MouseButton1Click:connect(function()userPurchaseActionsEnded(false)
|
).DecodeJSON(aB)if aB then if aB['success']==false then if aB['status']~=
|
||||||
end)ad.MouseButton1Click:connect(function()if l then
|
'AlreadyOwned'then print('web return response of fail on purchase of',e,i)au(aB[
|
||||||
userPurchaseProductActionsEnded(true)else signalPromptEnded(true)end end)Z.
|
'status']=='EconomyDisabled')return end end else print(
|
||||||
MouseButton1Click:connect(function()doAcceptPurchase(Enum.CurrencyType.Robux)end
|
'web return response of non parsable JSON on purchase of',e)au()return end if h
|
||||||
)ab.MouseButton1Click:connect(function()doAcceptPurchase(false)end)local ae=
|
and aD and e and tonumber(d['AssetTypeId'])==19 then local aF=at(tonumber(e))if
|
||||||
Instance.new'ImageLabel'ae.Name='ItemPreview'ae.BackgroundColor3=Color3.new(
|
aF then aF.Parent=game.Players.LocalPlayer.Backpack end end if m then if not aB[
|
||||||
0.12549019607843137,0.12549019607843137,0.12549019607843137)ae.BorderColor3=
|
'receipt']then print(
|
||||||
Color3.new(0.5529411764705883,0.5529411764705883,0.5529411764705883)ae.Position=
|
[[tried to buy productId, but no receipt returned. productId was]],i)au()return
|
||||||
UDim2.new(0,30,0,20)ae.Size=UDim2.new(0,180,0,180)ae.ZIndex=9 ae.Parent=aa local
|
end return Game:GetService'MarketplaceService':SignalClientPurchaseSuccess(
|
||||||
af=createTextObject('ItemDescription',
|
tostring(aB['receipt']),game.Players.LocalPlayer.userId,i)else return ad(aD)end
|
||||||
|
end local az az=function(aA,aB,aC)local aD=a('Frame','Spinner',{Size=aA,Position
|
||||||
|
=aB,BackgroundTransparency=1,ZIndex=10,Parent=aC})w={}local aE=1 while aE<=8 do
|
||||||
|
local aF=a('ImageLabel','Spinner'..tostring(aE),{Size=UDim2.new(0,16,0,16),
|
||||||
|
Position=UDim2.new(0.5+0.3*math.cos(math.rad(45*aE)),-8,0.5+0.3*math.sin(math.
|
||||||
|
rad(45*aE)),-8),BackgroundTransparency=1,ZIndex=10,Image=
|
||||||
|
'http://www.roblox.com/Asset/?id=45880710',Parent=aD})w[aE]=aF aE=aE+1 end end
|
||||||
|
local aA aA=function(aB,aC,aD,aE)return a(aD,aB,{Font=Enum.Font.ArialBold,
|
||||||
|
TextColor3=Color3.new(0.8509803921568627,0.8509803921568627,0.8509803921568627),
|
||||||
|
TextWrapped=true,Text=aC,BackgroundTransparency=1,BorderSizePixel=0,FontSize=aE}
|
||||||
|
)end local aB aB=function(aC)return a('ImageButton',aC,{Size=UDim2.new(0,153,0,
|
||||||
|
46),Name=aC})end local aC aC=function(aD)k=false if aD then aa()if j then local
|
||||||
|
aE=false if(tostring(j['isValid'])):lower()=='true'then aE=true end Game:
|
||||||
|
GetService'MarketplaceService':SignalPromptProductPurchaseFinished(tonumber(j[
|
||||||
|
'playerId']),tonumber(j['productId']),aE)else print
|
||||||
|
'Something went wrong, no currentServerResponseTable'end return Z()else local aE
|
||||||
|
=string.gsub(R,'itemName',tostring(d['Name']))q.BodyFrame.ItemPreview.
|
||||||
|
ItemDescription.Text=aE ab(q.BodyFrame.OkPurchasedButton)return _()end end local
|
||||||
|
aD aD=function()q=a('Frame','PurchaseFrame',{Size=UDim2.new(0,660,0,400),
|
||||||
|
Position=t,Visible=false,BackgroundColor3=Color3.new(0.5529411764705883,
|
||||||
|
0.5529411764705883,0.5529411764705883),BorderColor3=Color3.new(0.8,0.8,0.8),
|
||||||
|
Parent=game.CoreGui.RobloxGui,a('Frame','BodyFrame',{Size=UDim2.new(1,0,1,-60),
|
||||||
|
Position=UDim2.new(0,0,0,60),BackgroundColor3=Color3.new(0.2627450980392157,
|
||||||
|
0.2627450980392157,0.2627450980392157),BorderSizePixel=0,ZIndex=8})})local aE=q.
|
||||||
|
BodyFrame do local aF=aA('TitleLabel','Buy Item','TextLabel',Enum.FontSize.
|
||||||
|
Size48)aF.ZIndex=8 aF.Size=UDim2.new(1,0,0,60)do local aG=aF:Clone()aG.Name=
|
||||||
|
'TitleBackdrop'aG.TextColor3=Color3.new(0.12549019607843137,0.12549019607843137,
|
||||||
|
0.12549019607843137)aG.BackgroundTransparency=0 aG.BackgroundColor3=Color3.new(
|
||||||
|
0.21176470588235294,0.3764705882352941,0.6705882352941176)aG.Position=UDim2.new(
|
||||||
|
0,0,0,-2)aG.ZIndex=8 aG.Parent=q end aF.Parent=q end local aF=90 do local aG=aB
|
||||||
|
'CancelButton'aG.Position=UDim2.new(0.5,aF/2,1,-120)aG.BackgroundTransparency=1
|
||||||
|
aG.BorderSizePixel=0 aG.Parent=aE aG.Modal=true aG.ZIndex=8 aG.Image=E aG.
|
||||||
|
MouseButton1Down:connect(function()aG.Image=F end)aG.MouseButton1Up:connect(
|
||||||
|
function()aG.Image=E end)aG.MouseLeave:connect(function()aG.Image=E end)aG.
|
||||||
|
MouseButton1Click:connect(ar)end local aG=aB'BuyButton'aG.Position=UDim2.new(0.5
|
||||||
|
,-153-(aF/2),1,-120)aG.BackgroundTransparency=1 aG.BorderSizePixel=0 aG.Image=B
|
||||||
|
aG.ZIndex=8 aG.MouseButton1Down:connect(function()aG.Image=C end)aG.
|
||||||
|
MouseButton1Up:connect(function()aG.Image=B end)aG.MouseLeave:connect(function()
|
||||||
|
aG.Image=B end)aG.Parent=aE do local aH=aG:Clone()aH.Name='BuyDisabledButton'aH.
|
||||||
|
AutoButtonColor=false aH.Visible=false aH.Active=false aH.Image=D aH.ZIndex=8 aH
|
||||||
|
.Parent=aE end local aH=aG:Clone()aH.BackgroundTransparency=1 aH.Name=
|
||||||
|
'FreeButton'aH.Visible=false aH.ZIndex=8 aH.Image=I aH.MouseButton1Down:connect(
|
||||||
|
function()aH.Image=J end)aH.MouseButton1Up:connect(function()aH.Image=I end)aH.
|
||||||
|
MouseLeave:connect(function()aH.Image=I end)aH.Parent=aE local aI=aG:Clone()aI.
|
||||||
|
Name='OkButton'aI.BackgroundTransparency=1 aI.Visible=false aI.Position=UDim2.
|
||||||
|
new(0.5,-aI.Size.X.Offset/2,1,-120)aI.Modal=true aI.Image=G aI.ZIndex=8 aI.
|
||||||
|
MouseButton1Down:connect(function()aI.Image=H end)aI.MouseButton1Up:connect(
|
||||||
|
function()aI.Image=G end)aI.MouseLeave:connect(function()aI.Image=G end)aI.
|
||||||
|
Parent=aE do local aJ=aI:Clone()aJ.ZIndex=8 aJ.Name='OkPurchasedButton'aJ.
|
||||||
|
MouseButton1Down:connect(function()aJ.Image=H end)aJ.MouseButton1Up:connect(
|
||||||
|
function()aJ.Image=G end)aJ.MouseLeave:connect(function()aJ.Image=G end)aJ.
|
||||||
|
Parent=aE aJ.MouseButton1Click:connect(function()if m then return aC(true)else
|
||||||
|
return ac(true)end end)end aI.MouseButton1Click:connect(function()return ad(
|
||||||
|
false)end)aG.MouseButton1Click:connect(function()return ay(Enum.CurrencyType.
|
||||||
|
Robux)end)aH.MouseButton1Click:connect(function()return ay(false)end)local aJ=a(
|
||||||
|
'ImageLabel','ItemPreview',{BackgroundColor3=Color3.new(0.12549019607843137,
|
||||||
|
0.12549019607843137,0.12549019607843137),BorderColor3=Color3.new(
|
||||||
|
0.5529411764705883,0.5529411764705883,0.5529411764705883),Position=UDim2.new(0,
|
||||||
|
30,0,20),Size=UDim2.new(0,180,0,180),ZIndex=9,Parent=aE})do local aK=aA(
|
||||||
|
'ItemDescription',
|
||||||
[[Would you like to buy the 'itemName' for currencyType currencyAmount?]],
|
[[Would you like to buy the 'itemName' for currencyType currencyAmount?]],
|
||||||
'TextLabel',Enum.FontSize.Size24)af.Position=UDim2.new(1,20,0,0)af.Size=UDim2.
|
'TextLabel',Enum.FontSize.Size24)aK.Position=UDim2.new(1,20,0,0)aK.Size=UDim2.
|
||||||
new(0,410,1,0)af.ZIndex=8 af.Parent=ae local ag=createTextObject(
|
new(0,410,1,0)aK.ZIndex=8 aK.Parent=aJ end do local aK=aA('AfterBalanceButton',
|
||||||
'AfterBalanceButton','Place holder text ip sum lorem dodo ashs','TextButton',
|
'Place holder text ip sum lorem dodo ashs','TextButton',Enum.FontSize.Size24)aK.
|
||||||
Enum.FontSize.Size24)ag.AutoButtonColor=false ag.TextColor3=Color3.new(
|
AutoButtonColor=false aK.TextColor3=Color3.new(0.8705882352941177,
|
||||||
0.8705882352941177,0.23137254901960785,0.11764705882352941)ag.Position=UDim2.
|
0.23137254901960785,0.11764705882352941)aK.Position=UDim2.new(0,5,1,-55)aK.Size=
|
||||||
new(0,5,1,-55)ag.Size=UDim2.new(1,-10,0,50)ag.ZIndex=8 ag.Parent=aa local ah=
|
UDim2.new(1,-10,0,50)aK.ZIndex=8 aK.Parent=aE end local aK,aL=a('Frame',
|
||||||
Instance.new'Frame'ah.Name='PurchasingFrame'ah.Size=UDim2.new(1,0,1,0)ah.
|
'PurchasingFrame',{Size=UDim2.new(1,0,1,0),BackgroundColor3=Color3.new(0,0,0),
|
||||||
BackgroundColor3=Color3.new(0,0,0)ah.BackgroundTransparency=0.2 ah.
|
BackgroundTransparency=0.2,BorderSizePixel=0,ZIndex=9,Visible=false,Active=true,
|
||||||
BorderSizePixel=0 ah.ZIndex=9 ah.Visible=false ah.Active=true ah.Parent=p local
|
Parent=q}),aA('PurchasingLabel','Purchasing...','TextLabel',Enum.FontSize.Size48
|
||||||
ai=createTextObject('PurchasingLabel','Purchasing...','TextLabel',Enum.FontSize.
|
)aL.Size=UDim2.new(1,0,1,0)aL.ZIndex=10 aL.Parent=aK return az(UDim2.new(0,50,0,
|
||||||
Size48)ai.Size=UDim2.new(1,0,1,0)ai.ZIndex=10 ai.Parent=ah createSpinner(UDim2.
|
50),UDim2.new(0.5,-25,0.5,30),aL)end local aE aE=function(aF)end local aF aF=
|
||||||
new(0,50,0,50),UDim2.new(0.5,-25,0.5,30),ai)end function showPurchasing()
|
function(aG)end local aG aG=function(aH)if aH then return aE(q)else return aF(q)
|
||||||
startSpinner()p.PurchasingFrame.Visible=true end function hidePurchasing()p.
|
end end local aH aH=function(aI,aJ,aK,aL,aM)if not q then aD()end if aI==game.
|
||||||
PurchasingFrame.Visible=false stopSpinner()end function createTextObject(aa,ab,
|
Players.LocalPlayer then if p then return end p=true e=aJ i=aM f=aL h=aK m=(i~=
|
||||||
ac,ad)local ae=Instance.new(ac)ae.Font=Enum.Font.ArialBold ae.TextColor3=Color3.
|
nil)return as()end end local aI aI=function(aJ)if not aJ then print
|
||||||
new(0.8509803921568627,0.8509803921568627,0.8509803921568627)ae.TextWrapped=true
|
'Server response table was nil, cancelling purchase'au()return end if aJ[
|
||||||
ae.Name=aa ae.Text=ab ae.BackgroundTransparency=1 ae.BorderSizePixel=0 ae.
|
'playerId']and tonumber(aJ['playerId'])==game.Players.LocalPlayer.userId then j=
|
||||||
FontSize=ad return ae end function createImageButton(aa)local ab=Instance.new
|
aJ return aC(false)end end Y()game:GetService'MarketplaceService'.
|
||||||
'ImageButton'ab.Size=UDim2.new(0,153,0,46)ab.Name=aa return ab end function
|
PromptProductPurchaseRequested:connect(function(aJ,aK,aL,aM)return aH(aJ,nil,aL,
|
||||||
setHeaderText(aa)p.TitleLabel.Text=aa p.TitleBackdrop.Text=aa end function
|
aM,aK)end)Game:GetService'MarketplaceService'.PromptPurchaseRequested:connect(
|
||||||
cutSizeInHalfRecursive(aa)end function doubleSizeRecursive(aa)end function
|
function(aJ,aK,aL,aM)return aH(aJ,aK,aL,aM,nil)end)Game:GetService
|
||||||
modifyForSmallScreen()cutSizeInHalfRecursive(p)end function modifyForLargeScreen
|
'MarketplaceService'.ServerPurchaseVerification:connect(function(aJ)return aI(aJ
|
||||||
()doubleSizeRecursive(p)end function changeGuiToScreenSize(aa)if aa then
|
)end)if n then Game:GetService'GuiService'.BrowserWindowClosed:connect(function(
|
||||||
modifyForSmallScreen()else modifyForLargeScreen()end end function
|
)return ap(false)end)end Game.CoreGui.RobloxGui.Changed:connect(function()local
|
||||||
doPurchasePrompt(aa,ab,ac,ad,ae)if not p then createPurchasePromptGui()end if aa
|
aJ=game.CoreGui.RobloxGui.AbsoluteSize.Y<=x if aJ and not u then aG(true)elseif
|
||||||
==game.Players.LocalPlayer then if o then return end o=true d=ab h=ae e=ad g=ac
|
not aJ and u then aG(false)end u=aJ end)u=game.CoreGui.RobloxGui.AbsoluteSize.Y
|
||||||
l=(h~=nil)showPurchasePrompt()end end function userPurchaseProductActionsEnded(
|
<=x if u then return aG(true)end
|
||||||
aa)j=false if aa then closePurchasePrompt()if i then local ab=false if tostring(
|
|
||||||
i['isValid']):lower()=='true'then ab=true end Game:GetService
|
|
||||||
'MarketplaceService':SignalPromptProductPurchaseFinished(tonumber(i['playerId'])
|
|
||||||
,tonumber(i['productId']),ab)else print
|
|
||||||
'Something went wrong, no currentServerResponseTable'end
|
|
||||||
removeCurrentPurchaseInfo()else local ab=string.gsub(Q,'itemName',tostring(c[
|
|
||||||
'Name']))p.BodyFrame.ItemPreview.ItemDescription.Text=ab setButtonsVisible(p.
|
|
||||||
BodyFrame.OkPurchasedButton)hidePurchasing()end end function
|
|
||||||
doProcessServerPurchaseResponse(aa)if not aa then print
|
|
||||||
'Server response table was nil, cancelling purchase'purchaseFailed()return end
|
|
||||||
if aa['playerId']and tonumber(aa['playerId'])==game.Players.LocalPlayer.userId
|
|
||||||
then i=aa userPurchaseProductActionsEnded(false)end end preloadAssets()game:
|
|
||||||
GetService'MarketplaceService'.PromptProductPurchaseRequested:connect(function(
|
|
||||||
aa,ab,ac,ad)doPurchasePrompt(aa,nil,ac,ad,ab)end)Game:GetService
|
|
||||||
'MarketplaceService'.PromptPurchaseRequested:connect(function(aa,ab,ac,ad)
|
|
||||||
doPurchasePrompt(aa,ab,ac,ad,nil)end)Game:GetService'MarketplaceService'.
|
|
||||||
ServerPurchaseVerification:connect(function(aa)doProcessServerPurchaseResponse(
|
|
||||||
aa)end)if m then Game:GetService'GuiService'.BrowserWindowClosed:connect(
|
|
||||||
function()doPlayerFundsCheck(false)end)end Game.CoreGui.RobloxGui.Changed:
|
|
||||||
connect(function()local aa=(game.CoreGui.RobloxGui.AbsoluteSize.Y<=w)if aa and
|
|
||||||
not t then changeGuiToScreenSize(true)elseif not aa and t then
|
|
||||||
changeGuiToScreenSize(false)end t=aa end)t=(game.CoreGui.RobloxGui.AbsoluteSize.
|
|
||||||
Y<=w)if t then changeGuiToScreenSize(true)end
|
|
||||||
|
|
@ -1,52 +1,51 @@
|
||||||
local a,b,c,d,e,f,g,h,i,j=Game:GetService'ContextActionService',Game:GetService
|
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||||
'UserInputService'.TouchEnabled,{},{},nil,nil,
|
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||||
'http://www.banland.xyz/asset/?id=97166756',
|
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||||
'http://www.banland.xyz/asset/?id=97166444',{},{[1]=UDim2.new(0,123,0,70),[2]=
|
'userdata'then h.Parent=e end end e.Parent=f return e end local b,c,d,e,f,g,h,i,
|
||||||
UDim2.new(0,30,0,60),[3]=UDim2.new(0,180,0,160),[4]=UDim2.new(0,85,0,-25),[5]=
|
j,k=Game:GetService'ContextActionService',Game:GetService'UserInputService'.
|
||||||
UDim2.new(0,185,0,-25),[6]=UDim2.new(0,185,0,260),[7]=UDim2.new(0,216,0,65)}
|
TouchEnabled,{},{},nil,nil,'http://www.banland.xyz/asset/?id=97166756',
|
||||||
local k=#j Game:GetService'ContentProvider':Preload(g)Game:GetService
|
'http://www.banland.xyz/asset/?id=97166444',{},{UDim2.new(0,123,0,70),UDim2.new(
|
||||||
'ContentProvider':Preload(h)while not Game.Players do wait()end while not Game.
|
0,30,0,60),UDim2.new(0,180,0,160),UDim2.new(0,85,0,-25),UDim2.new(0,185,0,-25),
|
||||||
Players.LocalPlayer do wait()end function createContextActionGui()if not e and b
|
UDim2.new(0,185,0,260),UDim2.new(0,216,0,65)}local l=#k do local m=Game:
|
||||||
then e=Instance.new'ScreenGui'e.Name='ContextActionGui'f=Instance.new'Frame'f.
|
GetService'ContentProvider'm:Preload(h)m:Preload(i)end while not Game.Players do
|
||||||
BackgroundTransparency=1 f.Size=UDim2.new(0.3,0,0.5,0)f.Position=UDim2.new(0.7,0
|
wait()end while not Game.Players.LocalPlayer do wait()end local m m=function()if
|
||||||
,0.5,0)f.Name='ContextButtonFrame'f.Parent=e end end function contextButtonDown(
|
not f and c then f=a('ScreenGui','ContextActionGui',{a('Frame',
|
||||||
l,m,n)if m.UserInputType==Enum.UserInputType.Touch then l.Image=g a:
|
'ContextButtonFrame',{BackgroundTransparency=1,Size=UDim2.new(0.3,0,0.5,0),
|
||||||
CallFunction(n,Enum.UserInputState.Begin,m)end end function contextButtonMoved(l
|
Position=UDim2.new(0.7,0,0.5,0)})})end end local n n=function(o,p,q)if p.
|
||||||
,m,n)if m.UserInputType==Enum.UserInputType.Touch then l.Image=g a:CallFunction(
|
UserInputType==Enum.UserInputType.Touch then o.Image=h return b:CallFunction(q,
|
||||||
n,Enum.UserInputState.Change,m)end end function contextButtonUp(l,m,n)l.Image=h
|
Enum.UserInputState.Begin)end end local o o=function(p,q,r)if q.UserInputType==
|
||||||
if m.UserInputType==Enum.UserInputType.Touch and m.UserInputState==Enum.
|
Enum.UserInputType.Touch then p.Image=h return b:CallFunction(r,Enum.
|
||||||
UserInputState.End then a:CallFunction(n,Enum.UserInputState.End,m)end end
|
UserInputState.Change)end end local p p=function(q,r,s)q.Image=i if r.
|
||||||
function isSmallScreenDevice()return Game:GetService'GuiService':
|
UserInputType==Enum.UserInputType.Touch and r.UserInputState==Enum.
|
||||||
GetScreenResolution().y<=320 end function createNewButton(l,m)local n=Instance.
|
UserInputState.End then return b:CallFunction(s,Enum.UserInputState.End,r)end
|
||||||
new'ImageButton'n.Name='ContextActionButton'n.BackgroundTransparency=1 n.Size=
|
end local q q=function()return Game:GetService'GuiService':GetScreenResolution()
|
||||||
UDim2.new(0,90,0,90)n.Active=true if isSmallScreenDevice()then n.Size=UDim2.new(
|
.y<=320 end local r r=function(s,t)local u,v=a('ImageButton',
|
||||||
0,70,0,70)end n.Image=h n.Parent=f local o=nil Game:GetService'UserInputService'
|
'ContextActionButton',{BackgroundTransparency=1,Size=UDim2.new((function()if q()
|
||||||
.InputEnded:connect(function(p)i[p]=nil end)n.InputBegan:connect(function(p)if i
|
then return 0,90,0,90 else return 0,70,0,70 end end)()),Active=true,Image=i,
|
||||||
[p]then return end if p.UserInputState==Enum.UserInputState.Begin and o==nil
|
Parent=g}),nil Game:GetService'UserInputService'.InputEnded:connect(function(w)j
|
||||||
then o=p contextButtonDown(n,p,l)end end)n.InputChanged:connect(function(p)if i[
|
[w]=nil end)u.InputBegan:connect(function(w)if j[w]then return end if w.
|
||||||
p]then return end if o~=p then return end contextButtonMoved(n,p,l)end)n.
|
UserInputState==Enum.UserInputState.Begin and not(v~=nil)then v=w return n(u,w,s
|
||||||
InputEnded:connect(function(p)if i[p]then return end if o~=p then return end o=
|
)end end)u.InputChanged:connect(function(w)if j[w]or v~=w then return end return
|
||||||
nil i[p]=true contextButtonUp(n,p,l)end)local p=Instance.new'ImageLabel'p.Name=
|
o(u,w,s)end)u.InputEnded:connect(function(w)if j[w]or v~=w then return end v=nil
|
||||||
'ActionIcon'p.Position=UDim2.new(0.175,0,0.175,0)p.Size=UDim2.new(0.65,0,0.65,0)
|
j[w]=true return p(u,w,s)end)local w=a('ImageLabel','ActionIcon',{Position=UDim2
|
||||||
p.BackgroundTransparency=1 if m['image']and type(m['image'])=='string'then p.
|
.new(0.175,0,0.175,0),Size=UDim2.new(0.65,0,0.65,0),BackgroundTransparency=1})if
|
||||||
Image=m['image']end p.Parent=n local q=Instance.new'TextLabel'q.Name=
|
t['image']and type(t['image'])=='string'then w.Image=t['image']end w.Parent=u
|
||||||
'ActionTitle'q.Size=UDim2.new(1,0,1,0)q.BackgroundTransparency=1 q.Font=Enum.
|
local x=a('TextLabel','ActionTitle',{Size=UDim2.new(1,0,1,0),
|
||||||
Font.SourceSansBold q.TextColor3=Color3.new(1,1,1)q.TextStrokeTransparency=0 q.
|
BackgroundTransparency=1,Font=Enum.Font.SourceSansBold,TextColor3=Color3.new(1,1
|
||||||
FontSize=Enum.FontSize.Size18 q.TextWrapped=true q.Text=''if m['title']and type(
|
,1),TextStrokeTransparency=0,FontSize=Enum.FontSize.Size18,TextWrapped=true,Text
|
||||||
m['title'])=='string'then q.Text=m['title']end q.Parent=n return n end function
|
=''})if t['title']and type(t['title'])=='string'then x.Text=t['title']end x.
|
||||||
createButton(l,m)local n,o=createNewButton(l,m),nil for p=1,#d do if d[p]==
|
Parent=u return u end local s s=function(t,u)local v,w=r(t,u),nil for x=1,#e do
|
||||||
'empty'then o=p break end end if not o then o=#d+1 end if o>k then return end d[
|
if e[x]=='empty'then w=x break end end if not w then w=#e+1 end if w>l then
|
||||||
o]=n c[l]['button']=n n.Position=j[o]n.Parent=f if e and e.Parent==nil then e.
|
return end e[w]=v d[t]['button']=v v.Position=k[w]v.Parent=g if f and not(f.
|
||||||
Parent=Game.Players.LocalPlayer.PlayerGui end end function removeAction(l)if not
|
Parent~=nil)then f.Parent=Game.Players.LocalPlayer.PlayerGui end end local t t=
|
||||||
c[l]then return end local m=c[l]['button']if m then m.Parent=nil for n=1,#d do
|
function(u)if not d[u]then return end local v=d[u]['button']if v then v.Parent=
|
||||||
if d[n]==m then d[n]='empty'break end end m:Destroy()end c[l]=nil end function
|
nil for w=1,#e do if e[w]==v then e[w]='empty'break end end v:Destroy()end d[u]=
|
||||||
addAction(l,m,n)if c[l]then removeAction(l)end c[l]={n}if m and b then
|
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()
|
||||||
createContextActionGui()createButton(l,n)end end a.BoundActionChanged:connect(
|
return s(v,x)end end b.BoundActionChanged:connect(function(v,w,x)if d[v]and x
|
||||||
function(l,m,n)if c[l]and n then local o=c[l]['button']if o then if m=='image'
|
then do local y=d[v]['button']if y then if w=='image'then y.ActionIcon.Image=x[w
|
||||||
then o.ActionIcon.Image=n[m]elseif m=='title'then o.ActionTitle.Text=n[m]elseif
|
]elseif w=='title'then y.ActionTitle.Text=x[w]elseif w=='position'then y.
|
||||||
m=='position'then o.Position=n[m]end end end end)a.BoundActionAdded:connect(
|
Position=x[w]end end end end end)b.BoundActionAdded:connect(function(v,w,x)
|
||||||
function(l,m,n)addAction(l,m,n)end)a.BoundActionRemoved:connect(function(l,m)
|
return u(v,w,x)end)b.BoundActionRemoved:connect(function(v,w)return t(v)end)b.
|
||||||
removeAction(l)end)a.GetActionButtonEvent:connect(function(l)if c[l]then a:
|
GetActionButtonEvent:connect(function(v)if d[v]then return b:
|
||||||
FireActionButtonFoundSignal(l,c[l]['button'])end end)local l=a:
|
FireActionButtonFoundSignal(v,d[v]['button'])end end)local v=b:
|
||||||
GetAllBoundActionInfo()for m,n in pairs(l)do addAction(m,n['createTouchButton'],
|
GetAllBoundActionInfo()for w,x in pairs(v)do u(w,x['createTouchButton'],x)end
|
||||||
n)end
|
|
||||||
|
|
@ -1,112 +1,104 @@
|
||||||
while not Game do wait()end while not Game:FindFirstChild'Players'do wait()end
|
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||||
while not Game.Players.LocalPlayer do wait()end while not Game:FindFirstChild
|
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||||
'CoreGui'do wait()end while not Game.CoreGui:FindFirstChild'RobloxGui'do wait()
|
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||||
end local a=Game:GetService'UserInputService'local b=pcall(function()a:
|
'userdata'then h.Parent=e end end e.Parent=f return e end while not Game do
|
||||||
IsLuaTouchControls()end)if not b then script:Destroy()end local c=Game:
|
wait()end while not Game:FindFirstChild'Players'do wait()end while not Game.
|
||||||
GetService'GuiService':GetScreenResolution()function isSmallScreenDevice()return
|
Players.LocalPlayer do wait()end while not Game:FindFirstChild'CoreGui'do wait()
|
||||||
c.y<=320 end local d,e=Game.Players.LocalPlayer,120 if isSmallScreenDevice()then
|
end while not Game.CoreGui:FindFirstChild'RobloxGui'do wait()end local b=Game:
|
||||||
e=70 end local f,g,h,i,j='rbxasset://textures/ui/TouchControlsSheet.png',5,0.92,
|
GetService'UserInputService'local c=pcall(function()return b:IsLuaTouchControls(
|
||||||
{},90 if isSmallScreenDevice()then j=70 end local k,l,m={},nil,0.007 local n,o,p
|
)end)if not c then script:Destroy()end local d,e=Game:GetService'GuiService':
|
||||||
,q=m*16,0.03,0.2,nil Game:GetService'ContentProvider':Preload(f)function
|
GetScreenResolution(),nil e=function()return d.y<=320 end local f,g=Game.Players
|
||||||
DistanceBetweenTwoPoints(r,s)local t,u=s.x-r.x,s.y-r.y return math.sqrt((t*t)+(u
|
.LocalPlayer,120 if e()then g=70 end local h,i,j,k,l=
|
||||||
*u))end function transformFromCenterToTopLeft(r,s)return UDim2.new(0,r.x-s.
|
'rbxasset://textures/ui/TouchControlsSheet.png',5,0.92,{},90 if e()then l=70 end
|
||||||
AbsoluteSize.x/2,0,r.y-s.AbsoluteSize.y/2)end function rotatePointAboutLocation(
|
local m,n,o={},nil,0.007 local p,q,r,s=o*16,0.03,0.2,nil Game:GetService
|
||||||
r,s,t)local u,v,w=math.sin(t),math.cos(t),r w=Vector2.new(w.x-s.x,w.y-s.y)local
|
'ContentProvider':Preload(h)local t t=function(u,v)local w,x=v.x-u.x,v.y-u.y
|
||||||
x,y=w.x*v-w.y*u,w.x*u+w.y*v w=Vector2.new(x+s.x,y+s.y)return w end function
|
return math.sqrt(w*w+x*x)end local u u=function(v,w)return UDim2.new(0,v.x-w.
|
||||||
dotProduct(r,s)return((r.x*s.x)+(r.y*s.y))end function
|
AbsoluteSize.x/2,0,v.y-w.AbsoluteSize.y/2)end local v v=function(w,x,y)local z,A
|
||||||
stationaryThumbstickTouchMove(r,s,t)local u=Vector2.new(s.Position.X.Offset+s.
|
,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
|
||||||
AbsoluteSize.x/2,s.Position.Y.Offset+s.AbsoluteSize.y/2)local v=
|
,B.x*z+B.y*A B=Vector2.new(C+x.x,D+x.y)return B end local w w=function(x,y)
|
||||||
DistanceBetweenTwoPoints(t,u)if v>(e/2)then local w=Vector2.new(t.x-u.x,t.y-u.y)
|
return x.x*y.x+x.y*y.y end local x x=function(y,z,A)local B=Vector2.new(z.
|
||||||
local x=w.unit if x.x==math.nan or x.x==math.inf then x=Vector2.new(0,x.y)end if
|
Position.X.Offset+z.AbsoluteSize.x/2,z.Position.Y.Offset+z.AbsoluteSize.y/2)
|
||||||
x.y==math.nan or x.y==math.inf then x=Vector2.new(x.x,0)end local y=u+(x*(e/2))r
|
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
|
||||||
.Position=transformFromCenterToTopLeft(y,r)else r.Position=
|
if E.x==math.nan or E.x==math.inf then E=Vector2.new(0,E.y)end if E.y==math.nan
|
||||||
transformFromCenterToTopLeft(t,r)end return Vector2.new(r.Position.X.Offset-s.
|
or E.y==math.inf then E=Vector2.new(E.x,0)end local F=B+(E*(g/2))y.Position=u(F,
|
||||||
Position.X.Offset,r.Position.Y.Offset-s.Position.Y.Offset)end function
|
y)else y.Position=u(A,y)end return Vector2.new(y.Position.X.Offset-z.Position.X.
|
||||||
followThumbstickTouchMove(r,s,t)local u=Vector2.new(s.Position.X.Offset+s.
|
Offset,y.Position.Y.Offset-z.Position.Y.Offset)end local y y=function(z,A,B)
|
||||||
AbsoluteSize.x/2,s.Position.Y.Offset+s.AbsoluteSize.y/2)if
|
local C=Vector2.new(A.Position.X.Offset+A.AbsoluteSize.x/2,A.Position.Y.Offset+A
|
||||||
DistanceBetweenTwoPoints(t,u)>e/2 then local v=Vector2.new(r.Position.X.Offset+r
|
.AbsoluteSize.y/2)if t(B,C)>g/2 then local D=Vector2.new(z.Position.X.Offset+z.
|
||||||
.AbsoluteSize.x/2,r.Position.Y.Offset+r.AbsoluteSize.y/2)local w,x=Vector2.new(t
|
AbsoluteSize.x/2,z.Position.Y.Offset+z.AbsoluteSize.y/2)local E,F=Vector2.new(B.
|
||||||
.x-v.x,t.y-v.y).unit,Vector2.new(v.x-u.x,v.y-u.y)local y,z=x.unit,Vector2.new(t.
|
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
|
||||||
x-v.x,t.y-v.y)local A=(y.x*w.y)-(y.y*w.x)local B=math.atan2(A,dotProduct(y,w))
|
-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*
|
||||||
local C=B*math.min(z.magnitude/x.magnitude,1)if math.abs(C)>0.00001 then local D
|
math.min(H.magnitude/F.magnitude,1)if math.abs(K)>0.00001 then local L=v(C,D,K)A
|
||||||
=rotatePointAboutLocation(u,v,C)s.Position=transformFromCenterToTopLeft(Vector2.
|
.Position=u(Vector2.new(L.x,L.y),A)end A.Position=UDim2.new(0,A.Position.X.
|
||||||
new(D.x,D.y),s)end s.Position=UDim2.new(0,s.Position.X.Offset+z.x,0,s.Position.Y
|
Offset+H.x,0,A.Position.Y.Offset+H.y)end z.Position=u(B,z)local D,E=Vector2.new(
|
||||||
.Offset+z.y)end r.Position=transformFromCenterToTopLeft(t,r)local v,w=Vector2.
|
z.Position.X.Offset,z.Position.Y.Offset),Vector2.new(A.Position.X.Offset,A.
|
||||||
new(r.Position.X.Offset,r.Position.Y.Offset),Vector2.new(s.Position.X.Offset,s.
|
Position.Y.Offset)if t(D,E)>g/2 then local F=(E-D).unit*g/2 A.Position=UDim2.
|
||||||
Position.Y.Offset)if DistanceBetweenTwoPoints(v,w)>e/2 then local x=(w-v).unit*e
|
new(0,D.x+F.x,0,D.y+F.y)end return Vector2.new(z.Position.X.Offset-A.Position.X.
|
||||||
/2 s.Position=UDim2.new(0,v.x+x.x,0,v.y+x.y)end return Vector2.new(r.Position.X.
|
Offset,z.Position.Y.Offset-A.Position.Y.Offset)end local z z=function(A)return(
|
||||||
Offset-s.Position.X.Offset,r.Position.Y.Offset-s.Position.Y.Offset)end function
|
math.abs(A.x)>i)or(math.abs(A.y)>i)end local A A=function(B,C,D)local E=a(
|
||||||
movementOutsideDeadZone(r)return((math.abs(r.x)>g)or(math.abs(r.y)>g))end
|
'Frame','ThumbstickFrame',{Active=true,Size=UDim2.new(0,g,0,g),Position=B,
|
||||||
function constructThumbstick(r,s,t)local u=Instance.new'Frame'u.Name=
|
BackgroundTransparency=1})a('ImageLabel','InnerThumbstick',{Image=h,
|
||||||
'ThumbstickFrame'u.Active=true u.Size=UDim2.new(0,e,0,e)u.Position=r u.
|
ImageRectOffset=Vector2.new(220,0),ImageRectSize=Vector2.new(111,111),
|
||||||
BackgroundTransparency=1 local v=Instance.new'ImageLabel'v.Name=
|
BackgroundTransparency=1,Size=UDim2.new(0,g/2,0,g/2),Position=UDim2.new(0,E.Size
|
||||||
'OuterThumbstick'v.Image=f v.ImageRectOffset=Vector2.new(0,0)v.ImageRectSize=
|
.X.Offset/2-g/4,0,E.Size.Y.Offset/2-g/4),ZIndex=2,Parent=E})local F,G,H,I,J=a(
|
||||||
Vector2.new(220,220)v.BackgroundTransparency=1 v.Size=UDim2.new(0,e,0,e)v.
|
'ImageLabel','OuterThumbstick',{Image=h,ImageRectOffset=Vector2.new(0,0),
|
||||||
Position=r v.Parent=Game.CoreGui.RobloxGui local w=Instance.new'ImageLabel'w.
|
ImageRectSize=Vector2.new(220,220),BackgroundTransparency=1,Size=UDim2.new(0,g,0
|
||||||
Name='InnerThumbstick'w.Image=f w.ImageRectOffset=Vector2.new(220,0)w.
|
,g),Position=B,Parent=Game.CoreGui.RobloxGui}),nil,nil,nil,nil J=function(K)if G
|
||||||
ImageRectSize=Vector2.new(111,111)w.BackgroundTransparency=1 w.Size=UDim2.new(0,
|
then return end if K==s then return end if K==n then return end if K.
|
||||||
e/2,0,e/2)w.Position=UDim2.new(0,u.Size.X.Offset/2-e/4,0,u.Size.Y.Offset/2-e/4)w
|
UserInputType~=Enum.UserInputType.Touch then return end G=K table.insert(k,G)E.
|
||||||
.Parent=u w.ZIndex=2 local x,y,z=nil,nil,nil local A=function(A)if x then return
|
Position=u(G.Position,E)F.Position=E.Position H=b.TouchMoved:connect(function(L)
|
||||||
end if A==q then return end if A==l then return end if A.UserInputType~=Enum.
|
if L==G then local M if D then M=x(E,F,Vector2.new(L.Position.x,L.Position.y))
|
||||||
UserInputType.Touch then return end x=A table.insert(i,x)u.Position=
|
else M=y(E,F,Vector2.new(L.Position.x,L.Position.y))end if C then return C(M,F.
|
||||||
transformFromCenterToTopLeft(x.Position,u)v.Position=u.Position y=a.TouchMoved:
|
Size.X.Offset/2)end end end)I=b.TouchEnded:connect(function(L)if L==G then if C
|
||||||
connect(function(B)if B==x then local C=nil if t then C=
|
then C(Vector2.new(0,0),1)end I:disconnect()H:disconnect()E.Position=B F.
|
||||||
stationaryThumbstickTouchMove(u,v,Vector2.new(B.Position.x,B.Position.y))else C=
|
Position=B for M,N in pairs(k)do if N==G then table.remove(k,M)break end end G=
|
||||||
followThumbstickTouchMove(u,v,Vector2.new(B.Position.x,B.Position.y))end if s
|
nil end end)end b.Changed:connect(function(K)if K=='ModalEnabled'then do local L
|
||||||
then s(C,v.Size.X.Offset/2)end end end)z=a.TouchEnded:connect(function(B)if B==x
|
=not b.ModalEnabled E.Visible=L F.Visible=L end end end)E.InputBegan:connect(J)
|
||||||
then if s then s(Vector2.new(0,0),1)end z:disconnect()y:disconnect()u.Position=r
|
return E end local B B=function(C)local D,E,F,G=nil,nil,f.MoveCharacter,nil G=
|
||||||
v.Position=r for C,D in pairs(i)do if D==x then table.remove(i,C)break end end x
|
function(H,I)if f then if z(H)then D=H E=I if H.magnitude/I>j then I=H.magnitude
|
||||||
=nil end end)end a.Changed:connect(function(B)if B=='ModalEnabled'then u.Visible
|
-1 end return F(f,H,I)else D=Vector2.new(0,0)E=1 return F(f,D,E)end end end
|
||||||
=not a.ModalEnabled v.Visible=not a.ModalEnabled end end)u.InputBegan:connect(A)
|
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
|
||||||
return u end function setupCharacterMovement(r)local s,t=nil local u=d.
|
local I=A(H,G,false)I.Name='CharacterThumbstick'I.Parent=C local J J=function()
|
||||||
MoveCharacter local v,w=function(v,w)if d then if movementOutsideDeadZone(v)then
|
if f and F and D and E then return F(f,D,E)end end return J end local C C=
|
||||||
s=v t=w if v.magnitude/w>h then w=v.magnitude-1 end u(d,v,w)else s=Vector2.new(0
|
function(D)local E,F,G=a('ImageButton','JumpButton',{BackgroundTransparency=1,
|
||||||
,0)t=1 u(d,s,t)end end end,UDim2.new(0,e/2,1,-e*1.75)if isSmallScreenDevice()
|
Image=h,ImageRectOffset=Vector2.new(176,222),ImageRectSize=Vector2.new(174,174),
|
||||||
then w=UDim2.new(0,(e/2)-10,1,-e-20)end local x=constructThumbstick(w,v,false)x.
|
Size=UDim2.new(0,l,0,l),Position=UDim2.new(1,(function()if e()then return-(l*
|
||||||
Name='CharacterThumbstick'x.Parent=r local y=function()if d and u and s and t
|
2.25),1,-l-20 else return-(l*2.75),1,-l-120 end end)())}),f.JumpCharacter,nil G=
|
||||||
then u(d,s,t)end end return y end function setupJumpButton(r)local s=Instance.
|
function()while n do if f then F(f)end wait(1.6666666666666665E-2)end end E.
|
||||||
new'ImageButton's.Name='JumpButton's.BackgroundTransparency=1 s.Image=f s.
|
InputBegan:connect(function(H)if H.UserInputType~=Enum.UserInputType.Touch then
|
||||||
ImageRectOffset=Vector2.new(176,222)s.ImageRectSize=Vector2.new(174,174)s.Size=
|
return end if n then return end if H==s then return end for I,J in pairs(m)do if
|
||||||
UDim2.new(0,j,0,j)if isSmallScreenDevice()then s.Position=UDim2.new(1,-(j*2.25),
|
J==H then return end end n=H E.ImageRectOffset=Vector2.new(0,222)E.ImageRectSize
|
||||||
1,-j-20)else s.Position=UDim2.new(1,-(j*2.75),1,-j-120)end local t=d.
|
=Vector2.new(174,174)return G()end)E.InputEnded:connect(function(H)if H.
|
||||||
JumpCharacter local u=function()while l do if d then t(d)end wait(
|
UserInputType~=Enum.UserInputType.Touch then return end E.ImageRectOffset=
|
||||||
1.6666666666666665E-2)end end s.InputBegan:connect(function(v)if v.UserInputType
|
Vector2.new(176,222)E.ImageRectSize=Vector2.new(174,174)if H==n then table.
|
||||||
~=Enum.UserInputType.Touch then return end if l then return end if v==q then
|
insert(m,n)n=nil end end)b.InputEnded:connect(function(H)for I,J in pairs(m)do
|
||||||
return end for w,x in pairs(k)do if x==v then return end end l=v s.
|
if J==H then table.remove(m,I)break end end end)b.Changed:connect(function(H)if
|
||||||
ImageRectOffset=Vector2.new(0,222)s.ImageRectSize=Vector2.new(174,174)u()end)s.
|
H=='ModalEnabled'then E.Visible=not b.ModalEnabled end end)E.Parent=D end local
|
||||||
InputEnded:connect(function(v)if v.UserInputType~=Enum.UserInputType.Touch then
|
D D=function(E)if E==n then return true end for F,G in pairs(m)do if E==G then
|
||||||
return end s.ImageRectOffset=Vector2.new(176,222)s.ImageRectSize=Vector2.new(174
|
return true end end return false end local E E=function(F)for G,H in pairs(k)do
|
||||||
,174)if v==l then table.insert(k,l)l=nil end end)a.InputEnded:connect(function(v
|
if F==H then return true end end return false end local F F=function(G,H)local I
|
||||||
)for w,x in pairs(k)do if x==v then table.remove(k,w)break end end end)a.Changed
|
,J,K,L,M,N,O,P,Q,R=nil,false,b.RotateCamera,-1,false,nil,b.ZoomCamera,{},nil,nil
|
||||||
:connect(function(v)if v=='ModalEnabled'then s.Visible=not a.ModalEnabled end
|
R=function()s=nil J=false I=nil end local S S=function()P={}N=nil M=false Q:
|
||||||
end)s.Parent=r end function isTouchUsedByJumpButton(r)if r==l then return true
|
Destroy()Q=nil end local T T=function(U,V)if Q~=nil then Q:Destroy()end Q=a(
|
||||||
end for s,t in pairs(k)do if r==t then return true end end return false end
|
'Frame',{Name='PinchFrame',BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),
|
||||||
function isTouchUsedByThumbstick(r)for s,t in pairs(i)do if r==t then return
|
Parent=G})Q.InputChanged:connect(function(W)if not M then S()return end R()if
|
||||||
true end end return false end function setupCameraControl(r,s)local t,u,v,w,x,y,
|
not(N~=nil)then if W==U then N=(W.Position-V.Position).magnitude U=W elseif W==V
|
||||||
z,A,B=nil,false,a.RotateCamera,-1,false,nil,a.ZoomCamera,{},nil local C,D=
|
then N=(W.Position-U.Position).magnitude V=W end else local X=0 if W==U then X=(
|
||||||
function()q=nil u=false t=nil end,function()A={}y=nil x=false B:Destroy()B=nil
|
W.Position-V.Position).magnitude U=W elseif W==V then X=(W.Position-U.Position).
|
||||||
end local E=function(E,F)if B then B:Destroy()end B=Instance.new'Frame'B.Name=
|
magnitude V=W end if X~=0 then local Y=X-N if Y~=0 then O(b,(Y*q))end N=X end
|
||||||
'PinchFrame'B.BackgroundTransparency=1 B.Parent=r B.Size=UDim2.new(1,0,1,0)B.
|
end end)return Q.InputEnded:connect(function(W)if W==U or W==V then return S()
|
||||||
InputChanged:connect(function(G)if not x then D()return end C()if y==nil then if
|
end end)end local U U=function(V)if#P<1 then table.insert(P,V)L=tick()M=false
|
||||||
G==E then y=(G.Position-F.Position).magnitude E=G elseif G==F then y=(G.Position
|
elseif#P==1 then M=((tick()-L)<=r)if M then table.insert(P,V)return T(P[1],P[2])
|
||||||
-E.Position).magnitude F=G end else local H=0 if G==E then H=(G.Position-F.
|
else P={}end end end G.InputBegan:connect(function(V)if V.UserInputType~=Enum.
|
||||||
Position).magnitude E=G elseif G==F then H=(G.Position-E.Position).magnitude F=G
|
UserInputType.Touch then return end if D(V)then return end local W=E(V)if not W
|
||||||
end if H~=0 then local I=H-y if I~=0 then z(a,(I*o))end y=H end end end)B.
|
then U(V)end if not(s~=nil)and not W then s=V I=Vector2.new(s.Position.x,s.
|
||||||
InputEnded:connect(function(G)if G==E or G==F then D()end end)end local F=
|
Position.y)end end)b.InputChanged:connect(function(V)if V.UserInputType~=Enum.
|
||||||
function(F)if#A<1 then table.insert(A,F)w=tick()x=false elseif#A==1 then x=((
|
UserInputType.Touch then return end if s~=V then return end local W=Vector2.new(
|
||||||
tick()-w)<=p)if x then table.insert(A,F)E(A[1],A[2])else A={}end end end r.
|
s.Position.x,s.Position.y)local X=(I-W)*o if not J and(X.magnitude>p)then J=true
|
||||||
InputBegan:connect(function(G)if G.UserInputType~=Enum.UserInputType.Touch then
|
I=W end if J and(I~=W)then K(b,X)H()I=W end end)return b.InputEnded:connect(
|
||||||
return end if isTouchUsedByJumpButton(G)then return end local H=
|
function(V)if s==V or not(s~=nil)then R()end for W,X in pairs(P)do if X==V then
|
||||||
isTouchUsedByThumbstick(G)if not H then F(G)end if q==nil and not H then q=G t=
|
table.remove(P,W)end end end)end local G G=function()local H=a('Frame',
|
||||||
Vector2.new(q.Position.x,q.Position.y)end end)a.InputChanged:connect(function(G)
|
'TouchControlFrame',{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Parent=
|
||||||
if G.UserInputType~=Enum.UserInputType.Touch then return end if q~=G then return
|
Game.CoreGui.RobloxGui})local I=B(H)C(H)F(H,I)return b.ProcessedEvent:connect(
|
||||||
end local H=Vector2.new(q.Position.x,q.Position.y)local I=(t-H)*m if not u and(I
|
function(J,K)if not K then return end if J==s and J.UserInputState==Enum.
|
||||||
.magnitude>n)then u=true t=H end if u and(t~=H)then v(a,I)s()t=H end end)a.
|
UserInputState.Begin then s=nil end end)end return G()
|
||||||
InputEnded:connect(function(G)if q==G or q==nil then C()end for H,I in pairs(A)
|
|
||||||
do if I==G then table.remove(A,H)end end end)end function setupTouchControls()
|
|
||||||
local r=Instance.new'Frame'r.Name='TouchControlFrame'r.Size=UDim2.new(1,0,1,0)r.
|
|
||||||
BackgroundTransparency=1 r.Parent=Game.CoreGui.RobloxGui local s=
|
|
||||||
setupCharacterMovement(r)setupJumpButton(r)setupCameraControl(r,s)a.
|
|
||||||
ProcessedEvent:connect(function(t,u)if not u then return end if t==q and t.
|
|
||||||
UserInputState==Enum.UserInputState.Begin then q=nil end end)end do
|
|
||||||
setupTouchControls()end
|
|
||||||
|
|
@ -1,215 +1,201 @@
|
||||||
local a,b=assert(LoadLibrary'RbxUtility').Create,nil if script.Parent:
|
local a,b=assert(LoadLibrary'RbxUtility').Create,script.Parent:FindFirstChild
|
||||||
FindFirstChild'ControlFrame'then b=script.Parent:FindFirstChild'ControlFrame'
|
'ControlFrame'or script.Parent local c,d,e,f=a'Frame'{Name='DevConsoleContainer'
|
||||||
else b=script.Parent end local c,d,e=a'Frame'{Name='DevConsoleContainer',Parent=
|
,Parent=b,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.9,Position
|
||||||
b,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.9,Position=UDim2.
|
=UDim2.new(0,100,0,10),Size=UDim2.new(0.5,20,0.5,20),Visible=false},a
|
||||||
new(0,100,0,10),Size=UDim2.new(0.5,20,0.5,20),Visible=false},a'BindableFunction'
|
'BindableFunction'{Name='ToggleDevConsole',Parent=b},false,nil f=function()if e
|
||||||
{Name='ToggleDevConsole',Parent=b},false function initializeDeveloperConsole()if
|
then return end e=true local g,h,i,j=1,2,1000,Vector2.new(245,180)local k,l,m,n,
|
||||||
e then return end e=true local f,g,h,i=1,2,1000,Vector2.new(245,180)local j,k,l,
|
o,p,q,r,s,t,u,v,w=g,{},{},0,0,true,true,true,true,false,0,0,a'Frame'{Name='Body'
|
||||||
m,n,o,p,q,r,s,t,u,v=f,{},{},0,0,true,true,true,true,false,0,0,a'Frame'{Name=
|
,Parent=c,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position
|
||||||
'Body',Parent=c,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,
|
=UDim2.new(0,0,0,21),Size=UDim2.new(1,0,1,-25)}local x=a'Frame'{Name=
|
||||||
Position=UDim2.new(0,0,0,21),Size=UDim2.new(1,0,1,-25)}local w=a'Frame'{Name=
|
'OptionsHolder',Parent=w,BackgroundColor3=Color3.new(0,0,0),
|
||||||
'OptionsHolder',Parent=v,BackgroundColor3=Color3.new(0,0,0),
|
|
||||||
BackgroundTransparency=1,Position=UDim2.new(0,220,0,0),Size=UDim2.new(1,-255,0,
|
BackgroundTransparency=1,Position=UDim2.new(0,220,0,0),Size=UDim2.new(1,-255,0,
|
||||||
24),ClipsDescendants=true}local x=a'Frame'{Name='OptionsBar',Parent=w,
|
24),ClipsDescendants=true}local y=a'Frame'{Name='OptionsBar',Parent=x,
|
||||||
BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,Position=UDim2.new(0
|
BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,Position=UDim2.new(0
|
||||||
,-250,0,4),Size=UDim2.new(0,234,0,18)}local y=a'TextButton'{Name=
|
,-250,0,4),Size=UDim2.new(0,234,0,18)}local z=a'TextButton'{Name=
|
||||||
'ErrorToggleButton',Parent=x,BackgroundColor3=Color3.new(0,0,0),BorderColor3=
|
'ErrorToggleButton',Parent=y,BackgroundColor3=Color3.new(0,0,0),BorderColor3=
|
||||||
Color3.new(1,0,0),Position=UDim2.new(0,115,0,0),Size=UDim2.new(0,18,0,18),Font=
|
Color3.new(1,0,0),Position=UDim2.new(0,115,0,0),Size=UDim2.new(0,18,0,18),Font=
|
||||||
'SourceSansBold',FontSize=Enum.FontSize.Size14,Text='',TextColor3=Color3.new(1,0
|
'SourceSansBold',FontSize=Enum.FontSize.Size14,Text='',TextColor3=Color3.new(1,0
|
||||||
,0)}a'Frame'{Name='CheckFrame',Parent=y,BackgroundColor3=Color3.new(1,0,0),
|
,0)}a'Frame'{Name='CheckFrame',Parent=z,BackgroundColor3=Color3.new(1,0,0),
|
||||||
BorderColor3=Color3.new(1,0,0),Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0
|
BorderColor3=Color3.new(1,0,0),Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0
|
||||||
,10)}local z=a'TextButton'{Name='InfoToggleButton',Parent=x,BackgroundColor3=
|
,10)}local A=a'TextButton'{Name='InfoToggleButton',Parent=y,BackgroundColor3=
|
||||||
Color3.new(0,0,0),BorderColor3=Color3.new(0.4,0.5,1),Position=UDim2.new(0,65,0,0
|
Color3.new(0,0,0),BorderColor3=Color3.new(0.4,0.5,1),Position=UDim2.new(0,65,0,0
|
||||||
),Size=UDim2.new(0,18,0,18),Font='SourceSansBold',FontSize=Enum.FontSize.Size14,
|
),Size=UDim2.new(0,18,0,18),Font='SourceSansBold',FontSize=Enum.FontSize.Size14,
|
||||||
Text='',TextColor3=Color3.new(0.4,0.5,1)}a'Frame'{Name='CheckFrame',Parent=z,
|
Text='',TextColor3=Color3.new(0.4,0.5,1)}a'Frame'{Name='CheckFrame',Parent=A,
|
||||||
BackgroundColor3=Color3.new(0.4,0.5,1),BorderColor3=Color3.new(0.4,0.5,1),
|
BackgroundColor3=Color3.new(0.4,0.5,1),BorderColor3=Color3.new(0.4,0.5,1),
|
||||||
Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local A=a'TextButton'{Name
|
Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local B=a'TextButton'{Name
|
||||||
='OutputToggleButton',Parent=x,BackgroundColor3=Color3.new(0,0,0),BorderColor3=
|
='OutputToggleButton',Parent=y,BackgroundColor3=Color3.new(0,0,0),BorderColor3=
|
||||||
Color3.new(1,1,1),Position=UDim2.new(0,40,0,0),Size=UDim2.new(0,18,0,18),Font=
|
Color3.new(1,1,1),Position=UDim2.new(0,40,0,0),Size=UDim2.new(0,18,0,18),Font=
|
||||||
'SourceSansBold',FontSize=Enum.FontSize.Size14,Text='',TextColor3=Color3.new(1,1
|
'SourceSansBold',FontSize=Enum.FontSize.Size14,Text='',TextColor3=Color3.new(1,1
|
||||||
,1)}a'Frame'{Name='CheckFrame',Parent=A,BackgroundColor3=Color3.new(1,1,1),
|
,1)}a'Frame'{Name='CheckFrame',Parent=B,BackgroundColor3=Color3.new(1,1,1),
|
||||||
BorderColor3=Color3.new(1,1,1),Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0
|
BorderColor3=Color3.new(1,1,1),Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0
|
||||||
,10)}local B=a'TextButton'{Name='WarningToggleButton',Parent=x,BackgroundColor3=
|
,10)}local C=a'TextButton'{Name='WarningToggleButton',Parent=y,BackgroundColor3=
|
||||||
Color3.new(0,0,0),BorderColor3=Color3.new(1,0.6,0.4),Position=UDim2.new(0,90,0,0
|
Color3.new(0,0,0),BorderColor3=Color3.new(1,0.6,0.4),Position=UDim2.new(0,90,0,0
|
||||||
),Size=UDim2.new(0,18,0,18),Font='SourceSansBold',FontSize=Enum.FontSize.Size14,
|
),Size=UDim2.new(0,18,0,18),Font='SourceSansBold',FontSize=Enum.FontSize.Size14,
|
||||||
Text='',TextColor3=Color3.new(1,0.6,0.4)}a'Frame'{Name='CheckFrame',Parent=B,
|
Text='',TextColor3=Color3.new(1,0.6,0.4)}a'Frame'{Name='CheckFrame',Parent=C,
|
||||||
BackgroundColor3=Color3.new(1,0.6,0.4),BorderColor3=Color3.new(1,0.6,0.4),
|
BackgroundColor3=Color3.new(1,0.6,0.4),BorderColor3=Color3.new(1,0.6,0.4),
|
||||||
Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local C=a'TextButton'{Name
|
Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local D=a'TextButton'{Name
|
||||||
='WordWrapToggleButton',Parent=x,BackgroundColor3=Color3.new(0,0,0),BorderColor3
|
='WordWrapToggleButton',Parent=y,BackgroundColor3=Color3.new(0,0,0),BorderColor3
|
||||||
=Color3.new(0.8,0.8,0.8),Position=UDim2.new(0,215,0,0),Size=UDim2.new(0,18,0,18)
|
=Color3.new(0.8,0.8,0.8),Position=UDim2.new(0,215,0,0),Size=UDim2.new(0,18,0,18)
|
||||||
,Font='SourceSansBold',FontSize=Enum.FontSize.Size14,Text='',TextColor3=Color3.
|
,Font='SourceSansBold',FontSize=Enum.FontSize.Size14,Text='',TextColor3=Color3.
|
||||||
new(0.8,0.8,0.8)}a'Frame'{Name='CheckFrame',Parent=C,BackgroundColor3=Color3.
|
new(0.8,0.8,0.8)}a'Frame'{Name='CheckFrame',Parent=D,BackgroundColor3=Color3.
|
||||||
new(0.8,0.8,0.8),BorderColor3=Color3.new(0.8,0.8,0.8),Position=UDim2.new(0,4,0,4
|
new(0.8,0.8,0.8),BorderColor3=Color3.new(0.8,0.8,0.8),Position=UDim2.new(0,4,0,4
|
||||||
),Size=UDim2.new(0,10,0,10),Visible=false}a'TextLabel'{Name='Filter',Parent=x,
|
),Size=UDim2.new(0,10,0,10),Visible=false}a'TextLabel'{Name='Filter',Parent=y,
|
||||||
BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,40,0,18),
|
BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,40,0,18),
|
||||||
Font='SourceSansBold',FontSize=Enum.FontSize.Size14,Text='Filter',TextColor3=
|
Font='SourceSansBold',FontSize=Enum.FontSize.Size14,Text='Filter',TextColor3=
|
||||||
Color3.new(1,1,1)}a'TextLabel'{Name='WordWrap',Parent=x,BackgroundTransparency=1
|
Color3.new(1,1,1)}a'TextLabel'{Name='WordWrap',Parent=y,BackgroundTransparency=1
|
||||||
,Position=UDim2.new(0,150,0,0),Size=UDim2.new(0,50,0,18),Font='SourceSansBold',
|
,Position=UDim2.new(0,150,0,0),Size=UDim2.new(0,50,0,18),Font='SourceSansBold',
|
||||||
FontSize=Enum.FontSize.Size14,Text='Word Wrap',TextColor3=Color3.new(1,1,1)}
|
FontSize=Enum.FontSize.Size14,Text='Word Wrap',TextColor3=Color3.new(1,1,1)}
|
||||||
local D=a'Frame'{Name='ScrollBar',Parent=v,BackgroundColor3=Color3.new(0,0,0),
|
local E=a'Frame'{Name='ScrollBar',Parent=w,BackgroundColor3=Color3.new(0,0,0),
|
||||||
BackgroundTransparency=0.9,Position=UDim2.new(1,-20,0,26),Size=UDim2.new(0,20,1,
|
BackgroundTransparency=0.9,Position=UDim2.new(1,-20,0,26),Size=UDim2.new(0,20,1,
|
||||||
-50),Visible=false}local E=a'Frame'{Name='ScrollArea',Parent=D,
|
-50),Visible=false}local F=a'Frame'{Name='ScrollArea',Parent=E,
|
||||||
BackgroundTransparency=1,Position=UDim2.new(0,0,0,23),Size=UDim2.new(1,0,1,-46)}
|
BackgroundTransparency=1,Position=UDim2.new(0,0,0,23),Size=UDim2.new(1,0,1,-46)}
|
||||||
local F=a'ImageButton'{Name='Handle',Parent=E,BackgroundColor3=Color3.new(0,0,0)
|
local G=a'ImageButton'{Name='Handle',Parent=F,BackgroundColor3=Color3.new(0,0,0)
|
||||||
,BackgroundTransparency=0.5,Position=UDim2.new(0,0,0.2,0),Size=UDim2.new(0,20,0,
|
,BackgroundTransparency=0.5,Position=UDim2.new(0,0,0.2,0),Size=UDim2.new(0,20,0,
|
||||||
40)}a'ImageLabel'{Name='ImageLabel',Parent=F,BackgroundTransparency=1,Position=
|
40)}a'ImageLabel'{Name='ImageLabel',Parent=G,BackgroundTransparency=1,Position=
|
||||||
UDim2.new(0,0,0.5,-8),Rotation=180,Size=UDim2.new(1,0,0,16),Image=
|
UDim2.new(0,0,0.5,-8),Rotation=180,Size=UDim2.new(1,0,0,16),Image=
|
||||||
'http://www.roblox.com/Asset?id=151205881'}local G=a'ImageButton'{Name='Down',
|
'http://www.roblox.com/Asset?id=151205881'}local H=a'ImageButton'{Name='Down',
|
||||||
Parent=D,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position=
|
Parent=E,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position=
|
||||||
UDim2.new(0,0,1,-20),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{Name='ImageLabel',
|
UDim2.new(0,0,1,-20),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{Name='ImageLabel',
|
||||||
Parent=G,BackgroundTransparency=1,Position=UDim2.new(0,3,0,3),Size=UDim2.new(0,
|
Parent=H,BackgroundTransparency=1,Position=UDim2.new(0,3,0,3),Size=UDim2.new(0,
|
||||||
14,0,14),Rotation=180,Image='http://www.roblox.com/Asset?id=151205813'}local H=a
|
14,0,14),Rotation=180,Image='http://www.roblox.com/Asset?id=151205813'}local I=a
|
||||||
'ImageButton'{Name='Up',Parent=D,BackgroundColor3=Color3.new(0,0,0),
|
'ImageButton'{Name='Up',Parent=E,BackgroundColor3=Color3.new(0,0,0),
|
||||||
BackgroundTransparency=0.5,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,20,0,20)
|
BackgroundTransparency=0.5,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,20,0,20)
|
||||||
}a'ImageLabel'{Name='ImageLabel',Parent=H,BackgroundTransparency=1,Position=
|
}a'ImageLabel'{Name='ImageLabel',Parent=I,BackgroundTransparency=1,Position=
|
||||||
UDim2.new(0,3,0,3),Size=UDim2.new(0,14,0,14),Image=
|
UDim2.new(0,3,0,3),Size=UDim2.new(0,14,0,14),Image=
|
||||||
'http://www.roblox.com/Asset?id=151205813'}local I=a'Frame'{Name='TextBox',
|
'http://www.roblox.com/Asset?id=151205813'}local J=a'Frame'{Name='TextBox',
|
||||||
Parent=v,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.6,Position=
|
Parent=w,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.6,Position=
|
||||||
UDim2.new(0,2,0,26),Size=UDim2.new(1,-4,1,-28),ClipsDescendants=true}local J,K=a
|
UDim2.new(0,2,0,26),Size=UDim2.new(1,-4,1,-28),ClipsDescendants=true}local K,L=a
|
||||||
'Frame'{Name='TextHolder',Parent=I,BackgroundTransparency=1,Position=UDim2.new(0
|
'Frame'{Name='TextHolder',Parent=J,BackgroundTransparency=1,Position=UDim2.new(0
|
||||||
,0,0,0),Size=UDim2.new(1,0,1,0)},a'ImageButton'{Name='OptionsButton',Parent=v,
|
,0,0,0),Size=UDim2.new(1,0,1,0)},a'ImageButton'{Name='OptionsButton',Parent=w,
|
||||||
BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,Position=UDim2.new(0
|
BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,Position=UDim2.new(0
|
||||||
,200,0,2),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{Name='ImageLabel',Parent=K,
|
,200,0,2),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{Name='ImageLabel',Parent=L,
|
||||||
BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0),
|
BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0),
|
||||||
Rotation=0,Image='http://www.roblox.com/Asset?id=152093917'}local L=a
|
Rotation=0,Image='http://www.roblox.com/Asset?id=152093917'}local M=a
|
||||||
'ImageButton'{Name='ResizeButton',Parent=v,BackgroundColor3=Color3.new(0,0,0),
|
'ImageButton'{Name='ResizeButton',Parent=w,BackgroundColor3=Color3.new(0,0,0),
|
||||||
BackgroundTransparency=0.5,Position=UDim2.new(1,-20,1,-20),Size=UDim2.new(0,20,0
|
BackgroundTransparency=0.5,Position=UDim2.new(1,-20,1,-20),Size=UDim2.new(0,20,0
|
||||||
,20)}a'ImageLabel'{Name='ImageLabel',Parent=L,BackgroundTransparency=1,Position=
|
,20)}a'ImageLabel'{Name='ImageLabel',Parent=M,BackgroundTransparency=1,Position=
|
||||||
UDim2.new(0,6,0,6),Size=UDim2.new(0.8,0,0.8,0),Rotation=135,Image=
|
UDim2.new(0,6,0,6),Size=UDim2.new(0.8,0,0.8,0),Rotation=135,Image=
|
||||||
'http://www.roblox.com/Asset?id=151205813'}a'TextButton'{Name='LocalConsole',
|
'http://www.roblox.com/Asset?id=151205813'}a'TextButton'{Name='LocalConsole',
|
||||||
Parent=v,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.6,Position=
|
Parent=w,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.6,Position=
|
||||||
UDim2.new(0,7,0,5),Size=UDim2.new(0,90,0,20),Font='SourceSansBold',FontSize=Enum
|
UDim2.new(0,7,0,5),Size=UDim2.new(0,90,0,20),Font='SourceSansBold',FontSize=Enum
|
||||||
.FontSize.Size14,Text='Local Console',TextColor3=Color3.new(1,1,1),
|
.FontSize.Size14,Text='Local Console',TextColor3=Color3.new(1,1,1),
|
||||||
TextYAlignment=Enum.TextYAlignment.Center}a'TextButton'{Name='ServerConsole',
|
TextYAlignment=Enum.TextYAlignment.Center}a'TextButton'{Name='ServerConsole',
|
||||||
Parent=v,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.8,Position=
|
Parent=w,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.8,Position=
|
||||||
UDim2.new(0,102,0,5),Size=UDim2.new(0,90,0,17),Font='SourceSansBold',FontSize=
|
UDim2.new(0,102,0,5),Size=UDim2.new(0,90,0,17),Font='SourceSansBold',FontSize=
|
||||||
Enum.FontSize.Size14,Text='Server Console',TextColor3=Color3.new(1,1,1),
|
Enum.FontSize.Size14,Text='Server Console',TextColor3=Color3.new(1,1,1),
|
||||||
TextYAlignment=Enum.TextYAlignment.Center}local M=a'Frame'{Name='TitleBar',
|
TextYAlignment=Enum.TextYAlignment.Center}local N=a'Frame'{Name='TitleBar',
|
||||||
Parent=c,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position=
|
Parent=c,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position=
|
||||||
UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,20)}local N=a'ImageButton'{Name=
|
UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,20)}local O=a'ImageButton'{Name=
|
||||||
'CloseButton',Parent=M,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency
|
'CloseButton',Parent=N,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency
|
||||||
=0.5,Position=UDim2.new(1,-20,0,0),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{
|
=0.5,Position=UDim2.new(1,-20,0,0),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{
|
||||||
Parent=N,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,Position=
|
Parent=O,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,Position=
|
||||||
UDim2.new(0,3,0,3),Size=UDim2.new(0,14,0,14),Image=
|
UDim2.new(0,3,0,3),Size=UDim2.new(0,14,0,14),Image=
|
||||||
'http://www.roblox.com/Asset?id=151205852'}a'TextButton'{Name='TextButton',
|
'http://www.roblox.com/Asset?id=151205852'}a'TextButton'{Name='TextButton',
|
||||||
Parent=M,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position=
|
Parent=N,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position=
|
||||||
UDim2.new(0,0,0,0),Size=UDim2.new(1,-23,1,0),Text=''}a'TextLabel'{Name=
|
UDim2.new(0,0,0,0),Size=UDim2.new(1,-23,1,0),Text=''}a'TextLabel'{Name=
|
||||||
'TitleText',Parent=M,BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=
|
'TitleText',Parent=N,BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=
|
||||||
UDim2.new(0,185,0,20),Font='SourceSansBold',FontSize=Enum.FontSize.Size18,
|
UDim2.new(0,185,0,20),Font='SourceSansBold',FontSize=Enum.FontSize.Size18,
|
||||||
TextColor3=Color3.new(1,1,1),Text='Roblox Developer Console',TextYAlignment=Enum
|
TextColor3=Color3.new(1,1,1),Text='Roblox Developer Console',TextYAlignment=Enum
|
||||||
.TextYAlignment.Top}local O,P,Q,R,S,T,U,V,W=nil,nil,nil,nil,nil,nil,nil,false,
|
.TextYAlignment.Top}local P,Q,R,S,T,U,V,W,X=nil,nil,nil,nil,nil,nil,false,false,
|
||||||
false function clean()O=nil P=nil Q=nil R=nil S=nil T=nil U=nil V=false W=false
|
nil X=function()P=nil Q=nil R=nil S=nil T=nil U=nil V=false W=false end local Y
|
||||||
end function refreshConsolePosition(X,Y)if not O then return end local Z=Vector2
|
Y=function(Z,_)if not P then return end local aa=Vector2.new(Z,_-P)c.Position=
|
||||||
.new(X,Y)-O c.Position=UDim2.new(0,P.X+Z.X,0,P.Y+Z.Y)end M.TextButton.
|
UDim2.new(0,Q.X+aa.X,0,Q.Y+aa.Y)end N.TextButton.MouseButton1Down:connect(
|
||||||
MouseButton1Down:connect(function(X,Y)O=Vector2.new(X,Y)P=c.AbsolutePosition end
|
function(aa,Z)P=Vector2.new(aa,Z)Q=c.AbsolutePosition end)N.TextButton.
|
||||||
)M.TextButton.MouseButton1Up:connect(function(X,Y)clean()end)function
|
MouseButton1Up:connect(X)local aa aa=function(Z,_)if not R then return end local
|
||||||
refreshConsoleSize(Y,Z)if not Q then return end local _=Vector2.new(Y,Z)-Q c.
|
ab=Vector2.new(Z,_-R)c.Size=UDim2.new(0,math.max(S.X+ab.X,j.X),0,math.max(S.Y+ab
|
||||||
Size=UDim2.new(0,math.max(R.X+_.X,i.X),0,math.max(R.Y+_.Y,i.Y))end c.Body.
|
.Y,j.Y))end c.Body.ResizeButton.MouseButton1Down:connect(function(ab,Z)R=Vector2
|
||||||
ResizeButton.MouseButton1Down:connect(function(Y,Z)Q=Vector2.new(Y,Z)R=c.
|
.new(ab,Z)S=c.AbsoluteSize end)c.Body.ResizeButton.MouseButton1Up:connect(X)N.
|
||||||
AbsoluteSize end)c.Body.ResizeButton.MouseButton1Up:connect(function(Y,Z)clean()
|
CloseButton.MouseButton1Down:connect(function()c.Visible=false end)c.TitleBar.
|
||||||
end)M.CloseButton.MouseButton1Down:connect(function(Z,_)c.Visible=false end)c.
|
CloseButton.MouseButton1Up:connect(X)local ab,Z,_=true,false,nil _=function()if
|
||||||
TitleBar.CloseButton.MouseButton1Up:connect(function()clean()end)local _,aa=true
|
Z then return end Z=true repeat v=v+(function()if ab then return-1 else return 1
|
||||||
,false function startAnimation()if aa then return end aa=true repeat if _ then u
|
end end)()local ac=v/5 local ad=ac*ac*(3-(2*ac))L.ImageLabel.Rotation=ad*5*9 y.
|
||||||
=u-1 else u=u+1 end local ab=u/5 local ac=ab*ab*(3-(2*ab))K.ImageLabel.Rotation=
|
Position=UDim2.new(0,(ad*5*50)-250,0,4)wait()if(v<=0 and ab)or(v>=5 and not ab)
|
||||||
ac*5*9 x.Position=UDim2.new(0,(ac*5*50)-250,0,4)wait()if(u<=0 and _)or(u>=5 and
|
then Z=false end until not Z end L.MouseButton1Down:connect(function()ab=not ab
|
||||||
not _)then aa=false end until not aa end K.MouseButton1Down:connect(function(ab,
|
return _()end)local ac ac=function()if k==g then n=math.min(math.max(n,0),u-c.
|
||||||
ac)_=not _ startAnimation()end)function changeOffset(ac)if j==f then m=m+ac
|
Body.TextBox.AbsoluteSize.Y)K.Size=UDim2.new(1,0,0,u)elseif k==h then o=math.
|
||||||
elseif j==g then n=n+ac end repositionList()end function
|
min(math.max(o,0),u-c.Body.TextBox.AbsoluteSize.Y)K.Size=UDim2.new(1,0,0,u)end
|
||||||
refreshTextHolderForReal()local ac,ad=J:GetChildren(),nil if j==f then ad=k
|
local ad=c.Body.TextBox.AbsoluteSize.Y/K.AbsoluteSize.Y if ad>=1 then c.Body.
|
||||||
elseif j==g then ad=l end local ae=0 for af=1,#ac do ac[af].Visible=false end
|
ScrollBar.Visible=false c.Body.TextBox.Size=UDim2.new(1,-4,1,-28)if k==g or k==h
|
||||||
for af=1,#ad do local ag,ah=nil,false if af>#ac then ag=a'TextLabel'{Name=
|
then K.Position=UDim2.new(0,0,1,0-u)end else c.Body.ScrollBar.Visible=true c.
|
||||||
'Message',Parent=J,BackgroundTransparency=1,TextXAlignment='Left',Size=UDim2.
|
Body.TextBox.Size=UDim2.new(1,-25,1,-28)local ae,af=1-ad,nil if k==g then af=n/K
|
||||||
new(1,0,0,14),FontSize='Size10',ZIndex=1}ah=true else ag=ac[af]end if(r or ad[af
|
.AbsoluteSize.Y elseif k==h then af=o/K.AbsoluteSize.Y end local ag,ah=math.max(
|
||||||
].Type~=Enum.MessageType.MessageOutput)and(q or ad[af].Type~=Enum.MessageType.
|
0,ae-af),math.max(F.AbsoluteSize.Y*ad,21)local ai=ah/F.AbsoluteSize.Y local aj=(
|
||||||
MessageInfo)and(p or ad[af].Type~=Enum.MessageType.MessageWarning)and(o or ad[af
|
1-ai)/(1-ad)local ak=ag*aj local al=math.min(F.AbsoluteSize.Y*ak,F.AbsoluteSize.
|
||||||
].Type~=Enum.MessageType.MessageError)then ag.TextWrapped=s ag.Size=UDim2.new(
|
Y-ah)F.Handle.Size=UDim2.new(1,0,0,ah)F.Handle.Position=UDim2.new(0,0,0,al)K.
|
||||||
0.98,0,0,2000)ag.Parent=c ag.Text=ad[af].Time..' -- '..ad[af].Message ag.Size=
|
Position=UDim2.new(0,0,1,0-u+(function()if k==g then return n elseif k==h then
|
||||||
UDim2.new(0.98,0,0,ag.TextBounds.Y)ag.Position=UDim2.new(0,5,0,ae)ag.Parent=J ae
|
return o end end)())end end local ad ad=function(ae)if k==g then n=n+ae elseif k
|
||||||
=ae+ag.TextBounds.Y if ah then if(j==f and m>0)or(j==g and n>0)then
|
==h then o=o+ae end return ac()end local ae ae=function()local af,ag=K:
|
||||||
changeOffset(ag.TextBounds.Y)end end ag.Visible=true if ad[af].Type==Enum.
|
GetChildren(),nil if k==g then ag=l elseif k==h then ag=m end local ah=0 for ai=
|
||||||
MessageType.MessageError then ag.TextColor3=Color3.new(1,0,0)elseif ad[af].Type
|
1,#af do af[ai].Visible=false end for ai=1,#ag do local aj,ak=nil,false if ai>#
|
||||||
==Enum.MessageType.MessageInfo then ag.TextColor3=Color3.new(0.4,0.5,1)elseif ad
|
af then aj=a'TextLabel'{Name='Message',Parent=K,BackgroundTransparency=1,
|
||||||
[af].Type==Enum.MessageType.MessageWarning then ag.TextColor3=Color3.new(1,0.6,
|
TextXAlignment='Left',Size=UDim2.new(1,0,0,14),FontSize='Size10',ZIndex=1}ak=
|
||||||
0.4)else ag.TextColor3=Color3.new(1,1,1)end end end t=ae end local ac=false
|
true else aj=af[ai]end if(s or ag[ai].Type~=Enum.MessageType.MessageOutput)and(r
|
||||||
function refreshTextHolder()if ac then return end Delay(0.1,function()ac=false
|
or ag[ai].Type~=Enum.MessageType.MessageInfo)and(q or ag[ai].Type~=Enum.
|
||||||
refreshTextHolderForReal()end)ac=true end local ad=0 function holdingUpButton()
|
MessageType.MessageWarning)and(p or ag[ai].Type~=Enum.MessageType.MessageError)
|
||||||
if V then return end V=true wait(0.6)ad=ad+1 while V and ad<2 do wait()
|
then do aj.TextWrapped=t aj.Size=UDim2.new(0.98,0,0,2000)aj.Parent=c aj.Text=
|
||||||
changeOffset(12)end ad=ad-1 end function holdingDownButton()if W then return end
|
tostring(ag[ai].Time)..' -- '..tostring(ag[ai].Message)aj.Size=UDim2.new(0.98,0,
|
||||||
W=true wait(0.6)ad=ad+1 while W and ad<2 do wait()changeOffset(-12)end ad=ad-1
|
0,aj.TextBounds.Y)aj.Position=UDim2.new(0,5,0,ah)aj.Parent=K ah=ah+aj.TextBounds
|
||||||
end c.Body.ScrollBar.Up.MouseButton1Click:connect(function()changeOffset(10)end)
|
.Y end if ak then if(k==g and n>0)or(k==h and o>0)then ad(aj.TextBounds.Y)end
|
||||||
c.Body.ScrollBar.Up.MouseButton1Down:connect(function()changeOffset(10)
|
end aj.Visible=true aj.TextColor3=Color3.new((function()if ag[ai].Type==Enum.
|
||||||
holdingUpButton()end)c.Body.ScrollBar.Up.MouseButton1Up:connect(function()clean(
|
MessageType.MessageError then return 1,0,0 elseif ag[ai].Type==Enum.MessageType.
|
||||||
)end)c.Body.ScrollBar.Down.MouseButton1Down:connect(function()changeOffset(-10)
|
MessageInfo then return 0.4,0.5,1 elseif ag[ai].Type==Enum.MessageType.
|
||||||
holdingDownButton()end)c.Body.ScrollBar.Down.MouseButton1Up:connect(function()
|
MessageWarning then return 1,0.6,0.4 else return 1,1,1 end end)())end end u=ah
|
||||||
clean()end)function handleScroll(ae,af)if not S then return end local ag,ah,ai=(
|
end local af,ag=false,nil ag=function()if af then return end Delay(0.1,function(
|
||||||
Vector2.new(ae,af)-S).Y,1-(c.Body.TextBox.AbsoluteSize.Y/J.AbsoluteSize.Y),E.
|
)af=false return ae()end)af=true end local ah,ai=0,nil ai=function()if V then
|
||||||
AbsoluteSize.Y-E.Handle.AbsoluteSize.Y local aj=math.max(math.min(ag,ai),0-ai)
|
return end V=true wait(0.6)ah=ah+1 while V and ah<2 do wait()ad(12)end ah=ah-1
|
||||||
local ak,al=aj/ai,(ah*J.AbsoluteSize.Y)local am=al*ak if j==f then m=U-am elseif
|
end local aj aj=function()if W then return end W=true wait(0.6)ah=ah+1 while W
|
||||||
j==g then n=U-am end end E.Handle.MouseButton1Down:connect(function(ae,af)S=
|
and ah<2 do wait()ad(-12)end ah=ah-1 end c.Body.ScrollBar.Up.MouseButton1Click:
|
||||||
Vector2.new(ae,af)T=E.Handle.AbsolutePosition if j==f then U=m elseif j==g then
|
connect(function()return ad(10)end)c.Body.ScrollBar.Up.MouseButton1Down:connect(
|
||||||
U=n end end)E.Handle.MouseButton1Up:connect(function(ae,af)clean()end)
|
function()ad(10)return ai()end)c.Body.ScrollBar.Up.MouseButton1Up:connect(X)c.
|
||||||
local function existsInsideContainer(af,ag,ah)local ai,aj=af.AbsolutePosition,af
|
Body.ScrollBar.Down.MouseButton1Down:connect(function()ad(-10)return aj()end)c.
|
||||||
.AbsoluteSize if ag<ai.X or ag>ai.X+aj.X or ah<ai.y or ah>ai.y+aj.y then return
|
Body.ScrollBar.Down.MouseButton1Up:connect(X)local ak ak=function(al,am)if not T
|
||||||
false end return true end function repositionList()if j==f then m=math.min(math.
|
then return end local an,ao,ap=(Vector2.new(al,am-T)).Y,1-(c.Body.TextBox.
|
||||||
max(m,0),t-c.Body.TextBox.AbsoluteSize.Y)J.Size=UDim2.new(1,0,0,t)elseif j==g
|
AbsoluteSize.Y/K.AbsoluteSize.Y),F.AbsoluteSize.Y-F.Handle.AbsoluteSize.Y local
|
||||||
then n=math.min(math.max(n,0),t-c.Body.TextBox.AbsoluteSize.Y)J.Size=UDim2.new(1
|
aq=math.max(math.min(an,ap),0-ap)local ar,as=aq/ap,(ao*K.AbsoluteSize.Y)local at
|
||||||
,0,0,t)end local af=c.Body.TextBox.AbsoluteSize.Y/J.AbsoluteSize.Y if af>=1 then
|
=as*ar if k==g then n=U-at elseif k==h then o=U-at end end F.Handle.
|
||||||
c.Body.ScrollBar.Visible=false c.Body.TextBox.Size=UDim2.new(1,-4,1,-28)if j==f
|
MouseButton1Down:connect(function(al,am)T=Vector2.new(al,am)if k==g then U=n
|
||||||
or j==g then J.Position=UDim2.new(0,0,1,0-t)end else c.Body.ScrollBar.Visible=
|
elseif k==h then U=o end end)F.Handle.MouseButton1Up:connect(X)local al al=
|
||||||
true c.Body.TextBox.Size=UDim2.new(1,-25,1,-28)local ag,ah=1-af,nil if j==f then
|
function(am,an,ao)local ap,aq=am.AbsolutePosition,am.AbsoluteSize if an<ap.X or
|
||||||
ah=m/J.AbsoluteSize.Y elseif j==g then ah=n/J.AbsoluteSize.Y end local ai,aj=
|
an>ap.X+aq.X or ao<ap.y or ao>ap.y+aq.y then return false end return true end
|
||||||
math.max(0,ag-ah),math.max(E.AbsoluteSize.Y*af,21)local ak=aj/E.AbsoluteSize.Y
|
local am am=function(an)if an<10 then return'0'..tostring(an)else return an end
|
||||||
local al=(1-ak)/(1-af)local am=ai*al local an=math.min(E.AbsoluteSize.Y*am,E.
|
end local an,ao='%s:%s:%s',nil ao=function(ap)local aq=ap-os.time()+math.floor(
|
||||||
AbsoluteSize.Y-aj)E.Handle.Size=UDim2.new(1,0,0,aj)E.Handle.Position=UDim2.new(0
|
tick())local ar=aq%86400 local as=math.floor(ar/3600)ar=ar-(as*3600)local at=
|
||||||
,0,0,an)if j==f then J.Position=UDim2.new(0,0,1,0-t+m)elseif j==g then J.
|
math.floor(ar/60)ar=ar-(at*60)local au,av,aw=am(as),am(at),am(ar)return an:
|
||||||
Position=UDim2.new(0,0,1,0-t+n)end end end local function numberWithZero(af)
|
format(au,av,aw)end y.ErrorToggleButton.MouseButton1Down:connect(function()p=not
|
||||||
return(af<10 and'0'or'')..af end local af='%s:%s:%s'function ConvertTimeStamp(ag
|
p y.ErrorToggleButton.CheckFrame.Visible=p ag()return ac()end)y.
|
||||||
)local ah=ag-os.time()+math.floor(tick())local ai=ah%86400 local aj=math.floor(
|
WarningToggleButton.MouseButton1Down:connect(function()q=not q y.
|
||||||
ai/3600)ai=ai-(aj*3600)local ak=math.floor(ai/60)ai=ai-(ak*60)local al,am,an=
|
WarningToggleButton.CheckFrame.Visible=q ag()return ac()end)y.InfoToggleButton.
|
||||||
numberWithZero(aj),numberWithZero(ak),numberWithZero(ai)return af:format(al,am,
|
MouseButton1Down:connect(function()r=not r y.InfoToggleButton.CheckFrame.Visible
|
||||||
an)end x.ErrorToggleButton.MouseButton1Down:connect(function(ag,ah)o=not o x.
|
=r ag()return ac()end)y.OutputToggleButton.MouseButton1Down:connect(function()s=
|
||||||
ErrorToggleButton.CheckFrame.Visible=o refreshTextHolder()repositionList()end)x.
|
not s y.OutputToggleButton.CheckFrame.Visible=s ag()return ac()end)y.
|
||||||
WarningToggleButton.MouseButton1Down:connect(function(ah,ai)p=not p x.
|
WordWrapToggleButton.MouseButton1Down:connect(function()t=not t y.
|
||||||
WarningToggleButton.CheckFrame.Visible=p refreshTextHolder()repositionList()end)
|
WordWrapToggleButton.CheckFrame.Visible=t ag()return ac()end)local ap ap=
|
||||||
x.InfoToggleButton.MouseButton1Down:connect(function(ai,aj)q=not q x.
|
function(aq,ar,as)l[#l+1]={Message=aq,Time=ao(as),Type=ar}while#l>i do table.
|
||||||
InfoToggleButton.CheckFrame.Visible=q refreshTextHolder()repositionList()end)x.
|
remove(l,1)end ag()return ac()end local aq aq=function(ar,as,at)m[#m+1]={Message
|
||||||
OutputToggleButton.MouseButton1Down:connect(function(aj,ak)r=not r x.
|
=ar,Time=ao(at),Type=as}while#m>i do table.remove(m,1)end ag()return ac()end c.
|
||||||
OutputToggleButton.CheckFrame.Visible=r refreshTextHolder()repositionList()end)x
|
Body.LocalConsole.MouseButton1Click:connect(function()if k==h then k=g local ar,
|
||||||
.WordWrapToggleButton.MouseButton1Down:connect(function(ak,al)s=not s x.
|
as=c.Body.LocalConsole,c.Body.ServerConsole ar.Size=UDim2.new(0,90,0,20)as.Size=
|
||||||
WordWrapToggleButton.CheckFrame.Visible=s refreshTextHolder()repositionList()end
|
UDim2.new(0,90,0,17)ar.BackgroundTransparency=0.6 as.BackgroundTransparency=0.8
|
||||||
)function AddLocalMessage(al,am,an)k[#k+1]={Message=al,Time=ConvertTimeStamp(an)
|
if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local at=game
|
||||||
,Type=am}while#k>h do table.remove(k,1)end refreshTextHolder()repositionList()
|
.Players.LocalPlayer:GetMouse()Y(at.X,at.Y)aa(at.X,at.Y)ak(at.X,at.Y)end ag()
|
||||||
end function AddServerMessage(al,am,an)l[#l+1]={Message=al,Time=
|
return ac()end end)c.Body.LocalConsole.MouseButton1Up:connect(X)local ar=false c
|
||||||
ConvertTimeStamp(an),Type=am}while#l>h do table.remove(l,1)end
|
.Body.ServerConsole.MouseButton1Click:connect(function()if not ar then ar=true
|
||||||
refreshTextHolder()repositionList()end c.Body.LocalConsole.MouseButton1Click:
|
game:GetService'LogService':RequestServerOutput()end if k==g then k=h local as,
|
||||||
connect(function(al,am)if j==g then j=f local an,ao=c.Body.LocalConsole,c.Body.
|
at=c.Body.LocalConsole,c.Body.ServerConsole at.Size=UDim2.new(0,90,0,20)as.Size=
|
||||||
ServerConsole an.Size=UDim2.new(0,90,0,20)ao.Size=UDim2.new(0,90,0,17)an.
|
UDim2.new(0,90,0,17)at.BackgroundTransparency=0.6 as.BackgroundTransparency=0.8
|
||||||
BackgroundTransparency=0.6 ao.BackgroundTransparency=0.8 if game:FindFirstChild
|
if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local au=game
|
||||||
'Players'and game.Players['LocalPlayer']then local ap=game.Players.LocalPlayer:
|
.Players.LocalPlayer:GetMouse()Y(au.X,au.Y)aa(au.X,au.Y)ak(au.X,au.Y)end ag()
|
||||||
GetMouse()refreshConsolePosition(ap.X,ap.Y)refreshConsoleSize(ap.X,ap.Y)
|
return ac()end end)c.Body.ServerConsole.MouseButton1Up:connect(X)if game:
|
||||||
handleScroll(ap.X,ap.Y)end refreshTextHolder()repositionList()end end)c.Body.
|
FindFirstChild'Players'and game.Players['LocalPlayer']then local as=game.Players
|
||||||
LocalConsole.MouseButton1Up:connect(function()clean()end)local am=false c.Body.
|
.LocalPlayer:GetMouse()as.Move:connect(function()if not c.Visible then return
|
||||||
ServerConsole.MouseButton1Click:connect(function(an,ao)if not am then am=true
|
end local at=game.Players.LocalPlayer:GetMouse()Y(at.X,at.Y)aa(at.X,at.Y)ak(at.X
|
||||||
game:GetService'LogService':RequestServerOutput()end if j==f then j=g local ap,
|
,at.Y)ag()return ac()end)as.Button1Up:connect(X)as.WheelForward:connect(function
|
||||||
aq=c.Body.LocalConsole,c.Body.ServerConsole aq.Size=UDim2.new(0,90,0,20)ap.Size=
|
()if not c.Visible then return end if al(c,as.X,as.Y)then return ad(10)end end)
|
||||||
UDim2.new(0,90,0,17)aq.BackgroundTransparency=0.6 ap.BackgroundTransparency=0.8
|
as.WheelBackward:connect(function()if not c.Visible then return end if al(c,as.X
|
||||||
if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local ar=game
|
,as.Y)then return ad(-10)end end)end F.Handle.MouseButton1Down:connect(function(
|
||||||
.Players.LocalPlayer:GetMouse()refreshConsolePosition(ar.X,ar.Y)
|
)return ac()end)local as=game:GetService'LogService':GetLogHistory()for at=1,#as
|
||||||
refreshConsoleSize(ar.X,ar.Y)handleScroll(ar.X,ar.Y)end refreshTextHolder()
|
do ap(as[at].message,as[at].messageType,as[at].timestamp)end local at=game:
|
||||||
repositionList()end end)c.Body.ServerConsole.MouseButton1Up:connect(function()
|
GetService'LogService'at.MessageOut:connect(function(au,av)return ap(au,av,os.
|
||||||
clean()end)if game:FindFirstChild'Players'and game.Players['LocalPlayer']then
|
time())end)at.ServerMessageOut:connect(aq)return at end local aa=false d.
|
||||||
local ao=game.Players.LocalPlayer:GetMouse()ao.Move:connect(function()if not c.
|
OnInvoke=function()if aa then return end aa=true f()c.Visible=not c.Visible aa=
|
||||||
Visible then return end local ap=game.Players.LocalPlayer:GetMouse()
|
false end
|
||||||
refreshConsolePosition(ap.X,ap.Y)refreshConsoleSize(ap.X,ap.Y)handleScroll(ap.X,
|
|
||||||
ap.Y)refreshTextHolder()repositionList()end)ao.Button1Up:connect(function()
|
|
||||||
clean()end)ao.WheelForward:connect(function()if not c.Visible then return end if
|
|
||||||
existsInsideContainer(c,ao.X,ao.Y)then changeOffset(10)end end)ao.WheelBackward:
|
|
||||||
connect(function()if not c.Visible then return end if existsInsideContainer(c,ao
|
|
||||||
.X,ao.Y)then changeOffset(-10)end end)end E.Handle.MouseButton1Down:connect(
|
|
||||||
function()repositionList()end)local ao=game:GetService'LogService':
|
|
||||||
GetLogHistory()for ap=1,#ao do AddLocalMessage(ao[ap].message,ao[ap].messageType
|
|
||||||
,ao[ap].timestamp)end game:GetService'LogService'.MessageOut:connect(function(ap
|
|
||||||
,aq)AddLocalMessage(ap,aq,os.time())end)game:GetService'LogService'.
|
|
||||||
ServerMessageOut:connect(AddServerMessage)end local aa=false function d.OnInvoke
|
|
||||||
()if aa then return end aa=true initializeDeveloperConsole()c.Visible=not c.
|
|
||||||
Visible aa=false end
|
|
||||||
|
|
@ -1,25 +1,27 @@
|
||||||
local a=script.Parent:FindFirstChild'ControlFrame'if not a then return end local
|
local a=script.Parent:FindFirstChild'ControlFrame'if not a then return end local
|
||||||
b,c,d=a:FindFirstChild'BottomLeftControl',a:FindFirstChild'BottomRightControl',
|
b b=function(c,d,e)if not(e~=nil)then e=d d=nil end local f=Instance.new(c)if d
|
||||||
Instance.new'TextLabel'd.Name='ToolTip'd.Text=''d.Font=Enum.Font.ArialBold d.
|
then f.Name=d end local g for h,i in pairs(e)do if type(h)=='string'then if h==
|
||||||
FontSize=Enum.FontSize.Size12 d.TextColor3=Color3.new(1,1,1)d.BorderSizePixel=0
|
'Parent'then g=i else f[h]=i end elseif type(h)=='number'and type(i)=='userdata'
|
||||||
d.ZIndex=10 d.Size=UDim2.new(2,0,1,0)d.Position=UDim2.new(1,0,0,0)d.
|
then i.Parent=f end end f.Parent=g return f end local c,d,e,f=a:FindFirstChild
|
||||||
BackgroundColor3=Color3.new(0,0,0)d.BackgroundTransparency=1 d.TextTransparency=
|
'BottomLeftControl',a:FindFirstChild'BottomRightControl',b('TextLabel','ToolTip'
|
||||||
1 d.TextWrap=true local e=Instance.new'BoolValue'e.Name='inside'e.Value=false e.
|
,{Text='',Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size12,TextColor3=
|
||||||
Parent=d function setUpListeners(f)local g=0.1 f.Parent.MouseEnter:connect(
|
Color3.new(1,1,1),BorderSizePixel=0,ZIndex=10,Size=UDim2.new(2,0,1,0),Position=
|
||||||
function()if f:FindFirstChild'inside'then f.inside.Value=true wait(1.2)if f.
|
UDim2.new(1,0,0,0),BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,
|
||||||
inside.Value then while f.inside.Value and f.BackgroundTransparency>0 do f.
|
TextTransparency=1,TextWrap=true,b('BoolValue','inside',{Value=false})}),nil f=
|
||||||
BackgroundTransparency=f.BackgroundTransparency-g f.TextTransparency=f.
|
function(g)local h=0.1 g.Parent.MouseEnter:connect(function()if g:FindFirstChild
|
||||||
TextTransparency-g wait()end end end end)function killTip(h)h.inside.Value=false
|
'inside'then g.inside.Value=true wait(1.2)if g.inside.Value then while g.inside.
|
||||||
h.BackgroundTransparency=1 h.TextTransparency=1 end f.Parent.MouseLeave:connect(
|
Value and g.BackgroundTransparency>0 do g.BackgroundTransparency=g.
|
||||||
function()killTip(f)end)f.Parent.MouseButton1Click:connect(function()killTip(f)
|
BackgroundTransparency-h g.TextTransparency=g.TextTransparency-h wait()end end
|
||||||
end)end function createSettingsButtonTip(f)if f==nil then f=b:FindFirstChild
|
end end)local i i=function(j)j.inside.Value=false j.BackgroundTransparency=1 j.
|
||||||
'SettingsButton'end local g=d:clone()g.RobloxLocked=true g.Text=
|
TextTransparency=1 end g.Parent.MouseLeave:connect(function()return i(g)end)
|
||||||
'Settings/Leave Game'g.Position=UDim2.new(0,0,0,-18)g.Size=UDim2.new(0,120,0,20)
|
return g.Parent.MouseButton1Click:connect(function()return i(g)end)end local g g
|
||||||
g.Parent=f setUpListeners(g)end wait(5)local f=b:GetChildren()for g=1,#f do if f
|
=function(h)if not(h~=nil)then h=c:FindFirstChild'SettingsButton'end local i=e:
|
||||||
[g].Name=='Exit'then local h=d:clone()h.RobloxLocked=true h.Text='Leave Place'h.
|
clone()i.RobloxLocked=true i.Text='Settings/Leave Game'i.Position=UDim2.new(0,0,
|
||||||
Position=UDim2.new(0,0,-1,0)h.Size=UDim2.new(1,0,1,0)h.Parent=f[g]
|
0,-18)i.Size=UDim2.new(0,120,0,20)i.Parent=h f(i)return i end wait(5)local h=c:
|
||||||
setUpListeners(h)elseif f[g].Name=='SettingsButton'then createSettingsButtonTip(
|
GetChildren()for i=1,#h do if h[i].Name=='Exit'then do local j=e:clone()j.
|
||||||
f[g])end end local g=c:GetChildren()for h=1,#g do if g[h].Name:find'Camera'~=nil
|
RobloxLocked=true j.Text='Leave Place'j.Position=UDim2.new(0,0,-1,0)j.Size=UDim2
|
||||||
then local i=d:clone()i.RobloxLocked=true i.Text='Camera View'if g[h].Name:find
|
.new(1,0,1,0)j.Parent=h[i]f(j)end elseif h[i].Name=='SettingsButton'then g(h[i])
|
||||||
'Zoom'then i.Position=UDim2.new(-1,0,-1.5)else i.Position=UDim2.new(0,0,-1.5,0)
|
end end local i=d:GetChildren()for j=1,#i do if(i[j].Name:find'Camera'~=nil)then
|
||||||
end i.Size=UDim2.new(2,0,1.25,0)i.Parent=g[h]setUpListeners(i)end end
|
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
|
||||||
|
|
@ -1,35 +1,33 @@
|
||||||
local a,b=game:GetService'ScriptContext',false pcall(function()b=game:GetService
|
local a,b=game:GetService'ScriptContext',false pcall(function()b=game:GetService
|
||||||
'UserInputService'.TouchEnabled end)a:AddCoreScript(60595695,a,
|
'UserInputService'.TouchEnabled end)a:AddCoreScript(60595695,a,
|
||||||
'/Libraries/LibraryRegistration/LibraryRegistration')local function waitForChild
|
'/Libraries/LibraryRegistration/LibraryRegistration')local c c=function(d,e)
|
||||||
(c,d)while not c:FindFirstChild(d)do c.ChildAdded:wait()end end local c=game:
|
while not d:FindFirstChild(e)do d.ChildAdded:wait()end end a=game:GetService
|
||||||
GetService'ScriptContext'c:AddCoreScript(59002209,c,'CoreScripts/Sections')
|
'ScriptContext'a:AddCoreScript(59002209,a,'CoreScripts/Sections')c(game:
|
||||||
waitForChild(game:GetService'CoreGui','RobloxGui')local d=game:GetService
|
GetService'CoreGui','RobloxGui')local d=game:GetService'CoreGui':FindFirstChild
|
||||||
'CoreGui':FindFirstChild'RobloxGui'if not b then c:AddCoreScript(36868950,d,
|
'RobloxGui'if not b then a:AddCoreScript(36868950,d,'CoreScripts/ToolTip')a:
|
||||||
'CoreScripts/ToolTip')c:AddCoreScript(46295863,d,'CoreScripts/Settings')else c:
|
AddCoreScript(46295863,d,'CoreScripts/Settings')else a:AddCoreScript(153556783,d
|
||||||
AddCoreScript(153556783,d,'CoreScripts/TouchControls')end c:AddCoreScript(
|
,'CoreScripts/TouchControls')end a:AddCoreScript(39250920,d,
|
||||||
39250920,d,'CoreScripts/MainBotChatScript')c:AddCoreScript(48488451,d,
|
'CoreScripts/MainBotChatScript')a:AddCoreScript(48488451,d,
|
||||||
'CoreScripts/PopupScript')c:AddCoreScript(48488398,d,
|
'CoreScripts/PopupScript')a:AddCoreScript(48488398,d,
|
||||||
'CoreScripts/NotificationScript')c:AddCoreScript(97188756,d,
|
'CoreScripts/NotificationScript')a:AddCoreScript(97188756,d,
|
||||||
'CoreScripts/ChatScript')c:AddCoreScript(107893730,d,
|
'CoreScripts/ChatScript')a:AddCoreScript(107893730,d,
|
||||||
'CoreScripts/PurchasePromptScript')if not b or d.AbsoluteSize.Y>600 then c:
|
'CoreScripts/PurchasePromptScript')if not b or d.AbsoluteSize.Y>600 then a:
|
||||||
AddCoreScript(48488235,d,'CoreScripts/PlayerListScript')else delay(5,function()
|
AddCoreScript(48488235,d,'CoreScripts/PlayerListScript')else delay(5,function()
|
||||||
if d.AbsoluteSize.Y>=600 then c:AddCoreScript(48488235,d,
|
if d.AbsoluteSize.Y>=600 then return a:AddCoreScript(48488235,d,
|
||||||
'CoreScripts/PlayerListScript')end end)end if game.CoreGui.Version>=3 and game.
|
'CoreScripts/PlayerListScript')end end)end if game.CoreGui.Version>=3 and game.
|
||||||
PlaceId~=130815926 then c:AddCoreScript(53878047,d,
|
PlaceId~=130815926 then a:AddCoreScript(53878047,d,
|
||||||
'CoreScripts/BackpackScripts/BackpackBuilder')waitForChild(d,'CurrentLoadout')
|
'CoreScripts/BackpackScripts/BackpackBuilder')c(d,'CurrentLoadout')c(d,
|
||||||
waitForChild(d,'Backpack')local e=d.Backpack if game.CoreGui.Version>=7 then c:
|
'Backpack')local e=d.Backpack if game.CoreGui.Version>=7 then a:AddCoreScript(
|
||||||
AddCoreScript(89449093,e,'CoreScripts/BackpackScripts/BackpackManager')end game:
|
89449093,e,'CoreScripts/BackpackScripts/BackpackManager')end a:AddCoreScript(
|
||||||
GetService'ScriptContext':AddCoreScript(89449008,e,
|
89449008,e,'CoreScripts/BackpackScripts/BackpackGear')a:AddCoreScript(53878057,d
|
||||||
'CoreScripts/BackpackScripts/BackpackGear')c:AddCoreScript(53878057,d.
|
.CurrentLoadout,'CoreScripts/BackpackScripts/LoadoutScript')if game.CoreGui.
|
||||||
CurrentLoadout,'CoreScripts/BackpackScripts/LoadoutScript')if game.CoreGui.
|
Version>=8 then a:AddCoreScript(-1,e,
|
||||||
Version>=8 then c:AddCoreScript(-1,e,
|
|
||||||
'CoreScripts/BackpackScripts/BackpackWardrobe')end end local e=not not game.
|
'CoreScripts/BackpackScripts/BackpackWardrobe')end end local e=not not game.
|
||||||
Workspace:FindFirstChild'PSVariable'if e then game:GetService'ScriptContext':
|
Workspace:FindFirstChild'PSVariable'if e then a:AddCoreScript(64164692,game.
|
||||||
AddCoreScript(64164692,game.Players.LocalPlayer,'BuildToolManager')end game.
|
Players.LocalPlayer,'BuildToolManager')end game.Workspace.ChildAdded:connect(
|
||||||
Workspace.ChildAdded:connect(function(f)if f.Name=='PSVariable'and f:IsA
|
function(f)if f.Name=='PSVariable'and f:IsA'BoolValue'then e=true return a:
|
||||||
'BoolValue'then e=true game:GetService'ScriptContext':AddCoreScript(64164692,
|
AddCoreScript(64164692,game.Players.LocalPlayer,'BuildToolManager')end end)if b
|
||||||
game.Players.LocalPlayer,'BuildToolManager')end end)if b then c:AddCoreScript(
|
then a:AddCoreScript(152908679,d,'CoreScripts/ContextActionTouch')c(d,
|
||||||
152908679,d,'CoreScripts/ContextActionTouch')waitForChild(d,'ControlFrame')
|
'ControlFrame')c(d.ControlFrame,'BottomLeftControl')d.ControlFrame.
|
||||||
waitForChild(d.ControlFrame,'BottomLeftControl')d.ControlFrame.BottomLeftControl
|
BottomLeftControl.Visible=false c(d.ControlFrame,'TopLeftControl')d.ControlFrame
|
||||||
.Visible=false waitForChild(d.ControlFrame,'TopLeftControl')d.ControlFrame.
|
.TopLeftControl.Visible=false end
|
||||||
TopLeftControl.Visible=false end
|
|
||||||
|
|
@ -1,48 +1,49 @@
|
||||||
local a,b=5,5 function waitForChild(c,d)local e=c:findFirstChild(d)if e then
|
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||||
return e end while true do e=c.ChildAdded:wait()if e.Name==d then return e end
|
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||||
end end local c=script.Parent local d,e,f,g=waitForChild(c,'Humanoid'),
|
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||||
waitForChild(c,'Torso'),c:FindFirstChild'PlayerStats',Instance.new'BoolValue'g.
|
'userdata'then h.Parent=e end end e.Parent=f return e end local b,c,d=5,5,nil d=
|
||||||
Name='InCharTag'local h=Instance.new'BoolValue'h.Name='RobloxBuildTool'local i,j
|
function(e,f)local g=e:findFirstChild(f)if g then return g end while true do g=e
|
||||||
if f==nil then f=Instance.new'Configuration'f.Parent=c f.Name='PlayerStats'end
|
.ChildAdded:wait()if g.Name==f then return g end end end local e=script.Parent
|
||||||
local k=f:FindFirstChild'MaxHealth'if k==nil then k=Instance.new'NumberValue'k.
|
local f,g,h,i=d(e,'Humanoid'),d(e,'Torso'),e:FindFirstChild'PlayerStats',
|
||||||
Parent=f k.Value=100 k.Name='MaxHealth'end d.MaxHealth=k.Value d.Health=k.Value
|
Instance.new'BoolValue'i.Name='InCharTag'local j=Instance.new'BoolValue'j.Name=
|
||||||
function onMaxHealthChange()d.MaxHealth=k.Value d.Health=k.Value end k.Changed:
|
'RobloxBuildTool'if not(h~=nil)then h=a('Configuration','PlayerStats',{Parent=e}
|
||||||
connect(onMaxHealthChange)local l=game.Players:GetPlayerFromCharacter(script.
|
)end local k=h:FindFirstChild'MaxHealth'if not(k~=nil)then k=a('NumberValue',
|
||||||
Parent)local m=l.PlayerGui:FindFirstChild'DamageOverTimeGui'if m==nil then m=
|
'MaxHealth',{Value=100,Parent=h})end f.MaxHealth=k.Value f.Health=k.Value local
|
||||||
Instance.new'BillboardGui'm.Name='DamageOverTimeGui'm.Parent=l.PlayerGui m.
|
l l=function()f.MaxHealth=k.Value f.Health=k.Value end k.Changed:connect(l)local
|
||||||
Adornee=script.Parent:FindFirstChild'Head'm.Active=true m.size=UDim2.new(a,0,b,0
|
m=game.Players:GetPlayerFromCharacter(script.Parent)local n=m.PlayerGui:
|
||||||
)m.StudsOffset=Vector3.new(0,2,0)end print'newHealth declarations finished'
|
FindFirstChild'DamageOverTimeGui'if not(n~=nil)then n=a('BillboardGui',
|
||||||
function billboardHealthChange(n)local o=Instance.new'TextLabel'if n>0 then o.
|
'DamageOverTimeGui',{Parent=m.PlayerGui,Adornee=script.Parent:FindFirstChild
|
||||||
Text=tostring(n)o.TextColor3=Color3.new(0,1,0)else o.Text=tostring(n)o.
|
'Head',Active=true,size=UDim2.new(b,0,c,0),StudsOffset=Vector3.new(0,2,0)})end
|
||||||
TextColor3=Color3.new(1,0,1)end o.size=UDim2.new(1,0,1,0)o.Active=true o.
|
print'newHealth declarations finished'local o o=function(p)local q=a('TextLabel'
|
||||||
FontSize=6 o.BackgroundTransparency=1 o.Parent=m for p=1,10 do wait(0.1)o.
|
,{Text=tostring(p),TextColor3=(function()if p>0 then return Color3.new(0,1,0)
|
||||||
TextTransparency=p/10 o.Position=UDim2.new(0,0,0,-p*5)o.FontSize=6-p*0.6 end o:
|
else return Color3.new(1,0,1)end end)(),size=UDim2.new(1,0,1,0),Active=true,
|
||||||
remove()end function setMaxHealth()if k.Value>=0 then d.MaxHealth=k.Value print(
|
FontSize=6,BackgroundTransparency=1,Parent=n})for r=1,10 do wait(0.1)q.
|
||||||
d.MaxHealth)if d.Health>d.MaxHealth then d.Health=d.MaxHealth end end end k.
|
TextTransparency=r/10 q.Position=UDim2.new(0,0,0,-r*5)q.FontSize=6-r*0.6 end
|
||||||
Changed:connect(setMaxHealth)local n=Instance.new'Fire'n.Heat=0.1 n.Size=3 n.
|
return q:remove()end local p p=function()if k.Value>=0 then f.MaxHealth=k.Value
|
||||||
Name='FireEffect'n.Enabled=false while true do local o,p=wait(1),d.Health if p>0
|
print(f.MaxHealth)if f.Health>f.MaxHealth then f.Health=f.MaxHealth end end end
|
||||||
then local q=0 if f then local r,s,t,u,v=f:FindFirstChild'Regen',f:
|
k.Changed:connect(p)local q=a('Fire','FireEffect',{Heat=0.1,Size=3,Enabled=false
|
||||||
FindFirstChild'Poison',f:FindFirstChild'Ice',f:FindFirstChild'Fire',f:
|
})while true do local r,s=wait(1),f.Health if s>0 then local t=0 if h then local
|
||||||
FindFirstChild'Stun'if r then q=q+r.Value.X if r.Value.Y>=0 then r.Value=Vector3
|
u,v,w,x,y=h:FindFirstChild'Regen',h:FindFirstChild'Poison',h:FindFirstChild'Ice'
|
||||||
.new(r.Value.X+r.Value.Z,r.Value.Y-o,r.Value.Z)elseif r.Value.Y==-1 then r.Value
|
,h:FindFirstChild'Fire',h:FindFirstChild'Stun'if u then t=t+u.Value.X if u.Value
|
||||||
=Vector3.new(r.Value.X+r.Value.Z,-1,r.Value.Z)else r:remove()end end if s then q
|
.Y>=0 then u.Value=Vector3.new(u.Value.X+u.Value.Z,u.Value.Y-r,u.Value.Z)elseif
|
||||||
=q-s.Value.X if s.Value.Y>=0 then s.Value=Vector3.new(s.Value.X+s.Value.Z,s.
|
u.Value.Y==-1 then u.Value=Vector3.new(u.Value.X+u.Value.Z,-1,u.Value.Z)else u:
|
||||||
Value.Y-o,s.Value.Z)elseif s.Value.Y==-1 then s.Value=Vector3.new(s.Value.X+s.
|
remove()end end if v then t=t-v.Value.X if v.Value.Y>=0 then v.Value=Vector3.
|
||||||
Value.Z,-1,s.Value.Z)else s:remove()end end if t then q=q-t.Value.X if t.Value.Y
|
new(v.Value.X+v.Value.Z,v.Value.Y-r,v.Value.Z)elseif v.Value.Y==-1 then v.Value=
|
||||||
>=0 then t.Value=Vector3.new(t.Value.X,t.Value.Y-o,t.Value.Z)else t:remove()end
|
Vector3.new(v.Value.X+v.Value.Z,-1,v.Value.Z)else v:remove()end end if w then t=
|
||||||
end if u then n.Enabled=true n.Parent=c.Torso q=q-u.Value.X if u.Value.Y>=0 then
|
t-w.Value.X if w.Value.Y>=0 then w.Value=Vector3.new(w.Value.X,w.Value.Y-r,w.
|
||||||
u.Value=Vector3.new(u.Value.X,u.Value.Y-o,u.Value.Z)else u:remove()n.Enabled=
|
Value.Z)else w:remove()end end if x then q.Enabled=true q.Parent=e.Torso t=t-x.
|
||||||
false n.Parent=nil end end if v then if v.Value>0 then e.Anchored=true i=script.
|
Value.X if x.Value.Y>=0 then x.Value=Vector3.new(x.Value.X,x.Value.Y-r,x.Value.Z
|
||||||
Parent:GetChildren()j=game.Players:GetPlayerFromCharacter(script.Parent).
|
)else x:remove()q.Enabled=false q.Parent=nil end end if y then local z if y.
|
||||||
Backpack:GetChildren()for w=1,#i do if i[w].className=='Tool'then g:Clone().
|
Value>0 then g.Anchored=true local A=script.Parent:GetChildren()z=game.Players:
|
||||||
Parent=i[w]print(j)table.insert(j,i[w])end end for w=1,#j do if j[w]:
|
GetPlayerFromCharacter(script.Parent).Backpack:GetChildren()for B=1,#A do if A[B
|
||||||
FindFirstChild'RobloxBuildTool'==nil then h:Clone().Parent=j[w]j[w].Parent=game.
|
].className=='Tool'then i:Clone().Parent=A[B]print(z)table.insert(z,A[B])end end
|
||||||
Lighting end end wait(0.2)for w=1,#j do j[w].Parent=game.Players:
|
for B=1,#z do if not(z[B]:FindFirstChild'RobloxBuildTool'~=nil)then j:Clone().
|
||||||
GetPlayerFromCharacter(script.Parent).Backpack end v.Value=v.Value-o else e.
|
Parent=z[B]z[B].Parent=game.Lighting end end wait(0.2)for B=1,#z do z[B].Parent=
|
||||||
Anchored=false for w=1,#j do local x=j[w]:FindFirstChild'RobloxBuildTool'if x
|
game.Players:GetPlayerFromCharacter(script.Parent).Backpack end y.Value=y.Value-
|
||||||
then x:Remove()end j[w].Parent=game.Lighting end wait(0.2)for w=1,#j do local x=
|
r else g.Anchored=false for A=1,#z do local B=z[A]:FindFirstChild
|
||||||
j[w]:FindFirstChild'InCharTag'if x then x:Remove()j[w].Parent=script.Parent else
|
'RobloxBuildTool'if B then B:Remove()end z[A].Parent=game.Lighting end wait(0.2)
|
||||||
j[w].Parent=game.Players:GetPlayerFromCharacter(script.Parent).Backpack end end
|
for A=1,#z do local B=z[A]:FindFirstChild'InCharTag'if B then B:Remove()z[A].
|
||||||
v:Remove()end end if q~=0 then coroutine.resume(coroutine.create(
|
Parent=script.Parent else z[A].Parent=game.Players:GetPlayerFromCharacter(script
|
||||||
billboardHealthChange),q)end end p=d.Health+q*o if p*1.01<d.MaxHealth then d.
|
.Parent).Backpack end end y:Remove()end end if t~=0 then coroutine.resume(
|
||||||
Health=p elseif q>0 then d.Health=d.MaxHealth end end end
|
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
|
||||||
|
|
@ -1,142 +1,131 @@
|
||||||
function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end function
|
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||||
waitForChild(a,b)while not a:FindFirstChild(b)do a.ChildAdded:wait()end end
|
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||||
local a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=nil,{},nil,{},nil,nil,nil,
|
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||||
'You are too far away to chat!',300,'Chat ended because you walked away',350,
|
'userdata'then h.Parent=e end end e.Parent=f return e end local b b=function(c,d
|
||||||
"Chat ended because you didn't reply",350,nil,nil,nil,nil,nil,{},{},nil
|
)while not c[d]do c.Changed:wait()end end local c c=function(d,e)while not d:
|
||||||
waitForChild(game,'CoreGui')waitForChild(game.CoreGui,'RobloxGui')if game.
|
FindFirstChild(e)do d.ChildAdded:wait()end end local d,e,f,g,h,i,j,k,l,m,n,o,p,q
|
||||||
CoreGui.RobloxGui:FindFirstChild'ControlFrame'then u=game.CoreGui.RobloxGui.
|
,r,s,t,u,v,w,x=nil,{},nil,{},nil,nil,nil,'You are too far away to chat!',300,
|
||||||
ControlFrame else u=game.CoreGui.RobloxGui end function currentTone()if e then
|
'Chat ended because you walked away',350,"Chat ended because you didn't reply",
|
||||||
return e.Tone else return Enum.DialogTone.Neutral end end function
|
350,nil,nil,nil,nil,nil,{},{},nil c(game,'CoreGui')c(game.CoreGui,'RobloxGui')if
|
||||||
createChatNotificationGui()o=Instance.new'BillboardGui'o.Name=
|
game.CoreGui.RobloxGui:FindFirstChild'ControlFrame'then x=game.CoreGui.RobloxGui
|
||||||
'ChatNotificationGui'o.ExtentsOffset=Vector3.new(0,1,0)o.Size=UDim2.new(4,0,
|
.ControlFrame else x=game.CoreGui.RobloxGui end local y y=function()if h then
|
||||||
5.42857122,0)o.SizeOffset=Vector2.new(0,0)o.StudsOffset=Vector3.new(0.4,4.3,0)o.
|
return h.Tone else return Enum.DialogTone.Neutral end end local z z=function()r=
|
||||||
Enabled=true o.RobloxLocked=true o.Active=true local v=Instance.new'ImageLabel'v
|
a('BillboardGui','ChatNotificationGui',{ExtentsOffset=Vector3.new(0,1,0),Size=
|
||||||
.Name='Image'v.Active=false v.BackgroundTransparency=1 v.Position=UDim2.new(0,0,
|
UDim2.new(4,0,5.42857122,0),SizeOffset=Vector2.new(0,0),StudsOffset=Vector3.new(
|
||||||
0,0)v.Size=UDim2.new(1,0,1,0)v.Image=''v.RobloxLocked=true v.Parent=o local w=
|
0.4,4.3,0),Enabled=true,RobloxLocked=true,Active=true,a('ImageLabel','Image',{
|
||||||
Instance.new'ImageButton'w.Name='Button'w.AutoButtonColor=false w.Position=UDim2
|
Active=false,BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.
|
||||||
.new(0.0879999995,0,0.0529999994,0)w.Size=UDim2.new(0.829999983,0,0.460000008,0)
|
new(1,0,1,0),Image='',RobloxLocked=true,a('ImageButton','Button',{
|
||||||
w.Image=''w.BackgroundTransparency=1 w.RobloxLocked=true w.Parent=v end function
|
AutoButtonColor=false,Position=UDim2.new(0.088,0,0.053,0),Size=UDim2.new(0.83,0,
|
||||||
getChatColor(v)if v==Enum.DialogTone.Neutral then return Enum.ChatColor.Blue
|
0.46,0),Image='',BackgroundTransparency=1,RobloxLocked=true})})})end local A A=
|
||||||
elseif v==Enum.DialogTone.Friendly then return Enum.ChatColor.Green elseif v==
|
function(B)if B==Enum.DialogTone.Neutral then return Enum.ChatColor.Blue elseif
|
||||||
Enum.DialogTone.Enemy then return Enum.ChatColor.Red end end function
|
B==Enum.DialogTone.Friendly then return Enum.ChatColor.Green elseif B==Enum.
|
||||||
styleChoices(v)for w,x in pairs(b)do resetColor(x,v)end resetColor(c,v)end
|
DialogTone.Enemy then return Enum.ChatColor.Red end end local B B=function(C,D)
|
||||||
function styleMainFrame(v)if v==Enum.DialogTone.Neutral then a.Style=Enum.
|
if D==Enum.DialogTone.Neutral then C.BackgroundColor3=Color3.new(0,0,
|
||||||
FrameStyle.ChatBlue a.Tail.Image=
|
0.7019607843137254)C.Number.TextColor3=Color3.new(0.17647058823529413,
|
||||||
'rbxasset://textures/chatBubble_botBlue_tailRight.png'elseif v==Enum.DialogTone.
|
0.5568627450980392,0.9607843137254902)elseif D==Enum.DialogTone.Friendly then C.
|
||||||
Friendly then a.Style=Enum.FrameStyle.ChatGreen a.Tail.Image=
|
BackgroundColor3=Color3.new(0,0.30196078431372547,0)C.Number.TextColor3=Color3.
|
||||||
'rbxasset://textures/chatBubble_botGreen_tailRight.png'elseif v==Enum.DialogTone
|
new(0,0.7450980392156863,0)elseif D==Enum.DialogTone.Enemy then C.
|
||||||
.Enemy then a.Style=Enum.FrameStyle.ChatRed a.Tail.Image=
|
BackgroundColor3=Color3.new(0.5490196078431373,0,0)C.Number.TextColor3=Color3.
|
||||||
'rbxasset://textures/chatBubble_botRed_tailRight.png'end styleChoices(v)end
|
new(1,0.34509803921568627,0.30980392156862746)end end local C C=function(D)for E
|
||||||
function setChatNotificationTone(v,w,x)if x==Enum.DialogTone.Neutral then v.
|
,F in pairs(e)do B(F,D)end return B(f,D)end local D D=function(E)if E==Enum.
|
||||||
Image.Image='rbxasset://textures/chatBubble_botBlue_notify_bkg.png'elseif x==
|
DialogTone.Neutral then d.Style=Enum.FrameStyle.ChatBlue d.Tail.Image=
|
||||||
Enum.DialogTone.Friendly then v.Image.Image=
|
'rbxasset://textures/chatBubble_botBlue_tailRight.png'elseif E==Enum.DialogTone.
|
||||||
'rbxasset://textures/chatBubble_botGreen_notify_bkg.png'elseif x==Enum.
|
Friendly then d.Style=Enum.FrameStyle.ChatGreen d.Tail.Image=
|
||||||
DialogTone.Enemy then v.Image.Image=
|
'rbxasset://textures/chatBubble_botGreen_tailRight.png'elseif E==Enum.DialogTone
|
||||||
'rbxasset://textures/chatBubble_botRed_notify_bkg.png'end if w==Enum.
|
.Enemy then d.Style=Enum.FrameStyle.ChatRed d.Tail.Image=
|
||||||
DialogPurpose.Quest then v.Image.Button.Image=
|
'rbxasset://textures/chatBubble_botRed_tailRight.png'end return C(E)end local E
|
||||||
'rbxasset://textures/chatBubble_bot_notify_bang.png'elseif w==Enum.DialogPurpose
|
E=function(F,G,H)if H==Enum.DialogTone.Neutral then F.Image.Image=
|
||||||
.Help then v.Image.Button.Image=
|
'rbxasset://textures/chatBubble_botBlue_notify_bkg.png'elseif H==Enum.DialogTone
|
||||||
'rbxasset://textures/chatBubble_bot_notify_question.png'elseif w==Enum.
|
.Friendly then F.Image.Image=
|
||||||
DialogPurpose.Shop then v.Image.Button.Image=
|
'rbxasset://textures/chatBubble_botGreen_notify_bkg.png'elseif H==Enum.
|
||||||
'rbxasset://textures/chatBubble_bot_notify_money.png'end end function
|
DialogTone.Enemy then F.Image.Image=
|
||||||
createMessageDialog()p=Instance.new'Frame'p.Name='DialogScriptMessage'p.Style=
|
'rbxasset://textures/chatBubble_botRed_notify_bkg.png'end if G==Enum.
|
||||||
Enum.FrameStyle.RobloxRound p.Visible=false local v=Instance.new'TextLabel'v.
|
DialogPurpose.Quest then F.Image.Button.Image=
|
||||||
Name='Text'v.Position=UDim2.new(0,0,0,-1)v.Size=UDim2.new(1,0,1,0)v.FontSize=
|
'rbxasset://textures/chatBubble_bot_notify_bang.png'elseif G==Enum.DialogPurpose
|
||||||
Enum.FontSize.Size14 v.BackgroundTransparency=1 v.TextColor3=Color3.new(1,1,1)v.
|
.Help then F.Image.Button.Image=
|
||||||
RobloxLocked=true v.Parent=p end function showMessage(v,w)p.Text.Text=v p.Size=
|
'rbxasset://textures/chatBubble_bot_notify_question.png'elseif G==Enum.
|
||||||
UDim2.new(0,w,0,40)p.Position=UDim2.new(0.5,-w/2,0.5,-40)p.Visible=true wait(2)p
|
DialogPurpose.Shop then F.Image.Button.Image=
|
||||||
.Visible=false end function variableDelay(v)local w=math.min(string.len(v),100)
|
'rbxasset://textures/chatBubble_bot_notify_money.png'end end local F F=function(
|
||||||
wait(0.75+((w/75)*1.5))end function resetColor(v,w)if w==Enum.DialogTone.Neutral
|
)s=a('Frame','DialogScriptMessage',{Style=Enum.FrameStyle.RobloxRound,Visible=
|
||||||
then v.BackgroundColor3=Color3.new(0,0,0.7019607843137254)v.Number.TextColor3=
|
false,a('TextLabel','Text',{Position=UDim2.new(0,0,0,-1),Size=UDim2.new(1,0,1,0)
|
||||||
Color3.new(0.17647058823529413,0.5568627450980392,0.9607843137254902)elseif w==
|
,FontSize=Enum.FontSize.Size14,BackgroundTransparency=1,TextColor3=Color3.new(1,
|
||||||
Enum.DialogTone.Friendly then v.BackgroundColor3=Color3.new(0,
|
1,1),RobloxLocked=true})})end local G G=function(H,I)s.Text.Text=H s.Size=UDim2.
|
||||||
0.30196078431372547,0)v.Number.TextColor3=Color3.new(0,0.7450980392156863,0)
|
new(0,I,0,40)s.Position=UDim2.new(0.5,-I/2,0.5,-40)s.Visible=true wait(2)s.
|
||||||
elseif w==Enum.DialogTone.Enemy then v.BackgroundColor3=Color3.new(
|
Visible=false return s end local H H=function(I)local J=math.min(string.len(I),
|
||||||
0.5490196078431373,0,0)v.Number.TextColor3=Color3.new(1,0.34509803921568627,
|
100)return wait(0.75+(J/75)*1.5)end local I I=function(J,K)if K==Enum.DialogTone
|
||||||
0.30980392156862746)end end function highlightColor(v,w)if w==Enum.DialogTone.
|
.Neutral then J.BackgroundColor3=Color3.new(7.8431372549019605E-3,
|
||||||
Neutral then v.BackgroundColor3=Color3.new(7.8431372549019605E-3,
|
0.4235294117647059,1)J.Number.TextColor3=Color3.new(1,1,1)elseif K==Enum.
|
||||||
0.4235294117647059,1)v.Number.TextColor3=Color3.new(1,1,1)elseif w==Enum.
|
DialogTone.Friendly then J.BackgroundColor3=Color3.new(0,0.5019607843137255,0)J.
|
||||||
DialogTone.Friendly then v.BackgroundColor3=Color3.new(0,0.5019607843137255,0)v.
|
Number.TextColor3=Color3.new(1,1,1)elseif K==Enum.DialogTone.Enemy then J.
|
||||||
Number.TextColor3=Color3.new(1,1,1)elseif w==Enum.DialogTone.Enemy then v.
|
BackgroundColor3=Color3.new(0.8,0,0)J.Number.TextColor3=Color3.new(1,1,1)end end
|
||||||
BackgroundColor3=Color3.new(0.8,0,0)v.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.
|
||||||
function endDialog()if g then g:Remove()g=nil end local v=e e=nil if v and v.
|
InUse then local L=u:Clone()L.archivable=false L.Disabled=false L.Parent=K end
|
||||||
InUse then local w=r:Clone()w.archivable=false w.Disabled=false w.Parent=v end
|
for L,M in pairs(v)do if L and M then M.Enabled=not L.InUse end end i=nil end
|
||||||
for w,x in pairs(s)do if w and x then x.Enabled=not w.InUse end end f=nil end
|
local L L=function()print'Wander'd.Visible=false J()return G(m,n)end local M M=
|
||||||
function wanderDialog()print'Wander'a.Visible=false endDialog()showMessage(j,k)
|
function()print'Timeout'd.Visible=false J()return G(o,p)end local N N=function()
|
||||||
end function timeoutDialog()print'Timeout'a.Visible=false endDialog()
|
print'Done'return J()end local O O=function(P)if string.len(P)==0 then return
|
||||||
showMessage(l,m)end function normalEndDialog()print'Done'endDialog()end function
|
'...'else return P end end local P P=function(Q)if j then j:Remove()j=nil end j=
|
||||||
sanitizeMessage(w)if string.len(w)==0 then return'...'else return w end end
|
t:Clone()j.archivable=false j.Disabled=false j.Parent=Q return j end local Q Q=
|
||||||
function selectChoice(w)renewKillswitch(e)a.Visible=false if w==c then game.Chat
|
function(R,S)if not h then return end i=R local T={}for U,V in pairs(S)do if V:
|
||||||
:Chat(game.Players.LocalPlayer.Character,'Goodbye!',getChatColor(currentTone()))
|
IsA'DialogChoice'then table.insert(T,V)end end table.sort(T,function(W,X)return
|
||||||
normalEndDialog()else local x=d[w]game.Chat:Chat(game.Players.LocalPlayer.
|
W.Name<X.Name end)if#T==0 then N()return end local W,X=1,0 g={}for Y,Z in pairs(
|
||||||
Character,sanitizeMessage(x.UserDialog),getChatColor(currentTone()))wait(1)e:
|
e)do Z.Visible=false end for _,aa in pairs(T)do if W<=#e then e[W].Size=UDim2.
|
||||||
SignalDialogChoiceSelected(n,x)game.Chat:Chat(f,sanitizeMessage(x.ResponseDialog
|
new(1,0,0,72)e[W].UserPrompt.Text=aa.UserDialog local ab=math.ceil(e[W].
|
||||||
),getChatColor(currentTone()))variableDelay(x.ResponseDialog)
|
UserPrompt.TextBounds.Y/24)*24 e[W].Position=UDim2.new(0,0,0,X)e[W].Size=UDim2.
|
||||||
presentDialogChoices(f,x:GetChildren())end end function newChoice(w)local x=
|
new(1,0,0,ab)e[W].Visible=true g[e[W]]=aa X=X+ab W=W+1 end end f.Position=UDim2.
|
||||||
Instance.new'TextButton'x.BackgroundColor3=Color3.new(0,0,0.7019607843137254)x.
|
new(0,0,0,X)f.Number.Text=W..')'d.Size=UDim2.new(0,350,0,X+24+32)d.Position=
|
||||||
AutoButtonColor=false x.BorderSizePixel=0 x.Text=''x.MouseEnter:connect(function
|
UDim2.new(0,20,0,-d.Size.Y.Offset-20)D(y())d.Visible=true end local aa aa=
|
||||||
()highlightColor(x,currentTone())end)x.MouseLeave:connect(function()resetColor(x
|
function(ab)P(h)d.Visible=false if ab==f then game.Chat:Chat(game.Players.
|
||||||
,currentTone())end)x.MouseButton1Click:connect(function()selectChoice(x)end)x.
|
LocalPlayer.Character,'Goodbye!',A(y()))return N()else local R=g[ab]game.Chat:
|
||||||
RobloxLocked=true local y=Instance.new'TextLabel'y.Name='Number'y.TextColor3=
|
Chat(game.Players.LocalPlayer.Character,O(R.UserDialog),A(y()))wait(1)h:
|
||||||
Color3.new(0.4980392156862745,0.8313725490196079,1)y.Text=w y.FontSize=Enum.
|
SignalDialogChoiceSelected(q,R)game.Chat:Chat(i,O(R.ResponseDialog),A(y()))H(R.
|
||||||
FontSize.Size14 y.BackgroundTransparency=1 y.Position=UDim2.new(0,4,0,2)y.Size=
|
ResponseDialog)return Q(i,R:GetChildren())end end local ab ab=function(R)local S
|
||||||
UDim2.new(0,20,0,24)y.TextXAlignment=Enum.TextXAlignment.Left y.TextYAlignment=
|
=a('TextButton',{BackgroundColor3=Color3.new(0,0,0.7019607843137254),
|
||||||
Enum.TextYAlignment.Top y.RobloxLocked=true y.Parent=x local z=Instance.new
|
AutoButtonColor=false,BorderSizePixel=0,Text='',RobloxLocked=true,a('TextLabel',
|
||||||
'TextLabel'z.Name='UserPrompt'z.BackgroundTransparency=1 z.TextColor3=Color3.
|
'Number',{TextColor3=Color3.new(0.4980392156862745,0.8313725490196079,1),Text=R,
|
||||||
new(1,1,1)z.FontSize=Enum.FontSize.Size14 z.Position=UDim2.new(0,28,0,2)z.Size=
|
FontSize=Enum.FontSize.Size14,BackgroundTransparency=1,Position=UDim2.new(0,4,0,
|
||||||
UDim2.new(1,-32,1,-4)z.TextXAlignment=Enum.TextXAlignment.Left z.TextYAlignment=
|
2),Size=UDim2.new(0,20,0,24),TextXAlignment=Enum.TextXAlignment.Left,
|
||||||
Enum.TextYAlignment.Top z.TextWrap=true z.RobloxLocked=true z.Parent=x return x
|
TextYAlignment=Enum.TextYAlignment.Top,RobloxLocked=true}),a('TextLabel',
|
||||||
end function initialize(w)b[1]=newChoice'1)'b[2]=newChoice'2)'b[3]=newChoice'3)'
|
'UserPrompt',{BackgroundTransparency=1,TextColor3=Color3.new(1,1,1),FontSize=
|
||||||
b[4]=newChoice'4)'c=newChoice'5)'c.UserPrompt.Text='Goodbye!'c.Size=UDim2.new(1,
|
Enum.FontSize.Size14,Position=UDim2.new(0,28,0,2),Size=UDim2.new(1,-32,1,-4),
|
||||||
0,0,28)a=Instance.new'Frame'a.Name='UserDialogArea'a.Size=UDim2.new(0,350,0,200)
|
TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top,
|
||||||
a.Style=Enum.FrameStyle.ChatBlue a.Visible=false local x=Instance.new
|
TextWrap=true,RobloxLocked=true})})S.MouseEnter:connect(function()return I(S,y()
|
||||||
'ImageLabel'x.Name='Tail'x.Size=UDim2.new(0,62,0,53)x.Position=UDim2.new(1,8,
|
)end)S.MouseLeave:connect(function()return B(S,y())end)S.MouseButton1Click:
|
||||||
0.25)x.Image='rbxasset://textures/chatBubble_botBlue_tailRight.png'x.
|
connect(function()return aa(S)end)return S end local R R=function(S)e[1]=ab'1)'e
|
||||||
BackgroundTransparency=1 x.RobloxLocked=true x.Parent=a for y,z in pairs(b)do z.
|
[2]=ab'2)'e[3]=ab'3)'e[4]=ab'4)'f=ab'5)'f.UserPrompt.Text='Goodbye!'f.Size=UDim2
|
||||||
RobloxLocked=true z.Parent=a end c.RobloxLocked=true c.Parent=a a.RobloxLocked=
|
.new(1,0,0,28)d=a('Frame','UserDialogArea',{Size=UDim2.new(0,350,0,200),Style=
|
||||||
true a.Parent=w end function presentDialogChoices(w,x)if not e then return end f
|
Enum.FrameStyle.ChatBlue,Visible=false,a('ImageLabel','Tail',{Size=UDim2.new(0,
|
||||||
=w local y={}for z,A in pairs(x)do if A:IsA'DialogChoice'then table.insert(y,A)
|
62,0,53),Position=UDim2.new(1,8,0.25),Image=
|
||||||
end end table.sort(y,function(B,C)return B.Name<C.Name end)if#y==0 then
|
'rbxasset://textures/chatBubble_botBlue_tailRight.png',BackgroundTransparency=1,
|
||||||
normalEndDialog()return end local B,C=1,0 d={}for D,E in pairs(b)do E.Visible=
|
RobloxLocked=true})})for T,W in pairs(e)do W.RobloxLocked=true W.Parent=d f.
|
||||||
false end for F,G in pairs(y)do if B<=#b then b[B].Size=UDim2.new(1,0,0,72)b[B].
|
RobloxLocked=true end f.Parent=d d.RobloxLocked=true d.Parent=S end local S S=
|
||||||
UserPrompt.Text=G.UserDialog local H=math.ceil(b[B].UserPrompt.TextBounds.Y/24)*
|
function(T)while not Instance.Lock(T,q)do wait()end if T.InUse then Instance.
|
||||||
24 b[B].Position=UDim2.new(0,0,0,C)b[B].Size=UDim2.new(1,0,0,H)b[B].Visible=true
|
Unlock(T)return else T.InUse=true Instance.Unlock(T)end h=T game.Chat:Chat(T.
|
||||||
d[b[B]]=G C=C+H B=B+1 end end c.Position=UDim2.new(0,0,0,C)c.Number.Text=B..')'a
|
Parent,T.InitialPrompt,A(T.Tone))H(T.InitialPrompt)return Q(T.Parent,T:
|
||||||
.Size=UDim2.new(0,350,0,C+24+32)a.Position=UDim2.new(0,20,0,-a.Size.Y.Offset-20)
|
GetChildren())end local T T=function()while h do if h.Parent and(q:
|
||||||
styleMainFrame(currentTone())a.Visible=true end function doDialog(w)while not
|
DistanceFromCharacter(h.Parent.Position>=h.ConversationDistance))then L()end
|
||||||
Instance.Lock(w,n)do wait()end if w.InUse then Instance.Unlock(w)return else w.
|
wait(1)end end local W W=function(X)if X.Parent and X.Parent:IsA'BasePart'then
|
||||||
InUse=true Instance.Unlock(w)end e=w game.Chat:Chat(w.Parent,w.InitialPrompt,
|
if q:DistanceFromCharacter(X.Parent.Position)>=X.ConversationDistance then G(k,l
|
||||||
getChatColor(w.Tone))variableDelay(w.InitialPrompt)presentDialogChoices(w.Parent
|
)return end for _,ac in pairs(v)do if _ and ac then ac.Enabled=false end end P(_
|
||||||
,w:GetChildren())end function renewKillswitch(w)if g then g:Remove()g=nil end g=
|
)delay(1,T)return S(_)end end local ac ac=function(X)if v[X]then v[X]:Remove()v[
|
||||||
q:Clone()g.archivable=false g.Disabled=false g.Parent=w end function
|
X]=nil end if w[X]then w[X]:disconnect()w[X]=nil end end local X X=function(_)if
|
||||||
checkForLeaveArea()while e do if e.Parent and(n:DistanceFromCharacter(e.Parent.
|
_.Parent then if _.Parent:IsA'BasePart'then local ad=r:clone()ad.Enabled=not _.
|
||||||
Position)>=e.ConversationDistance)then wanderDialog()end wait(1)end end function
|
InUse ad.Adornee=_.Parent ad.RobloxLocked=true ad.Parent=game.CoreGui ad.Image.
|
||||||
startDialog(w)if w.Parent and w.Parent:IsA'BasePart'then if n:
|
Button.MouseButton1Click:connect(function()return W(_)end)E(ad,_.Purpose,_.Tone)
|
||||||
DistanceFromCharacter(w.Parent.Position)>=w.ConversationDistance then
|
v[_]=ad w[_]=_.Changed:connect(function(ae)if ae=='Parent'and _.Parent then ac(_
|
||||||
showMessage(h,i)return end for x,y in pairs(s)do if x and y then y.Enabled=false
|
)return X(_)elseif ae=='InUse'then ad.Enabled=not h and not _.InUse if _==h then
|
||||||
end end renewKillswitch(x)delay(1,checkForLeaveArea)doDialog(x)end end function
|
return M()end elseif ae=='Tone'or ae=='Purpose'then return E(ad,_.Purpose,_.Tone
|
||||||
removeDialog(w)if s[w]then s[w]:Remove()s[w]=nil end if t[w]then t[w]:
|
)end end)else w[_]=_.Changed:connect(function(ad)if ad=='Parent'and _.Parent
|
||||||
disconnect()t[w]=nil end end function addDialog(w)if w.Parent then if w.Parent:
|
then ac(_)return X(_)end end)end end end local ad ad=function()local ae=game:
|
||||||
IsA'BasePart'then local x=o:clone()x.Enabled=not w.InUse x.Adornee=w.Parent x.
|
GetService'InsertService':LoadAsset(39226062)if type(ae)=='string'then wait(0.1)
|
||||||
RobloxLocked=true x.Parent=game.CoreGui x.Image.Button.MouseButton1Click:
|
ae=game:GetService'InsertService':LoadAsset(39226062)end if type(ae)=='string'
|
||||||
connect(function()startDialog(w)end)setChatNotificationTone(x,w.Purpose,w.Tone)s
|
then return end c(ae,'TimeoutScript')t=ae.TimeoutScript c(ae,
|
||||||
[w]=x t[w]=w.Changed:connect(function(y)if y=='Parent'and w.Parent then
|
'ReenableDialogScript')u=ae.ReenableDialogScript end local ae ae=function()b(
|
||||||
removeDialog(w)addDialog(w)elseif y=='InUse'then x.Enabled=not e and not w.InUse
|
game.Players,'LocalPlayer')q=game.Players.LocalPlayer b(q,'Character')ad()z()F()
|
||||||
if w==e then timeoutDialog()end elseif y=='Tone'or y=='Purpose'then
|
s.RobloxLocked=true s.Parent=x c(x,'BottomLeftControl')local _=a('Frame',
|
||||||
setChatNotificationTone(x,w.Purpose,w.Tone)end end)else t[w]=w.Changed:connect(
|
'DialogFrame',{Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,0,0,0),
|
||||||
function(x)if x=='Parent'and w.Parent then removeDialog(w)addDialog(w)end end)
|
BackgroundTransparency=1,RobloxLocked=true,Parent=x.BottomLeftControl})R(_)game.
|
||||||
end end end function fetchScripts()local w=game:GetService'InsertService':
|
CollectionService.ItemAdded:connect(function(af)if af:IsA'Dialog'then return X(
|
||||||
LoadAsset(39226062)if type(w)=='string'then wait(0.1)w=game:GetService
|
af)end end)game.CollectionService.ItemRemoved:connect(function(af)if af:IsA
|
||||||
'InsertService':LoadAsset(39226062)end if type(w)=='string'then return end
|
'Dialog'then return ac(af)end end)for af,ag in pairs(game.CollectionService:
|
||||||
waitForChild(w,'TimeoutScript')q=w.TimeoutScript waitForChild(w,
|
GetCollection'Dialog')do if ag:IsA'Dialog'then X(ag)end end end return ae()
|
||||||
'ReenableDialogScript')r=w.ReenableDialogScript end function onLoad()
|
|
||||||
waitForProperty(game.Players,'LocalPlayer')n=game.Players.LocalPlayer
|
|
||||||
waitForProperty(n,'Character')fetchScripts()createChatNotificationGui()
|
|
||||||
createMessageDialog()p.RobloxLocked=true p.Parent=u waitForChild(u,
|
|
||||||
'BottomLeftControl')local w=Instance.new'Frame'w.Name='DialogFrame'w.Position=
|
|
||||||
UDim2.new(0,0,0,0)w.Size=UDim2.new(0,0,0,0)w.BackgroundTransparency=1 w.
|
|
||||||
RobloxLocked=true w.Parent=u.BottomLeftControl initialize(w)game.
|
|
||||||
CollectionService.ItemAdded:connect(function(x)if x:IsA'Dialog'then addDialog(x)
|
|
||||||
end end)game.CollectionService.ItemRemoved:connect(function(x)if x:IsA'Dialog'
|
|
||||||
then removeDialog(x)end end)for x,y in pairs(game.CollectionService:
|
|
||||||
GetCollection'Dialog')do if y:IsA'Dialog'then addDialog(y)end end end onLoad()
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,5 @@
|
||||||
local a={}a.Foo=function()print'foo'end a.Bar=function()print'bar'end a.Help=
|
local a={}a.Foo=function()return print'foo'end a.Bar=function()return print'bar'
|
||||||
function(b)if b=='Foo'or b==a.Foo then return
|
end a.Help=function(b)if'Foo'==b or a.Foo==b then return
|
||||||
'Function Foo. Arguments: None. Side effect: prints foo'elseif b=='Bar'or b==a
|
'Function Foo. Arguments: None. Side effect: prints foo'elseif'Bar'==b or a.
|
||||||
.Bar then return'Function Bar. Arguments: None. Side effect: prints bar'end
|
Bar==b then return'Function Bar. Arguments: None. Side effect: prints bar'end
|
||||||
end return a
|
end return a
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,84 +1,84 @@
|
||||||
function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end function
|
local a a=function(b,c)while not b[c]do b.Changed:wait()end end local b b=
|
||||||
waitForChild(a,b)while not a:FindFirstChild(b)do a.ChildAdded:wait()end end
|
function(c,d)while not c:FindFirstChild(d)do c.ChildAdded:wait()end end a(game.
|
||||||
waitForProperty(game.Players,'LocalPlayer')waitForChild(script.Parent,'Popup')
|
Players,'LocalPlayer')b(script.Parent,'Popup')b(script.Parent.Popup,
|
||||||
waitForChild(script.Parent.Popup,'AcceptButton')script.Parent.Popup.AcceptButton
|
'AcceptButton')script.Parent.Popup.AcceptButton.Modal=true local c,d,e,f,g=game.
|
||||||
.Modal=true local a,b,c,d,e=game.Players.LocalPlayer,nil,{},true,function()if
|
Players.LocalPlayer,nil,{},true,nil g=function()local h=script.Parent:
|
||||||
script.Parent.Popup then script.Parent.Popup.Visible=false end end function
|
FindFirstChild'Popup'if h then h.OKButton.Visible=true h.DeclineButton.Visible=
|
||||||
makeFriend(f,g)local h=script.Parent:FindFirstChild'Popup'if h==nil then return
|
false h.AcceptButton.Visible=false end return h end local h h=function()local i=
|
||||||
end if h.Visible then return end if c[f]then return end h.PopupText.Text=
|
script.Parent:FindFirstChild'Popup'if i then i.OKButton.Visible=false i.
|
||||||
'Accept Friend Request from '..tostring(f.Name)..'?'h.PopupImage.Image=
|
DeclineButton.Visible=true i.AcceptButton.Visible=true end return i end local i
|
||||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(f.userId)..
|
i=function()if script.Parent.Popup then script.Parent.Popup.Visible=false end
|
||||||
'&x=352&y=352'showTwoButtons()h.Visible=true h.AcceptButton.Text='Accept'h.
|
end local j j=function(k,l)local m=script.Parent:FindFirstChild'Popup'if not(m~=
|
||||||
DeclineButton.Text='Decline'h:TweenSize(UDim2.new(0,330,0,350),Enum.
|
nil)then return end if m.Visible then return end if e[k]then return end m.
|
||||||
EasingDirection.Out,Enum.EasingStyle.Quart,1,true)local i,j i=h.AcceptButton.
|
PopupText.Text='Accept Friend Request from '..tostring(k.Name)..'?'m.PopupImage.
|
||||||
MouseButton1Click:connect(function()h.Visible=false g:RequestFriendship(f)if i
|
Image='http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||||
then i:disconnect()end if j then j:disconnect()end h:TweenSize(UDim2.new(0,0,0,0
|
'&x=352&y=352'h()m.Visible=true m.AcceptButton.Text='Accept'm.DeclineButton.Text
|
||||||
),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,e())end)j=h.
|
='Decline'm:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.
|
||||||
DeclineButton.MouseButton1Click:connect(function()h.Visible=false g:
|
EasingStyle.Quart,1,true)local n,o n=m.AcceptButton.MouseButton1Click:connect(
|
||||||
RevokeFriendship(f)c[f]=true print'pop up blacklist'if i then i:disconnect()end
|
function()m.Visible=false l:RequestFriendship(k)if n~=nil then n:disconnect()end
|
||||||
if j then j:disconnect()end h:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.
|
if o~=nil then o:disconnect()end return m:TweenSize(UDim2.new(0,0,0,0),Enum.
|
||||||
Out,Enum.EasingStyle.Quart,1,true,e())end)end game.Players.FriendRequestEvent:
|
EasingDirection.Out,Enum.EasingStyle.Quart,1,true,i())end)o=m.DeclineButton.
|
||||||
connect(function(f,g,h)if f~=a and g~=a then return end if f==a then if h==Enum.
|
MouseButton1Click:connect(function()m.Visible=false l:RevokeFriendship(k)e[k]=
|
||||||
FriendRequestEvent.Accept then game:GetService'GuiService':SendNotification(
|
true print'pop up blacklist'if n~=nil then n:disconnect()end if o~=nil then o:
|
||||||
'You are Friends','With '..g.Name..'!',
|
disconnect()end return m:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,
|
||||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(g.userId)..
|
Enum.EasingStyle.Quart,1,true,i())end)end game.Players.FriendRequestEvent:
|
||||||
'&x=48&y=48',5,function()end)end elseif g==a then if h==Enum.FriendRequestEvent.
|
connect(function(k,l,m)if k~=c and l~=c then return end if k==c then if m==Enum.
|
||||||
Issue then if c[f]then return end game:GetService'GuiService':SendNotification(
|
FriendRequestEvent.Accept then return game:GetService'GuiService':
|
||||||
'Friend Request','From '..f.Name,
|
SendNotification('You are Friends','With '..tostring(l.Name)..'!',
|
||||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(f.userId)..
|
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(l.userId)..
|
||||||
'&x=48&y=48',8,function()makeFriend(f,g)end)elseif h==Enum.FriendRequestEvent.
|
'&x=48&y=48',5,function()end)end elseif l==c then if m==Enum.FriendRequestEvent.
|
||||||
Accept then game:GetService'GuiService':SendNotification('You are Friends',
|
Issue then if e[k]then return end return game:GetService'GuiService':
|
||||||
'With '..f.Name..'!','http://www.roblox.com/thumbs/avatar.ashx?userId='..
|
SendNotification('Friend Request','From '..tostring(k.Name),
|
||||||
tostring(f.userId)..'&x=48&y=48',5,function()end)end end end)function
|
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||||
showOneButton()local f=script.Parent:FindFirstChild'Popup'if f then f.OKButton.
|
'&x=48&y=48',8,function()return j(k,l)end)elseif m==Enum.FriendRequestEvent.
|
||||||
Visible=true f.DeclineButton.Visible=false f.AcceptButton.Visible=false end end
|
Accept then return game:GetService'GuiService':SendNotification(
|
||||||
function showTwoButtons()local f=script.Parent:FindFirstChild'Popup'if f then f.
|
'You are Friends','With '..tostring(k.Name)..'!',
|
||||||
OKButton.Visible=false f.DeclineButton.Visible=true f.AcceptButton.Visible=true
|
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||||
end end function showTeleportUI(f,g)if b~=nil then b:Remove()end waitForChild(a,
|
'&x=48&y=48',5,function()end)end end end)local k k=function(l,m)if d~=nil then d
|
||||||
'PlayerGui')b=Instance.new'Message'b.Text=f b.Parent=a.PlayerGui if g>0 then
|
:Remove()end b(c,'PlayerGui')local n=Instance.new'Message'n.Text=l n.Parent=c.
|
||||||
wait(g)b:Remove()end end function onTeleport(f,g,h)if game:GetService
|
PlayerGui if m>0 then wait(m)n:Remove()end return n end local l l=function(m,n,o
|
||||||
'TeleportService'.CustomizedTeleportUI==false then if f==Enum.TeleportState.
|
)if game:GetService'TeleportService'.CustomizedTeleportUI==false then return k((
|
||||||
Started then showTeleportUI('Teleport started...',0)elseif f==Enum.TeleportState
|
function()if Enum.TeleportState.Started==m then return'Teleport started...',0
|
||||||
.WaitingForServer then showTeleportUI('Requesting server...',0)elseif f==Enum.
|
elseif Enum.TeleportState.WaitingForServer==m then return'Requesting server...',
|
||||||
TeleportState.InProgress then showTeleportUI('Teleporting...',0)elseif f==Enum.
|
0 elseif Enum.TeleportState.InProgress==m then return'Teleporting...',0 elseif
|
||||||
TeleportState.Failed then showTeleportUI(
|
Enum.TeleportState.Failed==m then return
|
||||||
[[Teleport failed. Insufficient privileges or target place does not exist.]],3)
|
[[Teleport failed. Insufficient privileges or target place does not exist.]],3
|
||||||
end end end if d then a.OnTeleport:connect(onTeleport)game:GetService
|
end end)())end end if f then c.OnTeleport:connect(l)game:GetService
|
||||||
'TeleportService'.ErrorCallback=function(f)local h=script.Parent:FindFirstChild
|
'TeleportService'.ErrorCallback=function(m)local o=script.Parent:FindFirstChild
|
||||||
'Popup'showOneButton()h.PopupText.Text=f local i i=h.OKButton.MouseButton1Click:
|
'Popup'g()o.PopupText.Text=m local p p=o.OKButton.MouseButton1Click:connect(
|
||||||
connect(function()game:GetService'TeleportService':TeleportCancel()if i then i:
|
function()game:GetService'TeleportService':TeleportCancel()if p then p:
|
||||||
disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild
|
disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild
|
||||||
'Popup')h:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle
|
'Popup')return o:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.
|
||||||
.Quart,1,true,e())end)game.GuiService:AddCenterDialog(script.Parent:
|
EasingStyle.Quart,1,true,i())end)return game.GuiService:AddCenterDialog(script.
|
||||||
FindFirstChild'Popup',Enum.CenterDialogType.QuitDialog,function()showOneButton()
|
Parent:FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()g()
|
||||||
script.Parent:FindFirstChild'Popup'.Visible=true h:TweenSize(UDim2.new(0,330,0,
|
script.Parent:FindFirstChild'Popup'.Visible=true return o:TweenSize(UDim2.new(0,
|
||||||
350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()h:
|
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,
|
TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,
|
||||||
true,e())end)end game:GetService'TeleportService'.ConfirmationCallback=function(
|
true,i())end)end)if u==false then script.Parent:FindFirstChild'Popup'.Visible=
|
||||||
f,h,i)local j=script.Parent:FindFirstChild'Popup'j.PopupText.Text=f j.PopupImage
|
true q.AcceptButton.Text='Leave'q.DeclineButton.Text='Stay'q:TweenSize(UDim2.
|
||||||
.Image=''local k,l local function killCons()if k then k:disconnect()end if l
|
new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end
|
||||||
then l:disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:
|
return true end end
|
||||||
FindFirstChild'Popup')j:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,
|
|
||||||
Enum.EasingStyle.Quart,1,true,e())end k=j.AcceptButton.MouseButton1Click:
|
|
||||||
connect(function()killCons()local m,n=pcall(function()game:GetService
|
|
||||||
'TeleportService':TeleportImpl(h,i)end)if not m then showOneButton()j.PopupText.
|
|
||||||
Text=n local o o=j.OKButton.MouseButton1Click:connect(function()if o then o:
|
|
||||||
disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild
|
|
||||||
'Popup')j:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle
|
|
||||||
.Quart,1,true,e())end)game.GuiService:AddCenterDialog(script.Parent:
|
|
||||||
FindFirstChild'Popup',Enum.CenterDialogType.QuitDialog,function()showOneButton()
|
|
||||||
script.Parent:FindFirstChild'Popup'.Visible=true j:TweenSize(UDim2.new(0,330,0,
|
|
||||||
350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()j:
|
|
||||||
TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,
|
|
||||||
true,e())end)end end)l=j.DeclineButton.MouseButton1Click:connect(function()
|
|
||||||
killCons()pcall(function()game:GetService'TeleportService':TeleportCancel()end)
|
|
||||||
end)local m=pcall(function()game.GuiService:AddCenterDialog(script.Parent:
|
|
||||||
FindFirstChild'Popup',Enum.CenterDialogType.QuitDialog,function()showTwoButtons(
|
|
||||||
)j.AcceptButton.Text='Leave'j.DeclineButton.Text='Stay'script.Parent:
|
|
||||||
FindFirstChild'Popup'.Visible=true j:TweenSize(UDim2.new(0,330,0,350),Enum.
|
|
||||||
EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()j:TweenSize(
|
|
||||||
UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,e())
|
|
||||||
end)end)if m==false then script.Parent:FindFirstChild'Popup'.Visible=true j.
|
|
||||||
AcceptButton.Text='Leave'j.DeclineButton.Text='Stay'j:TweenSize(UDim2.new(0,330,
|
|
||||||
0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end return true
|
|
||||||
end end
|
|
||||||
|
|
@ -1,20 +1,22 @@
|
||||||
local a=Instance.new'Frame'a.Position=UDim2.new(0.5,-165,0.5,-175)a.Size=UDim2.
|
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=a(b)if c then
|
||||||
new(0,330,0,350)a.Style=Enum.FrameStyle.RobloxRound a.ZIndex=4 a.Name='Popup'a.
|
e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then if g==
|
||||||
Visible=false a.Parent=script.Parent local b=a:clone()b.Size=UDim2.new(1,16,1,16
|
'Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)=='userdata'
|
||||||
)b.Position=UDim2.new(0,-8,0,-8)b.Name='Darken'b.ZIndex=1 b.Parent=a local c=
|
then h.Parent=e end end e.Parent=f return e end local b=a('Frame','Popup',{
|
||||||
Instance.new'TextButton'c.Position=UDim2.new(0,20,0,270)c.Size=UDim2.new(0,100,0
|
Position=UDim2.new(0.5,-165,0.5,-175),Size=UDim2.new(0,330,0,350),Style=Enum.
|
||||||
,50)c.Font=Enum.Font.ArialBold c.FontSize=Enum.FontSize.Size24 c.Style=Enum.
|
FrameStyle.RobloxRound,ZIndex=4,Visible=false,Parent=script.Parent,a('TextLabel'
|
||||||
ButtonStyle.RobloxButton c.TextColor3=Color3.new(0.9725490196078431,
|
,'PopupText',{Size=UDim2.new(1,0,0.8,0),Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||||
0.9725490196078431,0.9725490196078431)c.Text='Yes'c.ZIndex=5 c.Name=
|
FontSize.Size36,BackgroundTransparency=1,Text="Hello I'm a popup",TextColor3=
|
||||||
'AcceptButton'c.Parent=a local d=c:clone()d.Position=UDim2.new(1,-120,0,270)d.
|
Color3.new(0.9725490196078431,0.9725490196078431,0.9725490196078431),TextWrap=
|
||||||
Text='No'd.Name='DeclineButton'd.Parent=a local e=c:clone()e.Name='OKButton'e.
|
true,ZIndex=5}),a('TextButton','AcceptButton',{Position=UDim2.new(0,20,0,270),
|
||||||
Text='OK'e.Position=UDim2.new(0.5,-50,0,270)e.Visible=false e.Parent=a local f=
|
Size=UDim2.new(0,100,0,50),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.
|
||||||
Instance.new'ImageLabel'f.BackgroundTransparency=1 f.Position=UDim2.new(0.5,-140
|
Size24,Style=Enum.ButtonStyle.RobloxButton,TextColor3=Color3.new(
|
||||||
,0,0)f.Size=UDim2.new(0,280,0,280)f.ZIndex=3 f.Name='PopupImage'f.Parent=a local
|
0.9725490196078431,0.9725490196078431,0.9725490196078431),Text='Yes',ZIndex=5}),
|
||||||
g=Instance.new'ImageLabel'g.BackgroundTransparency=1 g.Size=UDim2.new(1,0,1,0)g.
|
a('ImageLabel','PopupImage',{BackgroundTransparency=1,Position=UDim2.new(0.5,-
|
||||||
Image='http://www.roblox.com/asset/?id=47574181'g.Name='Backing'g.ZIndex=2 g.
|
140,0,0),Size=UDim2.new(0,280,0,280),ZIndex=3,a('ImageLabel','Backing',{
|
||||||
Parent=f local h=Instance.new'TextLabel'h.Name='PopupText'h.Size=UDim2.new(1,0,
|
BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),Image=
|
||||||
0.8,0)h.Font=Enum.Font.ArialBold h.FontSize=Enum.FontSize.Size36 h.
|
'http://www.roblox.com/asset/?id=47574181',ZIndex=2})})})local c=b.AcceptButton
|
||||||
BackgroundTransparency=1 h.Text="Hello I'm a popup"h.TextColor3=Color3.new(
|
do local d=b:clone()d.Name='Darken'd.Size=UDim2.new(1,16,1,16)d.Position=UDim2.
|
||||||
0.9725490196078431,0.9725490196078431,0.9725490196078431)h.TextWrap=true h.
|
new(0,-8,0,-8)d.ZIndex=1 d.Parent=b end do local d=c:clone()d.Name=
|
||||||
ZIndex=5 h.Parent=a script:remove()
|
'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()
|
||||||
|
|
@ -1,264 +1,229 @@
|
||||||
if game.CoreGui.Version<3 then return end local a=script.Parent local function
|
if game.CoreGui.Version<3 then return end local a a=function(b,c,d)if not(d~=nil
|
||||||
waitForChild(b,c)while not b:FindFirstChild(c)do b.ChildAdded:wait()end end
|
)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for g,
|
||||||
local function waitForProperty(b,c)while not b[c]do b.Changed:wait()end end
|
h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h end
|
||||||
local function IsTouchDevice()local b=false pcall(function()b=Game:GetService
|
elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e.Parent=
|
||||||
'UserInputService'.TouchEnabled end)return b end local function IsPhone()if a.
|
f return e end local b,c=script.Parent,nil c=function(d,e)while not d:
|
||||||
AbsoluteSize.Y<=320 then return true end return false end waitForChild(game,
|
FindFirstChild(e)do d.ChildAdded:wait()end end local d d=function(e,f)while not
|
||||||
'Players')waitForProperty(game.Players,'LocalPlayer')local b=Instance.new'Frame'
|
e[f]do e.Changed:wait()end end local e e=function()local f=false pcall(function(
|
||||||
b.Name='CurrentLoadout'b.Position=UDim2.new(0.5,-300,1,-85)b.Size=UDim2.new(0,
|
)f=Game:GetService'UserInputService'.TouchEnabled end)return f end local f f=
|
||||||
600,0,54)b.BackgroundTransparency=1 b.RobloxLocked=true b.Parent=a local c=
|
function()if b.AbsoluteSize.Y<=320 then return true else return false end end c(
|
||||||
Instance.new'ImageLabel'c.Name='Background'c.Size=UDim2.new(1.2,0,1.2,0)c.Image=
|
game,'Players')d(game.Players,'LocalPlayer')local g=a('Frame','CurrentLoadout',{
|
||||||
'http://www.roblox.com/asset/?id=96536002'c.BackgroundTransparency=1 c.Position=
|
Position=UDim2.new(0.5,-300,1,-85),Size=UDim2.new(0,600,0,54),
|
||||||
UDim2.new(-0.1,0,-0.1,0)c.ZIndex=0 c.Parent=b c.Visible=false local d=Instance.
|
BackgroundTransparency=1,RobloxLocked=true,Parent=b,a('BoolValue','Debounce',{
|
||||||
new'ImageLabel'd.Size=UDim2.new(1,0,0.025,1)d.Position=UDim2.new(0,0,0,0)d.Image
|
RobloxLocked=true}),a('ImageLabel','Background',{Size=UDim2.new(1.2,0,1.2,0),
|
||||||
='http://www.roblox.com/asset/?id=97662207'd.BackgroundTransparency=1 d.Parent=c
|
Image='http://www.roblox.com/asset/?id=96536002',BackgroundTransparency=1,
|
||||||
local e=Instance.new'BoolValue'e.Name='Debounce'e.RobloxLocked=true e.Parent=b
|
Position=UDim2.new(-0.1,0,-0.1,0),ZIndex=0,Visible=false,a('ImageLabel',{Size=
|
||||||
local f=Instance.new'ImageButton'f.RobloxLocked=true f.Visible=false f.Name=
|
UDim2.new(1,0,0.025,1),Position=UDim2.new(0,0,0,0),Image=
|
||||||
'BackpackButton'f.BackgroundTransparency=1 f.Image=
|
'http://www.roblox.com/asset/?id=97662207',BackgroundTransparency=1})})})c(b,
|
||||||
'http://www.roblox.com/asset/?id=97617958'f.Position=UDim2.new(0.5,-60,1,-108)f.
|
'ControlFrame')a('ImageButton','BackpackButton',{RobloxLocked=true,Visible=false
|
||||||
Size=UDim2.new(0,120,0,18)waitForChild(a,'ControlFrame')f.Parent=a.ControlFrame
|
,BackgroundTransparency=1,Image='http://www.roblox.com/asset/?id=97617958',
|
||||||
local g=9 if IsPhone()then g=3 b.Size=UDim2.new(0,180,0,54)b.Position=UDim2.new(
|
Position=UDim2.new(0.5,-60,1,-108),Size=UDim2.new(0,120,0,18),Parent=b.
|
||||||
0.5,-90,1,-85)end for h=0,g do local i=Instance.new'Frame'i.RobloxLocked=true i.
|
ControlFrame})local h=9 if f()then h=3 g.Size=UDim2.new(0,180,0,54)g.Position=
|
||||||
BackgroundColor3=Color3.new(0,0,0)i.BackgroundTransparency=1 i.BorderColor3=
|
UDim2.new(0.5,-90,1,-85)end for i=0,h do local j=a('Frame',{Name='Slot'..
|
||||||
Color3.new(1,1,1)i.Name='Slot'..tostring(h)i.ZIndex=4 if h==0 then i.Position=
|
tostring(i),RobloxLocked=true,BackgroundColor3=Color3.new(0,0,0),
|
||||||
UDim2.new(0.9,0,0,0)else i.Position=UDim2.new((h-1)*0.1,(h-1)*6,0,0)end i.Size=
|
BackgroundTransparency=1,BorderColor3=Color3.new(1,1,1),ZIndex=4,Position=UDim2.
|
||||||
UDim2.new(0,54,1,0)i.Parent=b if a.AbsoluteSize.Y<=320 then i.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
|
||||||
new(0,(h-1)*60,0,-50)print('Well got here',i,i.Position.X.Scale,i.Position.X.
|
end end)()),Size=UDim2.new(0,54,1,0),Parent=g})if b.AbsoluteSize.Y<=320 then j.
|
||||||
Offset)end if a.AbsoluteSize.Y<=320 and h==0 then i:Destroy()end end local h=
|
Position=UDim2.new(0,(i-1)*60,0,-50)print('Well got here',j,j.Position.X.Scale,j
|
||||||
Instance.new'ImageButton'h.Name='TempSlot'h.Active=true h.Size=UDim2.new(1,0,1,0
|
.Position.X.Offset)if i==0 then j:Destroy()end end end local i=a('ImageButton',
|
||||||
)h.BackgroundTransparency=1 h.Style='Custom'h.Visible=false h.RobloxLocked=true
|
'TempSlot',{Active=true,Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Style=
|
||||||
h.Parent=b h.ZIndex=3 local i=Instance.new'ImageLabel'i.Name='Background'i.
|
'Custom',Visible=false,RobloxLocked=true,ZIndex=3,Parent=g,a('ImageLabel',
|
||||||
BackgroundTransparency=1 i.Image='http://www.roblox.com/asset/?id=97613075'i.
|
'Background',{BackgroundTransparency=1,Image=
|
||||||
Size=UDim2.new(1,0,1,0)i.Parent=h local j=Instance.new'ImageLabel'j.Name=
|
'http://www.roblox.com/asset/?id=97613075',Size=UDim2.new(1,0,1,0)}),a(
|
||||||
'Highlight'j.BackgroundTransparency=1 j.Image=
|
'ObjectValue','GearReference',{RobloxLocked=true}),a('TextLabel','ToolTipLabel',
|
||||||
'http://www.roblox.com/asset/?id=97643886'j.Size=UDim2.new(1,0,1,0)j.Visible=
|
{RobloxLocked=true,Text='',BackgroundTransparency=0.5,BorderSizePixel=0,Visible=
|
||||||
false local k=Instance.new'ObjectValue'k.Name='GearReference'k.RobloxLocked=true
|
false,TextColor3=Color3.new(1,1,1),BackgroundColor3=Color3.new(0,0,0),
|
||||||
k.Parent=h local l=Instance.new'TextLabel'l.Name='ToolTipLabel'l.RobloxLocked=
|
TextStrokeTransparency=0,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size14,
|
||||||
true l.Text=''l.BackgroundTransparency=0.5 l.BorderSizePixel=0 l.Visible=false l
|
Size=UDim2.new(1,60,0,20),Position=UDim2.new(0,-30,0,-30)}),a('BoolValue','Kill'
|
||||||
.TextColor3=Color3.new(1,1,1)l.BackgroundColor3=Color3.new(0,0,0)l.
|
,{RobloxLocked=true}),a('TextLabel','GearText',{RobloxLocked=true,
|
||||||
TextStrokeTransparency=0 l.Font=Enum.Font.ArialBold l.FontSize=Enum.FontSize.
|
BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,
|
||||||
Size14 l.Size=UDim2.new(1,60,0,20)l.Position=UDim2.new(0,-30,0,-30)l.Parent=h
|
Position=UDim2.new(0,-8,0,-8),Size=UDim2.new(1,16,1,16),Text='',TextColor3=
|
||||||
local m=Instance.new'BoolValue'm.Name='Kill'm.RobloxLocked=true m.Parent=h local
|
Color3.new(1,1,1),TextWrap=true,ZIndex=5}),a('ImageLabel','GearImage',{
|
||||||
n=Instance.new'ImageLabel'n.Name='GearImage'n.BackgroundTransparency=1 n.
|
BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0),
|
||||||
Position=UDim2.new(0,0,0,0)n.Size=UDim2.new(1,0,1,0)n.ZIndex=5 n.RobloxLocked=
|
ZIndex=5,RobloxLocked=true})})local j=a('TextLabel','SlotNumber',{
|
||||||
true n.Parent=h local o=Instance.new'TextLabel'o.Name='SlotNumber'o.
|
BackgroundTransparency=1,BorderSizePixel=0,Font=Enum.Font.ArialBold,FontSize=
|
||||||
BackgroundTransparency=1 o.BorderSizePixel=0 o.Font=Enum.Font.ArialBold o.
|
Enum.FontSize.Size18,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,10,0,15),
|
||||||
FontSize=Enum.FontSize.Size18 o.Position=UDim2.new(0,0,0,0)o.Size=UDim2.new(0,10
|
TextColor3=Color3.new(1,1,1),TextTransparency=0,TextXAlignment=Enum.
|
||||||
,0,15)o.TextColor3=Color3.new(1,1,1)o.TextTransparency=0 o.TextXAlignment=Enum.
|
TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Bottom,RobloxLocked=true,
|
||||||
TextXAlignment.Left o.TextYAlignment=Enum.TextYAlignment.Bottom o.RobloxLocked=
|
Parent=i,ZIndex=5})if e()then j.Visible=false end local k do local l=j:Clone()l.
|
||||||
true o.Parent=h o.ZIndex=5 if IsTouchDevice()then o.Visible=false end local p=o:
|
Name='SlotNumberDownShadow'l.TextColor3=Color3.new(0,0,0)l.Position=UDim2.new(0,
|
||||||
Clone()p.Name='SlotNumberDownShadow'p.TextColor3=Color3.new(0,0,0)p.Position=
|
1,0,-1)l.Parent=i l.ZIndex=2 k=l end do local l=k:Clone()l.Name=
|
||||||
UDim2.new(0,1,0,-1)p.Parent=h p.ZIndex=2 local q=p:Clone()q.Name=
|
'SlotNumberUpShadow'l.Position=UDim2.new(0,-1,0,-1)l.Parent=i end local l=a(
|
||||||
'SlotNumberUpShadow'q.Position=UDim2.new(0,-1,0,-1)q.Parent=h local r=Instance.
|
'Frame','Backpack',{RobloxLocked=true,Visible=false,Position=UDim2.new(0.5,0,0.5
|
||||||
new'TextLabel'r.RobloxLocked=true r.Name='GearText'r.BackgroundTransparency=1 r.
|
,0),BackgroundColor3=Color3.new(0.12549019607843137,0.12549019607843137,
|
||||||
Font=Enum.Font.Arial r.FontSize=Enum.FontSize.Size14 r.Position=UDim2.new(0,-8,0
|
0.12549019607843137),BackgroundTransparency=0,BorderSizePixel=0,Parent=b,Active=
|
||||||
,-8)r.Size=UDim2.new(1,16,1,16)r.Text=''r.TextColor3=Color3.new(1,1,1)r.TextWrap
|
true,a('BoolValue','SwapSlot',{RobloxLocked=true,a('IntValue','Slot',{
|
||||||
=true r.Parent=h r.ZIndex=5 local s=Instance.new'Frame's.RobloxLocked=true s.
|
RobloxLocked=true}),a('ObjectValue','GearButton',{RobloxLocked=true})}),a(
|
||||||
Visible=false s.Name='Backpack's.Position=UDim2.new(0.5,0,0.5,0)s.
|
'Frame','SearchFrame',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2
|
||||||
BackgroundColor3=Color3.new(0.12549019607843137,0.12549019607843137,
|
.new(1,-220,0,2),Size=UDim2.new(0,220,0,24),a('ImageButton','SearchButton',{
|
||||||
0.12549019607843137)s.BackgroundTransparency=0 s.BorderSizePixel=0 s.Parent=a s.
|
RobloxLocked=true,Size=UDim2.new(0,25,0,25),BackgroundTransparency=1,Image=
|
||||||
Active=true local t=Instance.new'BoolValue't.RobloxLocked=true t.Name='SwapSlot'
|
'rbxasset://textures/ui/SearchIcon.png'}),a('TextButton','ResetButton',{
|
||||||
t.Parent=s local u=Instance.new'IntValue'u.RobloxLocked=true u.Name='Slot'u.
|
RobloxLocked=true,Visible=false,Position=UDim2.new(1,-26,0,3),Size=UDim2.new(0,
|
||||||
Parent=t local v=Instance.new'ObjectValue'v.RobloxLocked=true v.Name=
|
20,0,20),Style=Enum.ButtonStyle.RobloxButtonDefault,Text='X',TextColor3=Color3.
|
||||||
'GearButton'v.Parent=t local w=Instance.new'Frame'w.Name='Tabs'w.Visible=false w
|
new(1,1,1),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,ZIndex=3}),a(
|
||||||
.Active=false w.RobloxLocked=true w.BackgroundColor3=Color3.new(0,0,0)w.
|
'TextButton','SearchBoxFrame',{RobloxLocked=true,Position=UDim2.new(0,25,0,0),
|
||||||
BackgroundTransparency=0.08 w.BorderSizePixel=0 w.Position=UDim2.new(0,0,-0.1,-4
|
Size=UDim2.new(1,-28,0,26),Text='',Style=Enum.ButtonStyle.RobloxButton,a(
|
||||||
)w.Size=UDim2.new(1,0,0.1,4)w.Parent=s local x=Instance.new'Frame'x.RobloxLocked
|
'TextBox','SearchBox',{RobloxLocked=true,BackgroundTransparency=1,Font=Enum.Font
|
||||||
=true x.Name='TabLine'x.BackgroundColor3=Color3.new(0.20784313725490197,
|
.ArialBold,FontSize=Enum.FontSize.Size12,Position=UDim2.new(0,-5,0,-5),Size=
|
||||||
0.20784313725490197,0.20784313725490197)x.BorderSizePixel=0 x.Position=UDim2.
|
UDim2.new(1,10,1,10),TextColor3=Color3.new(1,1,1),TextXAlignment=Enum.
|
||||||
new(0,5,1,-4)x.Size=UDim2.new(1,-10,0,4)x.ZIndex=2 x.Parent=w local y=Instance.
|
TextXAlignment.Left,ZIndex=2,TextWrap=true,Text='Search...'})})})})local m=a(
|
||||||
new'TextButton'y.RobloxLocked=true y.Name='InventoryButton'y.Size=UDim2.new(0,60
|
'Frame','Tabs',{Visible=false,Active=false,RobloxLocked=true,BackgroundColor3=
|
||||||
,0,30)y.Position=UDim2.new(0,7,1,-31)y.BackgroundColor3=Color3.new(1,1,1)y.
|
Color3.new(0,0,0),BackgroundTransparency=0.08,BorderSizePixel=0,Position=UDim2.
|
||||||
BorderColor3=Color3.new(1,1,1)y.Font=Enum.Font.ArialBold y.FontSize=Enum.
|
new(0,0,-0.1,-4),Size=UDim2.new(1,0,0.1,4),Parent=l,a('Frame','TabLine',{
|
||||||
FontSize.Size18 y.Text='Gear'y.AutoButtonColor=false y.TextColor3=Color3.new(0,0
|
RobloxLocked=true,BackgroundColor3=Color3.new(0.20784313725490197,
|
||||||
,0)y.Selected=true y.Active=true y.ZIndex=3 y.Parent=w if game.CoreGui.Version>=
|
0.20784313725490197,0.20784313725490197),BorderSizePixel=0,Position=UDim2.new(0,
|
||||||
8 then local z=Instance.new'TextButton'z.RobloxLocked=true z.Name=
|
5,1,-4),Size=UDim2.new(1,-10,0,4),ZIndex=2}),a('TextButton','InventoryButton',{
|
||||||
'WardrobeButton'z.Size=UDim2.new(0,90,0,30)z.Position=UDim2.new(0,77,1,-31)z.
|
RobloxLocked=true,Size=UDim2.new(0,60,0,30),Position=UDim2.new(0,7,1,-31),
|
||||||
BackgroundColor3=Color3.new(0,0,0)z.BorderColor3=Color3.new(1,1,1)z.Font=Enum.
|
BackgroundColor3=Color3.new(1,1,1),BorderColor3=Color3.new(1,1,1),Font=Enum.Font
|
||||||
Font.ArialBold z.FontSize=Enum.FontSize.Size18 z.Text='Wardrobe'z.
|
.ArialBold,FontSize=Enum.FontSize.Size18,Text='Gear',AutoButtonColor=false,
|
||||||
AutoButtonColor=false z.TextColor3=Color3.new(1,1,1)z.Selected=false z.Active=
|
TextColor3=Color3.new(0,0,0),Selected=true,Active=true,ZIndex=3}),a('TextButton'
|
||||||
true z.Parent=w end local z=Instance.new'TextButton'z.RobloxLocked=true z.Name=
|
,'CloseButton',{RobloxLocked=true,Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||||
'CloseButton'z.Font=Enum.Font.ArialBold z.FontSize=Enum.FontSize.Size24 z.
|
FontSize.Size24,Position=UDim2.new(1,-33,0,4),Size=UDim2.new(0,30,0,30),Style=
|
||||||
Position=UDim2.new(1,-33,0,4)z.Size=UDim2.new(0,30,0,30)z.Style=Enum.ButtonStyle
|
Enum.ButtonStyle.RobloxButton,Text='',TextColor3=Color3.new(1,1,1),Modal=true,a(
|
||||||
.RobloxButton z.Text=''z.TextColor3=Color3.new(1,1,1)z.Parent=w z.Modal=true
|
'ImageLabel','XImage',{RobloxLocked=true,Image=(function()game:GetService
|
||||||
local A=Instance.new'ImageLabel'A.RobloxLocked=true A.Name='XImage'game:
|
'ContentProvider':Preload'http://www.roblox.com/asset/?id=75547445'return
|
||||||
GetService'ContentProvider':Preload'http://www.roblox.com/asset/?id=75547445'A.
|
'http://www.roblox.com/asset/?id=75547445'end)(),BackgroundTransparency=1,
|
||||||
Image='http://www.roblox.com/asset/?id=75547445'A.BackgroundTransparency=1 A.
|
Position=UDim2.new(-0.25,-1,-0.25,-1),Size=UDim2.new(1.5,2,1.5,2),ZIndex=2})})})
|
||||||
Position=UDim2.new(-0.25,-1,-0.25,-1)A.Size=UDim2.new(1.5,2,1.5,2)A.ZIndex=2 A.
|
if game.CoreGui.Version>=8 then a('TextButton','WardrobeButton',{RobloxLocked=
|
||||||
Parent=z local B=Instance.new'Frame'B.RobloxLocked=true B.Name='SearchFrame'B.
|
true,Size=UDim2.new(0,90,0,30),Position=UDim2.new(0,77,1,-31),BackgroundColor3=
|
||||||
BackgroundTransparency=1 B.Position=UDim2.new(1,-220,0,2)B.Size=UDim2.new(0,220,
|
Color3.new(0,0,0),BorderColor3=Color3.new(1,1,1),Font=Enum.Font.ArialBold,
|
||||||
0,24)B.Parent=s local C=Instance.new'ImageButton'C.RobloxLocked=true C.Name=
|
FontSize=Enum.FontSize.Size18,Text='Wardrobe',AutoButtonColor=false,TextColor3=
|
||||||
'SearchButton'C.Size=UDim2.new(0,25,0,25)C.BackgroundTransparency=1 C.Image=
|
Color3.new(1,1,1),Selected=false,Active=true,Parent=m})end local n=a('Frame',
|
||||||
'rbxasset://textures/ui/SearchIcon.png'C.Parent=B local D=Instance.new
|
'Gear',{RobloxLocked=true,BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),
|
||||||
'TextButton'D.RobloxLocked=true D.Position=UDim2.new(0,25,0,0)D.Size=UDim2.new(1
|
ClipsDescendants=true,Parent=l,a('Frame','AssetsList',{RobloxLocked=true,
|
||||||
,-28,0,26)D.Name='SearchBoxFrame'D.Text=''D.Style=Enum.ButtonStyle.RobloxButton
|
BackgroundTransparency=1,Size=UDim2.new(0.2,0,1,0),Style=Enum.FrameStyle.
|
||||||
D.Parent=B local E=Instance.new'TextBox'E.RobloxLocked=true E.Name='SearchBox'E.
|
RobloxSquare,Visible=false}),a('Frame','GearGrid',{RobloxLocked=true,Size=UDim2.
|
||||||
BackgroundTransparency=1 E.Font=Enum.Font.ArialBold E.FontSize=Enum.FontSize.
|
new(0.95,0,1,0),BackgroundTransparency=1,a('ImageButton','GearButton',{
|
||||||
Size12 E.Position=UDim2.new(0,-5,0,-5)E.Size=UDim2.new(1,10,1,10)E.TextColor3=
|
RobloxLocked=true,Visible=false,Size=UDim2.new(0,54,0,54),Style='Custom',
|
||||||
Color3.new(1,1,1)E.TextXAlignment=Enum.TextXAlignment.Left E.ZIndex=2 E.TextWrap
|
BackgroundTransparency=1,a('ImageLabel','Background',{BackgroundTransparency=1,
|
||||||
=true E.Text='Search...'E.Parent=D local F=Instance.new'TextButton'F.
|
Image='http://www.roblox.com/asset/?id=97613075',Size=UDim2.new(1,0,1,0)}),a(
|
||||||
RobloxLocked=true F.Visible=false F.Name='ResetButton'F.Position=UDim2.new(1,-26
|
'ObjectValue','GearReference',{RobloxLocked=true}),a('Frame','GreyOutButton',{
|
||||||
,0,3)F.Size=UDim2.new(0,20,0,20)F.Style=Enum.ButtonStyle.RobloxButtonDefault F.
|
RobloxLocked=true,BackgroundTransparency=0.5,Size=UDim2.new(1,0,1,0),Active=true
|
||||||
Text='X'F.TextColor3=Color3.new(1,1,1)F.Font=Enum.Font.ArialBold F.FontSize=Enum
|
,Visible=false,ZIndex=3}),a('TextLabel','GearText',{RobloxLocked=true,
|
||||||
.FontSize.Size18 F.ZIndex=3 F.Parent=B local G=Instance.new'Frame'G.Name='Gear'G
|
BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,
|
||||||
.RobloxLocked=true G.BackgroundTransparency=1 G.Size=UDim2.new(1,0,1,0)G.
|
Position=UDim2.new(0,-8,0,-8),Size=UDim2.new(1,16,1,16),Text='',ZIndex=2,
|
||||||
ClipsDescendants=true G.Parent=s local H=Instance.new'Frame'H.RobloxLocked=true
|
TextColor3=Color3.new(1,1,1),TextWrap=true})})})})local o,p=a('Frame',
|
||||||
H.Name='AssetsList'H.BackgroundTransparency=1 H.Size=UDim2.new(0.2,0,1,0)H.Style
|
'GearGridScrollingArea',{RobloxLocked=true,Position=UDim2.new(1,-19,0,35),Size=
|
||||||
=Enum.FrameStyle.RobloxSquare H.Visible=false H.Parent=G local I=Instance.new
|
UDim2.new(0,17,1,-45),BackgroundTransparency=1,Parent=n}),a('Frame',
|
||||||
'Frame'I.RobloxLocked=true I.Name='GearGrid'I.Size=UDim2.new(0.95,0,1,0)I.
|
'GearLoadouts',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2.new(
|
||||||
BackgroundTransparency=1 I.Parent=G local J=Instance.new'ImageButton'J.
|
0.7,23,0.5,1),Size=UDim2.new(0.3,-23,0.5,-1),Parent=n,Visible=false,a('Frame',
|
||||||
RobloxLocked=true J.Visible=false J.Name='GearButton'J.Size=UDim2.new(0,54,0,54)
|
'LoadoutsList',{RobloxLocked=true,Position=UDim2.new(0,0,0.15,2),Size=UDim2.new(
|
||||||
J.Style='Custom'J.BackgroundTransparency=1 J.Parent=I local K=Instance.new
|
1,-17,0.85,-2),Style=Enum.FrameStyle.RobloxSquare}),a('Frame',
|
||||||
'ImageLabel'K.Name='Background'K.BackgroundTransparency=1 K.Image=
|
'GearLoadoutsHeader',{RobloxLocked=true,BackgroundColor3=Color3.new(0,0,0),
|
||||||
'http://www.roblox.com/asset/?id=97613075'K.Size=UDim2.new(1,0,1,0)K.Parent=J
|
BackgroundTransparency=0.2,BorderColor3=Color3.new(1,0,0),Size=UDim2.new(1,2,
|
||||||
local L=Instance.new'ObjectValue'L.RobloxLocked=true L.Name='GearReference'L.
|
0.15,-1),a('TextLabel','LoadoutsHeaderText',{RobloxLocked=true,
|
||||||
Parent=J local M=Instance.new'Frame'M.RobloxLocked=true M.Name='GreyOutButton'M.
|
BackgroundTransparency=1,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,
|
||||||
BackgroundTransparency=0.5 M.Size=UDim2.new(1,0,1,0)M.Active=true M.Visible=
|
Size=UDim2.new(1,0,1,0),Text='Loadouts',TextColor3=Color3.new(1,1,1)})})})do
|
||||||
false M.ZIndex=3 M.Parent=J local N=Instance.new'TextLabel'N.RobloxLocked=true N
|
local q=o:Clone()q.Name='GearLoadoutsScrollingArea'q.RobloxLocked=true q.
|
||||||
.Name='GearText'N.BackgroundTransparency=1 N.Font=Enum.Font.Arial N.FontSize=
|
Position=UDim2.new(1,-15,0.15,2)q.Size=UDim2.new(0,17,0.85,-2)q.Parent=p end
|
||||||
Enum.FontSize.Size14 N.Position=UDim2.new(0,-8,0,-8)N.Size=UDim2.new(1,16,1,16)N
|
local q,r,s=a('Frame','GearPreview',{RobloxLocked=true,Position=UDim2.new(0.7,23
|
||||||
.Text=''N.ZIndex=2 N.TextColor3=Color3.new(1,1,1)N.TextWrap=true N.Parent=J
|
,0,0),Size=UDim2.new(0.3,-28,0.5,-1),BackgroundTransparency=1,ZIndex=7,Parent=n,
|
||||||
local O=Instance.new'Frame'O.RobloxLocked=true O.Name='GearGridScrollingArea'O.
|
a('Frame','GearStats',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2
|
||||||
Position=UDim2.new(1,-19,0,35)O.Size=UDim2.new(0,17,1,-45)O.
|
.new(0,0,0.75,0),Size=UDim2.new(1,0,0.25,0),ZIndex=8,a('TextLabel','GearName',{
|
||||||
BackgroundTransparency=1 O.Parent=G local P=Instance.new'Frame'P.RobloxLocked=
|
RobloxLocked=true,BackgroundTransparency=1,Font=Enum.Font.ArialBold,FontSize=
|
||||||
true P.Name='GearLoadouts'P.BackgroundTransparency=1 P.Position=UDim2.new(0.7,23
|
Enum.FontSize.Size18,Position=UDim2.new(0,-3,0,0),Size=UDim2.new(1,6,1,5),Text=
|
||||||
,0.5,1)P.Size=UDim2.new(0.3,-23,0.5,-1)P.Parent=G P.Visible=false local Q=
|
'',TextColor3=Color3.new(1,1,1),TextWrap=true,ZIndex=9})}),a('ImageLabel',
|
||||||
Instance.new'Frame'Q.RobloxLocked=true Q.Name='GearLoadoutsHeader'Q.
|
'GearImage',{RobloxLocked=true,Image='',BackgroundTransparency=1,Position=UDim2.
|
||||||
BackgroundColor3=Color3.new(0,0,0)Q.BackgroundTransparency=0.2 Q.BorderColor3=
|
new(0.125,0,0,0),Size=UDim2.new(0.75,0,0.75,0),ZIndex=8,a('Frame','GearIcons',{
|
||||||
Color3.new(1,0,0)Q.Size=UDim2.new(1,2,0.15,-1)Q.Parent=P local R=Instance.new
|
BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,BorderSizePixel=0,
|
||||||
'TextLabel'R.RobloxLocked=true R.Name='LoadoutsHeaderText'R.
|
RobloxLocked=true,Position=UDim2.new(0.4,2,0.85,-2),Size=UDim2.new(0.6,0,0.15,0)
|
||||||
BackgroundTransparency=1 R.Font=Enum.Font.ArialBold R.FontSize=Enum.FontSize.
|
,Visible=false,ZIndex=9,a('ImageLabel','GenreImage',{RobloxLocked=true,
|
||||||
Size18 R.Size=UDim2.new(1,0,1,0)R.Text='Loadouts'R.TextColor3=Color3.new(1,1,1)R
|
BackgroundColor3=Color3.new(0.4,0.6,1),BackgroundTransparency=0.5,
|
||||||
.Parent=Q local S=O:clone()S.RobloxLocked=true S.Name=
|
BorderSizePixel=0,Size=UDim2.new(0.25,0,1,0)})})})}),nil,nil do local t=q.
|
||||||
'GearLoadoutsScrollingArea'S.Position=UDim2.new(1,-15,0.15,2)S.Size=UDim2.new(0,
|
GearImage r,s=t.GearIcons,t.GearIcons.GenreImage end do local t=s:Clone()t.Name=
|
||||||
17,0.85,-2)S.Parent=P local T=Instance.new'Frame'T.RobloxLocked=true T.Name=
|
'AttributeOneImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(1,0.2,0)t.
|
||||||
'LoadoutsList'T.Position=UDim2.new(0,0,0.15,2)T.Size=UDim2.new(1,-17,0.85,-2)T.
|
Position=UDim2.new(0.25,0,0,0)t.Parent=r end do local t=s:Clone()t.Name=
|
||||||
Style=Enum.FrameStyle.RobloxSquare T.Parent=P local U=Instance.new'Frame'U.
|
'AttributeTwoImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(0.6,1,0.6)t
|
||||||
RobloxLocked=true U.Name='GearPreview'U.Position=UDim2.new(0.7,23,0,0)U.Size=
|
.Position=UDim2.new(0.5,0,0,0)t.Parent=r end do local t=s:Clone()t.Name=
|
||||||
UDim2.new(0.3,-28,0.5,-1)U.BackgroundTransparency=1 U.ZIndex=7 U.Parent=G local
|
'AttributeThreeImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(0,0.5,0.5
|
||||||
V=Instance.new'Frame'V.RobloxLocked=true V.Name='GearStats'V.
|
)t.Position=UDim2.new(0.75,0,0,0)t.Parent=r end if game.CoreGui.Version<8 then
|
||||||
BackgroundTransparency=1 V.Position=UDim2.new(0,0,0.75,0)V.Size=UDim2.new(1,0,
|
script:remove()return end local t t=function(u,v)return a('Frame',tostring(u),{
|
||||||
0.25,0)V.ZIndex=8 V.Parent=U local W=Instance.new'TextLabel'W.RobloxLocked=true
|
RobloxLocked=true,Size=UDim2.new(1,0,1,-70),Position=UDim2.new(0,0,0,20),
|
||||||
W.Name='GearName'W.BackgroundTransparency=1 W.Font=Enum.Font.ArialBold W.
|
BackgroundTransparency=1,Parent=v,Visible=false})end local u u=function(v,w,x,y,
|
||||||
FontSize=Enum.FontSize.Size18 W.Position=UDim2.new(0,-3,0,0)W.Size=UDim2.new(1,6
|
z)return a('ImageLabel',tostring(v),{RobloxLocked=true,Image=w,Size=x,
|
||||||
,1,5)W.Text=''W.TextColor3=Color3.new(1,1,1)W.TextWrap=true W.ZIndex=9 W.Parent=
|
BackgroundTransparency=1,Position=y,Parent=z})end local v v=function(w,x,y,z,A)
|
||||||
V local X=Instance.new'ImageLabel'X.RobloxLocked=true X.Name='GearImage'X.Image=
|
local B=a('ImageButton',tostring(w),{RobloxLocked=true,Size=x,Position=y})if A
|
||||||
''X.BackgroundTransparency=1 X.Position=UDim2.new(0.125,0,0,0)X.Size=UDim2.new(
|
then B.Style=A else B.BackgroundColor3=Color3.new(0,0,0)B.BorderColor3=Color3.
|
||||||
0.75,0,0.75,0)X.ZIndex=8 X.Parent=U local Y=Instance.new'Frame'Y.
|
new(1,1,1)end B.Parent=z return B end local w w=function(x,y,z,A)return a(
|
||||||
BackgroundColor3=Color3.new(0,0,0)Y.BackgroundTransparency=0.5 Y.BorderSizePixel
|
'TextLabel',{Name=x,RobloxLocked=true,BackgroundTransparency=1,Size=UDim2.new(0,
|
||||||
=0 Y.RobloxLocked=true Y.Name='GearIcons'Y.Position=UDim2.new(0.4,2,0.85,-2)Y.
|
32,0,14),Font=Enum.Font.Arial,TextColor3=Color3.new(1,1,1),FontSize=Enum.
|
||||||
Size=UDim2.new(0.6,0,0.15,0)Y.Visible=false Y.ZIndex=9 Y.Parent=X local Z=
|
FontSize.Size14,Text=y,Position=z,Parent=A})end local x=a('Frame','Wardrobe',{
|
||||||
Instance.new'ImageLabel'Z.RobloxLocked=true Z.Name='GenreImage'Z.
|
RobloxLocked=true,BackgroundTransparency=1,Visible=false,Size=UDim2.new(1,0,1,0)
|
||||||
BackgroundColor3=Color3.new(0.4,0.6,1)Z.BackgroundTransparency=0.5 Z.
|
,Parent=l,a('Frame','AssetList',{RobloxLocked=true,Position=UDim2.new(0,4,0,5),
|
||||||
BorderSizePixel=0 Z.Size=UDim2.new(0.25,0,1,0)Z.Parent=Y local _=Z:clone()_.
|
Size=UDim2.new(0,85,1,-5),BackgroundTransparency=1,Visible=true}),a('TextButton'
|
||||||
RobloxLocked=true _.Name='AttributeOneImage'_.BackgroundColor3=Color3.new(1,0.2,
|
,'PreviewButton',{RobloxLocked=true,Text='Rotate',BackgroundColor3=Color3.new(0,
|
||||||
0)_.Position=UDim2.new(0.25,0,0,0)_.Parent=Y local aa=Z:clone()aa.RobloxLocked=
|
0,0),BackgroundTransparency=0.5,BorderColor3=Color3.new(1,1,1),Position=UDim2.
|
||||||
true aa.Name='AttributeTwoImage'aa.BackgroundColor3=Color3.new(0.6,1,0.6)aa.
|
new(1.2,-62,1,-50),Size=UDim2.new(0,125,0,50),Font=Enum.Font.ArialBold,FontSize=
|
||||||
Position=UDim2.new(0.5,0,0,0)aa.Parent=Y local ab=Z:clone()ab.RobloxLocked=true
|
Enum.FontSize.Size24,TextColor3=Color3.new(1,1,1),TextWrapped=true,
|
||||||
ab.Name='AttributeThreeImage'ab.BackgroundColor3=Color3.new(0,0.5,0.5)ab.
|
TextStrokeTransparency=0})})local y=a('Frame','PreviewAssetFrame',{RobloxLocked=
|
||||||
Position=UDim2.new(0.75,0,0,0)ab.Parent=Y if game.CoreGui.Version<8 then script:
|
true,BackgroundTransparency=1,Position=UDim2.new(1,-240,0,30),Size=UDim2.new(0,
|
||||||
remove()return end local function makeCharFrame(ac,ad)local ae=Instance.new
|
250,0,250),Parent=x})local z=a('TextButton','PreviewAssetBacking',{RobloxLocked=
|
||||||
'Frame'ae.RobloxLocked=true ae.Size=UDim2.new(1,0,1,-70)ae.Position=UDim2.new(0,
|
true,Active=false,Text='',AutoButtonColor=false,Size=UDim2.new(1,0,1,0),Style=
|
||||||
0,0,20)ae.Name=ac ae.BackgroundTransparency=1 ae.Parent=ad ae.Visible=false
|
Enum.ButtonStyle.RobloxButton,Visible=false,ZIndex=9,Parent=y,a('ImageLabel',
|
||||||
return ae end local function makeZone(ac,ad,ae,af,ag)local ah=Instance.new
|
'PreviewAssetImage',{RobloxLocked=true,BackgroundTransparency=0.8,Position=UDim2
|
||||||
'ImageLabel'ah.RobloxLocked=true ah.Name=ac ah.Image=ad ah.Size=ae ah.
|
.new(0.5,-100,0,0),Size=UDim2.new(0,200,0,200),BorderSizePixel=0,ZIndex=10})})
|
||||||
BackgroundTransparency=1 ah.Position=af ah.Parent=ag return ah end
|
local A=a('TextLabel','AssetNameLabel',{RobloxLocked=true,BackgroundTransparency
|
||||||
local function makeStyledButton(ac,ad,ae,af,ag)local ah=Instance.new
|
=1,Position=UDim2.new(0,0,1,-20),Size=UDim2.new(0.5,0,0,24),ZIndex=10,Font=Enum.
|
||||||
'ImageButton'ah.RobloxLocked=true ah.Name=ac ah.Size=ad ah.Position=ae if ag
|
Font.Arial,Text='',TextColor3=Color3.new(1,1,1),TextScaled=true,Parent=z})do
|
||||||
then ah.Style=ag else ah.BackgroundColor3=Color3.new(0,0,0)ah.BorderColor3=
|
local B=A:Clone()B.Name='AssetTypeLabel'B.RobloxLocked=true B.TextScaled=false B
|
||||||
Color3.new(1,1,1)end ah.Parent=af return ah end local function makeTextLabel(ac,
|
.FontSize=Enum.FontSize.Size18 B.Position=UDim2.new(0.5,3,1,-20)B.Parent=z end
|
||||||
ad,ae,af)local ag=Instance.new'TextLabel'ag.RobloxLocked=true ag.
|
local B=a('Frame','CharacterPane',{RobloxLocked=true,Position=UDim2.new(1,-220,0
|
||||||
BackgroundTransparency=1 ag.Size=UDim2.new(0,32,0,14)ag.Name=ac ag.Font=Enum.
|
,32),Size=UDim2.new(0,220,1,-40),BackgroundTransparency=1,Visible=true,Parent=x,
|
||||||
Font.Arial ag.TextColor3=Color3.new(1,1,1)ag.FontSize=Enum.FontSize.Size14 ag.
|
a('TextLabel','CategoryLabel',{RobloxLocked=true,BackgroundTransparency=1,Font=
|
||||||
Text=ad ag.Position=ae ag.Parent=af end local ac=Instance.new'Frame'ac.Name=
|
Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,Position=UDim2.new(0,0,0,-7),
|
||||||
'Wardrobe'ac.RobloxLocked=true ac.BackgroundTransparency=1 ac.Visible=false ac.
|
Size=UDim2.new(1,0,0,20),TextXAlignment=Enum.TextXAlignment.Center,Text='All',
|
||||||
Size=UDim2.new(1,0,1,0)ac.Parent=s local ad=Instance.new'Frame'ad.RobloxLocked=
|
TextColor3=Color3.new(1,1,1)}),a('TextButton','SaveButton',{RobloxLocked=true,
|
||||||
true ad.Name='AssetList'ad.Position=UDim2.new(0,4,0,5)ad.Size=UDim2.new(0,85,1,-
|
Size=UDim2.new(0.6,0,0,50),Position=UDim2.new(0.2,0,1,-50),Style=Enum.
|
||||||
5)ad.BackgroundTransparency=1 ad.Visible=true ad.Parent=ac local ae=Instance.new
|
ButtonStyle.RobloxButton,Selected=false,Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||||
'Frame'ae.RobloxLocked=true ae.Name='PreviewAssetFrame'ae.BackgroundTransparency
|
FontSize.Size18,Text='Save',TextColor3=Color3.new(1,1,1)})})local C=t(
|
||||||
=1 ae.Position=UDim2.new(1,-240,0,30)ae.Size=UDim2.new(0,250,0,250)ae.Parent=ac
|
'FacesFrame',B)game:GetService'ContentProvider':Preload
|
||||||
local af=Instance.new'TextButton'af.RobloxLocked=true af.Name=
|
'http://www.roblox.com/asset/?id=75460621'u('FaceZone',
|
||||||
'PreviewAssetBacking'af.Active=false af.Text=''af.AutoButtonColor=false af.Size=
|
|
||||||
UDim2.new(1,0,1,0)af.Style=Enum.ButtonStyle.RobloxButton af.Visible=false af.
|
|
||||||
ZIndex=9 af.Parent=ae local ag=Instance.new'ImageLabel'ag.RobloxLocked=true ag.
|
|
||||||
Name='PreviewAssetImage'ag.BackgroundTransparency=0.8 ag.Position=UDim2.new(0.5,
|
|
||||||
-100,0,0)ag.Size=UDim2.new(0,200,0,200)ag.BorderSizePixel=0 ag.ZIndex=10 ag.
|
|
||||||
Parent=af local ah=Instance.new'TextLabel'ah.Name='AssetNameLabel'ah.
|
|
||||||
RobloxLocked=true ah.BackgroundTransparency=1 ah.Position=UDim2.new(0,0,1,-20)ah
|
|
||||||
.Size=UDim2.new(0.5,0,0,24)ah.ZIndex=10 ah.Font=Enum.Font.Arial ah.Text=''ah.
|
|
||||||
TextColor3=Color3.new(1,1,1)ah.TextScaled=true ah.Parent=af local ai=ah:clone()
|
|
||||||
ai.RobloxLocked=true ai.Name='AssetTypeLabel'ai.TextScaled=false ai.FontSize=
|
|
||||||
Enum.FontSize.Size18 ai.Position=UDim2.new(0.5,3,1,-20)ai.Parent=af local aj=
|
|
||||||
Instance.new'TextButton'aj.RobloxLocked=true aj.Name='PreviewButton'aj.Text=
|
|
||||||
'Rotate'aj.BackgroundColor3=Color3.new(0,0,0)aj.BackgroundTransparency=0.5 aj.
|
|
||||||
BorderColor3=Color3.new(1,1,1)aj.Position=UDim2.new(1.2,-62,1,-50)aj.Size=UDim2.
|
|
||||||
new(0,125,0,50)aj.Font=Enum.Font.ArialBold aj.FontSize=Enum.FontSize.Size24 aj.
|
|
||||||
TextColor3=Color3.new(1,1,1)aj.TextWrapped=true aj.TextStrokeTransparency=0 aj.
|
|
||||||
Parent=ac local ak=Instance.new'Frame'ak.RobloxLocked=true ak.Name=
|
|
||||||
'CharacterPane'ak.Position=UDim2.new(1,-220,0,32)ak.Size=UDim2.new(0,220,1,-40)
|
|
||||||
ak.BackgroundTransparency=1 ak.Visible=true ak.Parent=ac local al=makeCharFrame(
|
|
||||||
'FacesFrame',ak)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,
|
'http://www.roblox.com/asset/?id=75460621',UDim2.new(0,157,0,137),UDim2.new(0.5,
|
||||||
-78,0.5,-68),al)makeStyledButton('Face',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,
|
-78,0.5,-68),C)v('Face',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),C)local
|
||||||
0.5,-135),al)local am=makeCharFrame('HeadsFrame',ak)makeZone('FaceZone',
|
D=t('HeadsFrame',B)u('FaceZone','http://www.roblox.com/asset/?id=75460621',UDim2
|
||||||
'http://www.roblox.com/asset/?id=75460621',UDim2.new(0,157,0,137),UDim2.new(0.5,
|
.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),D)v('Head',UDim2.new(0,64,0,64),
|
||||||
-78,0.5,-68),am)makeStyledButton('Head',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,
|
UDim2.new(0.5,-32,0.5,-135),D)local E=t('HatsFrame',B)game:GetService
|
||||||
0.5,-135),am)local an=makeCharFrame('HatsFrame',ak)game:GetService
|
'ContentProvider':Preload'http://www.roblox.com/asset/?id=75457888'local F=u(
|
||||||
'ContentProvider':Preload'http://www.roblox.com/asset/?id=75457888'local ao=
|
'HatsZone','http://www.roblox.com/asset/?id=75457888',UDim2.new(0,186,0,184),
|
||||||
makeZone('HatsZone','http://www.roblox.com/asset/?id=75457888',UDim2.new(0,186,0
|
UDim2.new(0.5,-93,0.5,-100),E)v('Hat1Button',UDim2.new(0,64,0,64),UDim2.new(0,-1
|
||||||
,184),UDim2.new(0.5,-93,0.5,-100),an)makeStyledButton('Hat1Button',UDim2.new(0,
|
,0,-1),F,Enum.ButtonStyle.RobloxButton)v('Hat2Button',UDim2.new(0,64,0,64),UDim2
|
||||||
64,0,64),UDim2.new(0,-1,0,-1),ao,Enum.ButtonStyle.RobloxButton)makeStyledButton(
|
.new(0,63,0,-1),F,Enum.ButtonStyle.RobloxButton)v('Hat3Button',UDim2.new(0,64,0,
|
||||||
'Hat2Button',UDim2.new(0,64,0,64),UDim2.new(0,63,0,-1),ao,Enum.ButtonStyle.
|
64),UDim2.new(0,127,0,-1),F,Enum.ButtonStyle.RobloxButton)local G=t('PantsFrame'
|
||||||
RobloxButton)makeStyledButton('Hat3Button',UDim2.new(0,64,0,64),UDim2.new(0,127,
|
,B)game:GetService'ContentProvider':Preload
|
||||||
0,-1),ao,Enum.ButtonStyle.RobloxButton)local ap=makeCharFrame('PantsFrame',ak)
|
'http://www.roblox.com/asset/?id=75457920'u('PantsZone',
|
||||||
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,-
|
'http://www.roblox.com/asset/?id=75457920',UDim2.new(0,121,0,99),UDim2.new(0.5,-
|
||||||
60,0.5,-100),ap)local aq=Instance.new'Frame'aq.RobloxLocked=true aq.Size=UDim2.
|
60,0.5,-100),G)local H=a('Frame','PantFrame',{RobloxLocked=true,Size=UDim2.new(0
|
||||||
new(0,25,0,56)aq.Position=UDim2.new(0.5,-26,0.5,0)aq.BackgroundColor3=Color3.
|
,25,0,56),Position=UDim2.new(0.5,-26,0.5,0),BackgroundColor3=Color3.new(0,0,0),
|
||||||
new(0,0,0)aq.BorderColor3=Color3.new(1,1,1)aq.Name='PantFrame'aq.Parent=ap local
|
BorderColor3=Color3.new(1,1,1),Parent=G})do local I=H:Clone()I.Position=UDim2.
|
||||||
ar=aq:clone()ar.Position=UDim2.new(0.5,3,0.5,0)ar.RobloxLocked=true ar.Parent=ap
|
new(0.5,3,0.5,0)I.RobloxLocked=true I.Parent=G end a('ImageButton',
|
||||||
local as=Instance.new'ImageButton'as.RobloxLocked=true as.BackgroundTransparency
|
'CurrentPants',{RobloxLocked=true,BackgroundTransparency=1,ZIndex=2,Position=
|
||||||
=1 as.ZIndex=2 as.Name='CurrentPants'as.Position=UDim2.new(0.5,-31,0.5,-4)as.
|
UDim2.new(0.5,-31,0.5,-4),Size=UDim2.new(0,54,0,59),Parent=G})local I=t(
|
||||||
Size=UDim2.new(0,54,0,59)as.Parent=ap local at=makeCharFrame('PackagesFrame',ak)
|
'PackagesFrame',B)local J=v('TorsoMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5
|
||||||
local au=makeStyledButton('TorsoMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-
|
,-32,0.5,-110),I,Enum.ButtonStyle.RobloxButton)w('TorsoLabel','Torso',UDim2.new(
|
||||||
32,0.5,-110),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('TorsoLabel','Torso'
|
0.5,-16,0,-25),J)local K=v('LeftLegMeshButton',UDim2.new(0,64,0,64),UDim2.new(
|
||||||
,UDim2.new(0.5,-16,0,-25),au)local av=makeStyledButton('LeftLegMeshButton',UDim2
|
0.5,0,0.5,-25),I,Enum.ButtonStyle.RobloxButton)w('LeftLegLabel','Left Leg',UDim2
|
||||||
.new(0,64,0,64),UDim2.new(0.5,0,0.5,-25),at,Enum.ButtonStyle.RobloxButton)
|
.new(0.5,-16,0,-25),K)local L=v('RightLegMeshButton',UDim2.new(0,64,0,64),UDim2.
|
||||||
makeTextLabel('LeftLegLabel','Left Leg',UDim2.new(0.5,-16,0,-25),av)local aw=
|
new(0.5,-64,0.5,-25),I,Enum.ButtonStyle.RobloxButton)w('RightLegLabel',
|
||||||
makeStyledButton('RightLegMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-64,0.5
|
'Right Leg',UDim2.new(0.5,-16,0,-25),L)local M=v('RightArmMeshButton',UDim2.new(
|
||||||
,-25),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('RightLegLabel','Right Leg'
|
0,64,0,64),UDim2.new(0.5,-96,0.5,-110),I,Enum.ButtonStyle.RobloxButton)w(
|
||||||
,UDim2.new(0.5,-16,0,-25),aw)local ax=makeStyledButton('RightArmMeshButton',
|
'RightArmLabel','Right Arm',UDim2.new(0.5,-16,0,-25),M)local N=v(
|
||||||
UDim2.new(0,64,0,64),UDim2.new(0.5,-96,0.5,-110),at,Enum.ButtonStyle.
|
'LeftArmMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,32,0.5,-110),I,Enum.
|
||||||
RobloxButton)makeTextLabel('RightArmLabel','Right Arm',UDim2.new(0.5,-16,0,-25),
|
ButtonStyle.RobloxButton)w('LeftArmLabel','Left Arm',UDim2.new(0.5,-16,0,-25),N)
|
||||||
ax)local ay=makeStyledButton('LeftArmMeshButton',UDim2.new(0,64,0,64),UDim2.new(
|
local O=t('T-ShirtsFrame',B)game:GetService'ContentProvider':Preload
|
||||||
0.5,32,0.5,-110),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('LeftArmLabel',
|
'http://www.roblox.com/asset/?id=75460642'u('TShirtZone',
|
||||||
'Left Arm',UDim2.new(0.5,-16,0,-25),ay)local az=makeCharFrame('T-ShirtsFrame',ak
|
|
||||||
)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,
|
'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5,
|
||||||
-60,0.5,-100),az)makeStyledButton('TShirtButton',UDim2.new(0,64,0,64),UDim2.new(
|
-60,0.5,-100),O)v('TShirtButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64)
|
||||||
0.5,-32,0.5,-64),az)local aA=makeCharFrame('ShirtsFrame',ak)makeZone('ShirtZone'
|
,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
|
'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5,
|
||||||
,-60,0.5,-100),aA)makeStyledButton('ShirtButton',UDim2.new(0,64,0,64),UDim2.new(
|
-60,0.5,-100),P)v('ShirtButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),
|
||||||
0.5,-32,0.5,-64),aA)local aB=makeCharFrame('ColorFrame',ak)game:GetService
|
P)local Q=t('ColorFrame',B)game:GetService'ContentProvider':Preload
|
||||||
'ContentProvider':Preload'http://www.roblox.com/asset/?id=76049888'local aC=
|
'http://www.roblox.com/asset/?id=76049888'local R=u('ColorZone',
|
||||||
makeZone('ColorZone','http://www.roblox.com/asset/?id=76049888',UDim2.new(0,120,
|
'http://www.roblox.com/asset/?id=76049888',UDim2.new(0,120,0,150),UDim2.new(0.5,
|
||||||
0,150),UDim2.new(0.5,-60,0.5,-100),aB)makeStyledButton('Head',UDim2.new(0.26,0,
|
-60,0.5,-100),Q)v('Head',UDim2.new(0.26,0,0.19,0),UDim2.new(0.37,0,0.02,0),R).
|
||||||
0.19,0),UDim2.new(0.37,0,0.02,0),aC).AutoButtonColor=false makeStyledButton(
|
AutoButtonColor=false v('LeftArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26
|
||||||
'LeftArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26,0),aC).AutoButtonColor=
|
,0),R).AutoButtonColor=false v('RightArm',UDim2.new(0.19,0,0.36,0),UDim2.new(
|
||||||
false makeStyledButton('RightArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.025,0,
|
0.025,0,0.26,0),R).AutoButtonColor=false v('Torso',UDim2.new(0.43,0,0.36,0),
|
||||||
0.26,0),aC).AutoButtonColor=false makeStyledButton('Torso',UDim2.new(0.43,0,0.36
|
UDim2.new(0.28,0,0.26,0),R).AutoButtonColor=false v('RightLeg',UDim2.new(0.19,0,
|
||||||
,0),UDim2.new(0.28,0,0.26,0),aC).AutoButtonColor=false makeStyledButton(
|
0.31,0),UDim2.new(0.275,0,0.67,0),R).AutoButtonColor=false v('LeftLeg',UDim2.
|
||||||
'RightLeg',UDim2.new(0.19,0,0.31,0),UDim2.new(0.275,0,0.67,0),aC).
|
new(0.19,0,0.31,0),UDim2.new(0.525,0,0.67,0),R).AutoButtonColor=false return
|
||||||
AutoButtonColor=false makeStyledButton('LeftLeg',UDim2.new(0.19,0,0.31,0),UDim2.
|
script:Destroy()
|
||||||
new(0.525,0,0.67,0),aC).AutoButtonColor=false local aD=Instance.new'TextLabel'aD
|
|
||||||
.RobloxLocked=true aD.Name='CategoryLabel'aD.BackgroundTransparency=1 aD.Font=
|
|
||||||
Enum.Font.ArialBold aD.FontSize=Enum.FontSize.Size18 aD.Position=UDim2.new(0,0,0
|
|
||||||
,-7)aD.Size=UDim2.new(1,0,0,20)aD.TextXAlignment=Enum.TextXAlignment.Center aD.
|
|
||||||
Text='All'aD.TextColor3=Color3.new(1,1,1)aD.Parent=ak local aE=Instance.new
|
|
||||||
'TextButton'aE.RobloxLocked=true aE.Name='SaveButton'aE.Size=UDim2.new(0.6,0,0,
|
|
||||||
50)aE.Position=UDim2.new(0.2,0,1,-50)aE.Style=Enum.ButtonStyle.RobloxButton aE.
|
|
||||||
Selected=false aE.Font=Enum.Font.ArialBold aE.FontSize=Enum.FontSize.Size18 aE.
|
|
||||||
Text='Save'aE.TextColor3=Color3.new(1,1,1)aE.Parent=ak script:Destroy()
|
|
||||||
|
|
@ -1,240 +1,227 @@
|
||||||
if game.CoreGui.Version<3 then return end local function waitForChild(a,b)while
|
if game.CoreGui.Version<3 then return end local a a=function(b,c)while not b:
|
||||||
not a:FindFirstChild(b)do a.ChildAdded:wait()end return a:FindFirstChild(b)end
|
FindFirstChild(c)do b.ChildAdded:wait()end return b:FindFirstChild(c)end local b
|
||||||
local function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end
|
b=function(c,d)while not c[d]do c.Changed:wait()end end local c,d,e,f=script.
|
||||||
local a,b,c,d=script.Parent,'gear',true,game:GetService'CoreGui':FindFirstChild
|
Parent,'gear',true,game:GetService'CoreGui':FindFirstChild'RobloxGui'assert(f)
|
||||||
'RobloxGui'assert(d)local e=waitForChild(d,'ControlFrame')local f,g=
|
local g=a(f,'ControlFrame')local h,i=a(g,'BackpackButton'),a(f,'Backpack')a(f,
|
||||||
waitForChild(e,'BackpackButton'),waitForChild(d,'Backpack')waitForChild(d,
|
'CurrentLoadout')a(f.CurrentLoadout,'TempSlot')a(f.CurrentLoadout.TempSlot,
|
||||||
'CurrentLoadout')waitForChild(d.CurrentLoadout,'TempSlot')waitForChild(d.
|
'SlotNumber')a(c,'Background')local j,k=c.Background,nil k=function()local l=
|
||||||
CurrentLoadout.TempSlot,'SlotNumber')waitForChild(a,'Background')local h=a.
|
false pcall(function()l=Game:GetService'UserInputService'.TouchEnabled end)
|
||||||
Background local function IsTouchDevice()local i=false pcall(function()i=Game:
|
return l end local l l=function(m)a(m,'HealthGUI')a(m['HealthGUI'],'tray')local
|
||||||
GetService'UserInputService'.TouchEnabled end)return i end local function
|
n=m['HealthGUI']['tray']n.Position=UDim2.new(0.5,-85,1,-26)end local m m=
|
||||||
moveHealthBar(i)waitForChild(i,'HealthGUI')waitForChild(i['HealthGUI'],'tray')
|
function(n,o)a(n,'HealthGUI')a(n['HealthGUI'],'tray')local p=n['HealthGUI'][
|
||||||
local j=i['HealthGUI']['tray']j.Position=UDim2.new(0.5,-85,1,-26)end
|
'tray']p.Visible=o end a(game,'Players')b(game.Players,'LocalPlayer')local n=
|
||||||
local function setHealthBarVisible(i,j)waitForChild(i,'HealthGUI')waitForChild(i
|
game.Players.LocalPlayer a(n,'PlayerGui')Spawn(function()return l(n.PlayerGui)
|
||||||
['HealthGUI'],'tray')local k=i['HealthGUI']['tray']k.Visible=j end waitForChild(
|
end)while not(n.Character~=nil)do wait(0.03)end local o=a(n.Character,'Humanoid'
|
||||||
game,'Players')waitForProperty(game.Players,'LocalPlayer')local i=game.Players.
|
)o.Died:connect(function()h.Visible=false end)a(game,'LocalBackpack')game.
|
||||||
LocalPlayer waitForChild(i,'PlayerGui')Spawn(function()moveHealthBar(i.PlayerGui
|
LocalBackpack:SetOldSchoolBackpack(false)a(c.Parent,'Backpack')local p=c.Parent.
|
||||||
)end)while i.Character==nil do wait(0.03)end local j=waitForChild(i.Character,
|
Backpack local q=a(p,'CoreScripts/BackpackScripts/BackpackManager')local r,s,t,u
|
||||||
'Humanoid')j.Died:connect(function()f.Visible=false end)waitForChild(game,
|
,v=a(q,'BackpackOpenEvent'),a(q,'BackpackCloseEvent'),a(q,'TabClickedEvent'),
|
||||||
'LocalBackpack')game.LocalBackpack:SetOldSchoolBackpack(false)waitForChild(a.
|
true,10 if f.AbsoluteSize.Y<=320 then v=4 end local w,x,y,z=nil,nil,false,1.18
|
||||||
Parent,'Backpack')local k=a.Parent.Backpack local l=waitForChild(k,
|
local A,B,C,D,E,F,G=UDim2.new(1*z,0,1*z,0),UDim2.new(1,0,1,0),true,0.5,false,{},
|
||||||
'CoreScripts/BackpackScripts/BackpackManager')local m,n,o,p,q=waitForChild(l,
|
{}for H=1,v do G[H]='empty'end local H,I=false,nil I=function()if p then return
|
||||||
'BackpackOpenEvent'),waitForChild(l,'BackpackCloseEvent'),waitForChild(l,
|
p.Visible end return false end local J,K K=function(L,M,N)if M~=nil then M:
|
||||||
'TabClickedEvent'),true,10 if d.AbsoluteSize.Y<=320 then q=4 end local r,s,t,u=
|
disconnect()end if L==true and N then return J(N,false)end end local L L=
|
||||||
nil,nil,false,1.18 local v,w,x,y,z,A,B=UDim2.new(1*u,0,1*u,0),UDim2.new(1,0,1,0)
|
function()for M=0,9 do game:GetService'GuiService':AddKey(tostring(M))end end
|
||||||
,true,0.5,false,{},{}for C=1,q do B[C]='empty'end local C=false local function
|
local M M=function()return pcall(function()for N=0,9 do game:GetService
|
||||||
backpackIsOpen()if k then return k.Visible end return false end local function
|
'GuiService':RemoveKey(tostring(N))end end)end local N N=function()if game.
|
||||||
kill(D,E,F)if E then E:disconnect()end if D==true and F then reorganizeLoadout(F
|
Players['LocalPlayer']and game.Players.LocalPlayer['Character']and(game.Players.
|
||||||
,false)end end function registerNumberKeys()for D=0,9 do game:GetService
|
LocalPlayer.Character~=nil)and(game.Players.LocalPlayer.Character.Parent~=nil)
|
||||||
'GuiService':AddKey(tostring(D))end end function unregisterNumberKeys()pcall(
|
then return true end return false end local O O=function(P)local Q for R=1,#G do
|
||||||
function()for D=0,9 do game:GetService'GuiService':RemoveKey(tostring(D))end end
|
if G[R]==P and(P.Parent~=nil)then Q=R break end end if Q then do local R=G[Q]if
|
||||||
)end function characterInWorkspace()if game.Players['LocalPlayer']then if game.
|
R.GearReference.Value then if R.GearReference.Value.Parent==game.Players.
|
||||||
Players.LocalPlayer['Character']then if game.Players.LocalPlayer.Character~=nil
|
LocalPlayer.Character then R.GearReference.Value.Parent=game.Players.LocalPlayer
|
||||||
then if game.Players.LocalPlayer.Character.Parent~=nil then return true end end
|
.Backpack end if R.GearReference.Value:IsA'HopperBin'and R.GearReference.Value.
|
||||||
end end return false end function removeGear(D)local E=nil for F=1,#B do if B[F]
|
Active then R.GearReference.Value:Disable()R.GearReference.Value.Active=false
|
||||||
==D and D.Parent~=nil then E=F break end end if E then if B[E].GearReference.
|
end end end G[Q]='empty'delay(0,function()return P:remove()end)return Spawn(
|
||||||
Value then if B[E].GearReference.Value.Parent==game.Players.LocalPlayer.
|
function()while I()do wait(0.03)end a(n,'Backpack')local R=true for S=1,#G do if
|
||||||
Character then B[E].GearReference.Value.Parent=game.Players.LocalPlayer.Backpack
|
G[S]~='empty'then R=false end end if R then if#n.Backpack:GetChildren()<1 then h
|
||||||
end if B[E].GearReference.Value:IsA'HopperBin'and B[E].GearReference.Value.
|
.Visible=false else h.Position=UDim2.new(0.5,-60,1,-44)end j.Visible=false end
|
||||||
Active then B[E].GearReference.Value:Disable()B[E].GearReference.Value.Active=
|
end)end end local P P=function(Q,R)local S if not R then for T=1,#G do if G[T]==
|
||||||
false end end B[E]='empty'delay(0,function()D:remove()end)Spawn(function()while
|
'empty'then S=T break end end if S==1 and G[1]~='empty'then Q:remove()return end
|
||||||
backpackIsOpen()do wait(0.03)end waitForChild(i,'Backpack')local F=true for G=1,
|
else S=R local T=1 for U=1,#G do if G[U]=='empty'then T=U break end end for U=T,
|
||||||
#B do if B[G]~='empty'then F=false end end if F then if#i.Backpack:GetChildren()
|
S+1,-1 do G[U]=G[U-1]do local V if U==10 then V='0'else V=U end G[U].SlotNumber.
|
||||||
<1 then f.Visible=false else f.Position=UDim2.new(0.5,-60,1,-44)end h.Visible=
|
Text=V G[U].SlotNumberDownShadow.Text=V G[U].SlotNumberUpShadow.Text=V end end
|
||||||
false end end)end end function insertGear(D,E)local F=nil if not E then for G=1,
|
end G[S]=Q if S~=v then if type(tostring(S))=='string'then local T=tostring(S)Q.
|
||||||
#B do if B[G]=='empty'then F=G break end end if F==1 and B[1]~='empty'then D:
|
SlotNumber.Text=T Q.SlotNumberDownShadow.Text=T Q.SlotNumberUpShadow.Text=T end
|
||||||
remove()return end else F=E local G=1 for H=1,#B do if B[H]=='empty'then G=H
|
else Q.SlotNumber.Text='0'Q.SlotNumberDownShadow.Text='0'Q.SlotNumberUpShadow.
|
||||||
break end end for H=G,F+1,-1 do B[H]=B[H-1]if H==10 then B[H].SlotNumber.Text=
|
Text='0'end Q.Visible=true local T=Q.Kill.Changed:connect(function(T)return K(T,
|
||||||
'0'B[H].SlotNumberDownShadow.Text='0'B[H].SlotNumberUpShadow.Text='0'else B[H].
|
con,Q)end)end J=function(Q,R,S,T)if R then P(Q,T)else O(Q)end if Q~='empty'then
|
||||||
SlotNumber.Text=H B[H].SlotNumberDownShadow.Text=H B[H].SlotNumberUpShadow.Text=
|
Q.ZIndex=1 end end local Q Q=function(R,S)if R:FindFirstChild'RobloxBuildTool'
|
||||||
H end end end B[F]=D if F~=q then if type(tostring(F))=='string'then local G=
|
then return end if R:IsA'Tool'or R:IsA'HopperBin'then for T=1,#G do if G[T]~=
|
||||||
tostring(F)D.SlotNumber.Text=G D.SlotNumberDownShadow.Text=G D.
|
'empty'and G[T].GearReference.Value==R then if not(S~=nil)then G[T].Kill.Value=
|
||||||
SlotNumberUpShadow.Text=G end else D.SlotNumber.Text='0'D.SlotNumberDownShadow.
|
true return false elseif R.Parent==n.Character then G[T].Selected=true return
|
||||||
Text='0'D.SlotNumberUpShadow.Text='0'end D.Visible=true local G=nil G=D.Kill.
|
true elseif R.Parent==n.Backpack then if R:IsA'Tool'or R:IsA'HopperBin'then G[T]
|
||||||
Changed:connect(function(H)kill(H,G,D)end)end function reorganizeLoadout(D,E,F,G
|
.Selected=false end return true end G[T].Kill.Value=true return false end end
|
||||||
)if E then insertGear(D,G)else removeGear(D)end if D~='empty'then D.ZIndex=1 end
|
end end local R R=function(S)local T=n.Character:GetChildren()for U=1,#T do if(T
|
||||||
end function checkToolAncestry(D,E)if D:FindFirstChild'RobloxBuildTool'then
|
[U]:IsA'Tool'or T[U]:IsA'HopperBin')and T[U]~=S then if T[U]:IsA'Tool'then T[U].
|
||||||
return end if D:IsA'Tool'or D:IsA'HopperBin'then for F=1,#B do if B[F]~='empty'
|
Parent=n.Backpack end if T[U]:IsA'HopperBin'then T[U]:Disable()end end end end
|
||||||
and B[F].GearReference.Value==D then if E==nil then B[F].Kill.Value=true return
|
local S S=function(T,U)if not T then return end if T.Size.Y.Scale<=1 then return
|
||||||
false elseif D.Parent==i.Character then B[F].Selected=true return true elseif D.
|
end if T.Selected then return end if not T.Parent then return end local V=U if
|
||||||
Parent==i.Backpack then if D:IsA'Tool'or D:IsA'HopperBin'then B[F].Selected=
|
not(V~=nil)or type(V)~='number'then V=D/5 end if T:FindFirstChild'Highlight'then
|
||||||
false end return true end B[F].Kill.Value=true return false end end end end
|
T.Highlight.Visible=false end if T:IsA'ImageButton'or T:IsA'TextButton'then T.
|
||||||
function removeAllEquippedGear(D)local E=i.Character:GetChildren()for F=1,#E do
|
ZIndex=1 local W,X=-(B.X.Scale-T.Size.X.Scale)/2,-(B.Y.Scale-T.Size.Y.Scale)/2
|
||||||
if(E[F]:IsA'Tool'or E[F]:IsA'HopperBin')and E[F]~=D then if E[F]:IsA'Tool'then E
|
return T:TweenSizeAndPosition(B,UDim2.new(T.Position.X.Scale+W,T.Position.X.
|
||||||
[F].Parent=i.Backpack end if E[F]:IsA'HopperBin'then E[F]:Disable()end end end
|
Offset,T.Position.Y.Scale+X,T.Position.Y.Offset),Enum.EasingDirection.Out,Enum.
|
||||||
end function hopperBinSwitcher(D,E)if not E then return end E:ToggleSelect()if B
|
EasingStyle.Quad,V,C)end end local T T=function(U)if U.Size.Y.Scale>1 then
|
||||||
[D]=='empty'then return end if not E.Active then B[D].Selected=false
|
return end if not U.Parent then return end if not U.Selected then return end for
|
||||||
normalizeButton(B[D])else B[D].Selected=true enlargeButton(B[D])end end function
|
V=1,#G do if G[V]=='empty'then break end if G[V]~=U then S(G[V])end end if not C
|
||||||
toolSwitcher(D)if not B[D]then return end local E=B[D].GearReference.Value if E
|
then return end if U:FindFirstChild'Highlight'then U.Highlight.Visible=true end
|
||||||
==nil then return end removeAllEquippedGear(E)local F=D if D==0 then F=10 end
|
if U:IsA'ImageButton'or U:IsA'TextButton'then U.ZIndex=5 local V,W=-(A.X.Scale-U
|
||||||
for G=1,#B do if B[G]and B[G]~='empty'and G~=F then normalizeButton(B[G])B[G].
|
.Size.X.Scale)/2,-(A.Y.Scale-U.Size.Y.Scale)/2 return U:TweenSizeAndPosition(A,
|
||||||
Selected=false if B[G].GearReference and B[G].GearReference.Value and B[G].
|
UDim2.new(U.Position.X.Scale+V,U.Position.X.Offset,U.Position.Y.Scale+W,U.
|
||||||
GearReference.Value:IsA'HopperBin'and B[G].GearReference.Value.Active then B[G].
|
Position.Y.Offset),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,D/5,C)end end
|
||||||
GearReference.Value:ToggleSelect()end end end if E:IsA'HopperBin'then
|
local U U=function(V,W)if not W then return end W:ToggleSelect()if G[V]=='empty'
|
||||||
hopperBinSwitcher(D,E)else if E.Parent==i.Character then E.Parent=i.Backpack if
|
then return end if not W.Active then G[V].Selected=false return S(G[V])else G[V]
|
||||||
B[D]~='empty'then B[D].Selected=false normalizeButton(B[D])end else E.Parent=i.
|
.Selected=true return T(G[V])end end local V V=function(W)if not G[W]then return
|
||||||
Character B[D].Selected=true enlargeButton(B[D])end end end function
|
end local X=G[W].GearReference.Value if not(X~=nil)then return end R(X)local Y=W
|
||||||
activateGear(D)local E=nil if D=='0'then E=10 else E=tonumber(D)end if E==nil
|
if W==0 then Y=10 end for Z=1,#G do if G[Z]and G[Z]~='empty'and Z~=Y then S(G[Z]
|
||||||
then return end if B[E]~='empty'then toolSwitcher(E)end end enlargeButton=
|
)do local _=G[Z]_.Selected=false if _.GearReference and _.GearReference.Value
|
||||||
function(D)if D.Size.Y.Scale>1 then return end if not D.Parent then return end
|
and _.GearReference.Value:IsA'HopperBin'and _.GearReference.Value.Active then _.
|
||||||
if not D.Selected then return end for E=1,#B do if B[E]=='empty'then break end
|
GearReference.Value:ToggleSelect()end end end end if X:IsA'HopperBin'then return
|
||||||
if B[E]~=D then normalizeButton(B[E])end end if not x then return end if D:
|
U(W,X)else if X.Parent==n.Character then X.Parent=n.Backpack if G[W]~='empty'
|
||||||
FindFirstChild'Highlight'then D.Highlight.Visible=true end if D:IsA'ImageButton'
|
then G[W].Selected=false return S(G[W])end else X.Parent=n.Character G[W].
|
||||||
or D:IsA'TextButton'then D.ZIndex=5 local E,F=-(v.X.Scale-D.Size.X.Scale)/2,-(v.
|
Selected=true return T(G[W])end end end local W W=function(X)local Y if X=='0'
|
||||||
Y.Scale-D.Size.Y.Scale)/2 D:TweenSizeAndPosition(v,UDim2.new(D.Position.X.Scale+
|
then Y=10 else Y=tonumber(X)end if not(Y~=nil)then return end if G[Y]~='empty'
|
||||||
E,D.Position.X.Offset,D.Position.Y.Scale+F,D.Position.Y.Offset),Enum.
|
then return V(Y)end end local X X=function()for Y=1,#G do if G[Y]=='empty'then
|
||||||
EasingDirection.Out,Enum.EasingStyle.Quad,y/5,x)end end normalizeAllButtons=
|
break end if G[Y]~=button then S(G[Y],0.1)end end end local Y Y=function()while
|
||||||
function()for D=1,#B do if B[D]=='empty'then break end if B[D]~=button then
|
y do wait()end end local Z Z=function(_,aa,ab)if(_.x>aa.x and _.x<(aa.x+ab.x))or
|
||||||
normalizeButton(B[D],0.1)end end end normalizeButton=function(D,E)if not D then
|
(_.y>aa.y and _.y<(aa.y+ab.y))then return true end return false end local aa aa=
|
||||||
return end if D.Size.Y.Scale<=1 then return end if D.Selected then return end if
|
function(ab,_)local ac=_:GetChildren()if#ac==1 then if ac[1]:FindFirstChild
|
||||||
not D.Parent then return end local F=E if F==nil or type(F)~='number'then F=y/5
|
'SlotNumber'then local ad,ae=tonumber(ac[1].SlotNumber.Text),tonumber(ab.
|
||||||
end if D:FindFirstChild'Highlight'then D.Highlight.Visible=false end if D:IsA
|
SlotNumber.Text)if ad==0 then ad=10 end if ae==0 then ae=10 end G[ad]=ab G[ae]=
|
||||||
'ImageButton'or D:IsA'TextButton'then D.ZIndex=1 local G,H=-(w.X.Scale-D.Size.X.
|
ac[1]ac[1].SlotNumber.Text=ab.SlotNumber.Text ac[1].SlotNumberDownShadow.Text=ab
|
||||||
Scale)/2,-(w.Y.Scale-D.Size.Y.Scale)/2 D:TweenSizeAndPosition(w,UDim2.new(D.
|
.SlotNumber.Text ac[1].SlotNumberUpShadow.Text=ab.SlotNumber.Text local af=
|
||||||
Position.X.Scale+G,D.Position.X.Offset,D.Position.Y.Scale+H,D.Position.Y.Offset)
|
string.sub(_.Name,5)ab.SlotNumber.Text=af ab.SlotNumberDownShadow.Text=af ab.
|
||||||
,Enum.EasingDirection.Out,Enum.EasingStyle.Quad,F,x)end end local D=function()
|
SlotNumberUpShadow.Text=af ab.Position=UDim2.new(ab.Position.X.Scale,0,ab.
|
||||||
while t do wait()end end function pointInRectangle(E,F,G)if E.x>F.x and E.x<(F.x
|
Position.Y.Scale,0)ac[1].Position=UDim2.new(ac[1].Position.X.Scale,0,ac[1].
|
||||||
+G.x)then if E.y>F.y and E.y<(F.y+G.y)then return true end end return false end
|
Position.Y.Scale,0)ac[1].Parent=ab.Parent ab.Parent=_ end else local ad=
|
||||||
function swapGear(E,F)local G=F:GetChildren()if#G==1 then if G[1]:FindFirstChild
|
tonumber(ab.SlotNumber.Text)if ad==0 then ad=10 end G[ad]='empty'local ae=string
|
||||||
'SlotNumber'then local H,I=tonumber(G[1].SlotNumber.Text),tonumber(E.SlotNumber.
|
.sub(_.Name,5)ab.SlotNumber.Text=ae ab.SlotNumberDownShadow.Text=ae ab.
|
||||||
Text)if H==0 then H=10 end if I==0 then I=10 end B[H]=E B[I]=G[1]G[1].SlotNumber
|
SlotNumberUpShadow.Text=ae local af=tonumber(ab.SlotNumber.Text)if af==0 then af
|
||||||
.Text=E.SlotNumber.Text G[1].SlotNumberDownShadow.Text=E.SlotNumber.Text G[1].
|
=10 end G[af]=ab ab.Position=UDim2.new(ab.Position.X.Scale,0,ab.Position.Y.Scale
|
||||||
SlotNumberUpShadow.Text=E.SlotNumber.Text local J=string.sub(F.Name,5)E.
|
,0)ab.Parent=_ end end local ab ab=function(ac,ad,ae)local af,_=Vector2.new(ad,
|
||||||
SlotNumber.Text=J E.SlotNumberDownShadow.Text=J E.SlotNumberUpShadow.Text=J E.
|
ae),ac.Parent local ag=_.Parent:GetChildren()for ah=1,#ag do if ag[ah]:IsA
|
||||||
Position=UDim2.new(E.Position.X.Scale,0,E.Position.Y.Scale,0)G[1].Position=UDim2
|
'Frame'and Z(af,ag[ah].AbsolutePosition,ag[ah].AbsoluteSize)then aa(ac,ag[ah])
|
||||||
.new(G[1].Position.X.Scale,0,G[1].Position.Y.Scale,0)G[1].Parent=E.Parent E.
|
return true end end if(ad<_.AbsolutePosition.x or ad>(_.AbsolutePosition.x+_.
|
||||||
Parent=F end else local H=tonumber(E.SlotNumber.Text)if H==0 then H=10 end B[H]=
|
AbsoluteSize.x))or(ae<_.AbsolutePosition.y or ae>(_.AbsolutePosition.y+_.
|
||||||
'empty'local I=string.sub(F.Name,5)E.SlotNumber.Text=I E.SlotNumberDownShadow.
|
AbsoluteSize.y))then J(ac,false)return false else if dragBeginPos then ac.
|
||||||
Text=I E.SlotNumberUpShadow.Text=I local J=tonumber(E.SlotNumber.Text)if J==0
|
Position=dragBeginPos end return-1 end end local ac ac=function(ad)for ae=1,#G
|
||||||
then J=10 end B[J]=E E.Position=UDim2.new(E.Position.X.Scale,0,E.Position.Y.
|
do if G[ae]=='empty'then break end do local af=G[ae]if af.GearReference.Value
|
||||||
Scale,0)E.Parent=F end end function resolveDrag(E,F,G)local H,I=Vector2.new(F,G)
|
and af.GearReference.Value~=ad then if af.GearReference.Value:IsA'HopperBin'then
|
||||||
,E.Parent local J=I.Parent:GetChildren()for K=1,#J do if J[K]:IsA'Frame'then if
|
af.GearReference.Value:Disable()elseif af.GearReference.Value:IsA'Tool'then af.
|
||||||
pointInRectangle(H,J[K].AbsolutePosition,J[K].AbsoluteSize)then swapGear(E,J[K])
|
GearReference.Value.Parent=game.Players.LocalPlayer.Backpack end af.Selected=
|
||||||
return true end end end if(F<I.AbsolutePosition.x or F>(I.AbsolutePosition.x+I.
|
false end end end end local ad ad=function(ae,af)if ae and ae:FindFirstChild
|
||||||
AbsoluteSize.x))or(G<I.AbsolutePosition.y or G>(I.AbsolutePosition.y+I.
|
'ToolTipLabel'and ae.ToolTipLabel:IsA'TextLabel'and not k()then ae.ToolTipLabel.
|
||||||
AbsoluteSize.y))then reorganizeLoadout(E,false)return false else if dragBeginPos
|
Text=tostring(af)local ag=ae.ToolTipLabel.TextBounds.X+6 ae.ToolTipLabel.Size=
|
||||||
then E.Position=dragBeginPos end return-1 end end function unequipAllItems(E)for
|
UDim2.new(0,ag,0,20)ae.ToolTipLabel.Position=UDim2.new(0.5,-ag/2,0,-30)ae.
|
||||||
F=1,#B do if B[F]=='empty'then break end if B[F].GearReference.Value and B[F].
|
ToolTipLabel.Visible=true end end local ae ae=function(af,ag)if af and af:
|
||||||
GearReference.Value~=E then if B[F].GearReference.Value:IsA'HopperBin'then B[F].
|
FindFirstChild'ToolTipLabel'and af.ToolTipLabel:IsA'TextLabel'then af.
|
||||||
GearReference.Value:Disable()elseif B[F].GearReference.Value:IsA'Tool'then B[F].
|
ToolTipLabel.Visible=false end end local af af=function(ag)for ah=1,#F do if F[
|
||||||
GearReference.Value.Parent=game.Players.LocalPlayer.Backpack end B[F].Selected=
|
ah]==ag then table.remove(F,ah)F[ah]=nil end end end local ag ag=function(ah,_,
|
||||||
false end end end function showToolTip(E,F)if E and E:FindFirstChild
|
ai,aj)Y()y=true if ah:FindFirstChild'RobloxBuildTool'then y=false return end if
|
||||||
'ToolTipLabel'and E.ToolTipLabel:IsA'TextLabel'and not IsTouchDevice()then E.
|
not ah:IsA'Tool'and not ah:IsA'HopperBin'then y=false return end if not ai then
|
||||||
ToolTipLabel.Text=tostring(F)local G=E.ToolTipLabel.TextBounds.X+6 E.
|
for ak=1,#G do if G[ak]~='empty'and G[ak].GearReference.Value==ah then y=false
|
||||||
ToolTipLabel.Size=UDim2.new(0,G,0,20)E.ToolTipLabel.Position=UDim2.new(0.5,-G/2,
|
return end end end local ak=c.TempSlot:clone()ak.Name=ah.Name ak.GearImage.Image
|
||||||
0,-30)E.ToolTipLabel.Visible=true end end function hideToolTip(E,F)if E and E:
|
=ah.TextureId if ak.GearImage.Image==''then ak.GearText.Text=ah.Name end ak.
|
||||||
FindFirstChild'ToolTipLabel'and E.ToolTipLabel:IsA'TextLabel'then E.ToolTipLabel
|
GearReference.Value=ah ak.MouseEnter:connect(function()if ak.GearReference and
|
||||||
.Visible=false end end local E=function(E,F,G,H)D()t=true if E:FindFirstChild
|
ak.GearReference.Value['ToolTip']and ak.GearReference.Value.ToolTip~=''then
|
||||||
'RobloxBuildTool'then t=false return end if not E:IsA'Tool'then if not E:IsA
|
return ad(ak,ak.GearReference.Value.ToolTip)end end)ak.MouseLeave:connect(
|
||||||
'HopperBin'then t=false return end end if not G then for I=1,#B do if B[I]~=
|
function()if ak.GearReference and ak.GearReference.Value['ToolTip']and ak.
|
||||||
'empty'and B[I].GearReference.Value==E then t=false return end end end local I=a
|
GearReference.Value.ToolTip~=''then return ae(ak,ak.GearReference.Value.ToolTip)
|
||||||
.TempSlot:clone()I.Name=E.Name I.GearImage.Image=E.TextureId if I.GearImage.
|
end end)ak.RobloxLocked=true local al=-1 if not ai then for am=1,#G do if G[am]
|
||||||
Image==''then I.GearText.Text=E.Name end I.GearReference.Value=E I.MouseEnter:
|
=='empty'then al=am break end end else al=ai end if al==-1 then y=false return
|
||||||
connect(function()if I.GearReference and I.GearReference.Value['ToolTip']and I.
|
end local am=al%10 local an=c:FindFirstChild('Slot'..tostring(am))ak.Parent=an
|
||||||
GearReference.Value.ToolTip~=''then showToolTip(I,I.GearReference.Value.ToolTip)
|
if aj then local ao,ap=aj.AbsolutePosition,ak.AbsolutePosition local aq=ao-ap ak
|
||||||
end end)I.MouseLeave:connect(function()if I.GearReference and I.GearReference.
|
.Position=UDim2.new(ak.Position.X.Scale,aq.x,ak.Position.Y.Scale,aq.y)ak.ZIndex=
|
||||||
Value['ToolTip']and I.GearReference.Value.ToolTip~=''then hideToolTip(I,I.
|
4 end J(ak,(function()if ai then return true,_,ai else return true end end)())if
|
||||||
GearReference.Value.ToolTip)end end)I.RobloxLocked=true local J=-1 if not G then
|
not(ak.Parent~=nil)then y=false return end if _ then ak.Selected=true ac(ah)
|
||||||
for K=1,#B do if B[K]=='empty'then J=K break end end else J=G end if J==-1 then
|
delay(D+0.01,function()if ak:FindFirstChild'GearReference'and((ak.GearReference.
|
||||||
t=false return end local K=J%10 local L=a:FindFirstChild('Slot'..tostring(K))I.
|
Value:IsA'Tool'and ak.GearReference.Value.Parent==n.Character)or(ak.
|
||||||
Parent=L if H then local M,N=H.AbsolutePosition,I.AbsolutePosition local O=M-N I
|
GearReference.Value:IsA'HopperBin'and ak.GearReference.Value.Active==true))then
|
||||||
.Position=UDim2.new(I.Position.X.Scale,O.x,I.Position.Y.Scale,O.y)I.ZIndex=4 end
|
return T(ak)end end)end local ao,ap,aq,ar,as,at,au ap=ak.MouseButton1Click:
|
||||||
if G then reorganizeLoadout(I,true,F,G)else reorganizeLoadout(I,true)end if I.
|
connect(function()if N()then if not ak.Draggable then return W(ak.SlotNumber.
|
||||||
Parent==nil then t=false return end if F then I.Selected=true unequipAllItems(E)
|
Text)end end end)ar=ak.MouseEnter:connect(function()if p.Visible then ak.
|
||||||
delay(y+0.01,function()if I:FindFirstChild'GearReference'and((I.GearReference.
|
Draggable=true end end)au=ak.DragBegin:connect(function(av)ao=av ak.ZIndex=7
|
||||||
Value:IsA'Tool'and I.GearReference.Value.Parent==i.Character)or(I.GearReference.
|
local aw=ak:GetChildren()for ax=1,#aw do if aw[ax]:IsA'TextLabel'then if string.
|
||||||
Value:IsA'HopperBin'and I.GearReference.Value.Active==true))then enlargeButton(I
|
find(aw[ax].Name,'Shadow')then aw[ax].ZIndex=8 else aw[ax].ZIndex=9 end elseif
|
||||||
)end end)end local M,N,O,P,Q,R,S=nil,nil N=I.MouseButton1Click:connect(function(
|
aw[ax]:IsA'Frame'or aw[ax]:IsA'ImageLabel'then aw[ax].ZIndex=7 end end end)at=ak
|
||||||
)if characterInWorkspace()then if not I.Draggable then activateGear(I.SlotNumber
|
.DragStopped:connect(function(av,aw)if ak.Selected then ak.ZIndex=4 else ak.
|
||||||
.Text)end end end)P=I.MouseEnter:connect(function()if k.Visible then I.Draggable
|
ZIndex=3 end local ax=ak:GetChildren()for ay=1,#ax do if ax[ay]:IsA'TextLabel'
|
||||||
=true end end)S=I.DragBegin:connect(function(T)M=T I.ZIndex=7 local U=I:
|
then if string.find(ax[ay].Name,'Shadow')then ax[ay].ZIndex=3 else ax[ay].ZIndex
|
||||||
GetChildren()for V=1,#U do if U[V]:IsA'TextLabel'then if string.find(U[V].Name,
|
=4 end elseif ax[ay]:IsA'Frame'or ax[ay]:IsA'ImageLabel'then ax[ay].ZIndex=2 end
|
||||||
'Shadow')then U[V].ZIndex=8 else U[V].ZIndex=9 end elseif U[V]:IsA'Frame'or U[V]
|
end return ab(ak,av,aw)end)as=ak.MouseLeave:connect(function()ak.Draggable=false
|
||||||
:IsA'ImageLabel'then U[V].ZIndex=7 end end end)R=I.DragStopped:connect(function(
|
end)aq=ak.AncestryChanged:connect(function()if ak.Parent and ak.Parent.Parent==c
|
||||||
T,U)if I.Selected then I.ZIndex=4 else I.ZIndex=3 end local V=I:GetChildren()for
|
then return end if ap~=nil then ap:disconnect()end if aq~=nil then aq:
|
||||||
W=1,#V do if V[W]:IsA'TextLabel'then if string.find(V[W].Name,'Shadow')then V[W]
|
disconnect()end if ar~=nil then ar:disconnect()end if as~=nil then as:
|
||||||
.ZIndex=3 else V[W].ZIndex=4 end elseif V[W]:IsA'Frame'or V[W]:IsA'ImageLabel'
|
disconnect()end if at~=nil then at:disconnect()end if au~=nil then return au:
|
||||||
then V[W].ZIndex=2 end end resolveDrag(I,T,U)end)Q=I.MouseLeave:connect(function
|
disconnect()end return nil end)local av,aw av=ah.AncestryChanged:connect(
|
||||||
()I.Draggable=false end)O=I.AncestryChanged:connect(function()if I.Parent and I.
|
function(ax,ay)if not Q(ax,ay)then if av~=nil then av:disconnect()end if aw~=nil
|
||||||
Parent.Parent==a then return end if N then N:disconnect()end if O then O:
|
then aw:disconnect()end return af(ah)elseif ay==game.Players.LocalPlayer.
|
||||||
disconnect()end if P then P:disconnect()end if Q then Q:disconnect()end if R
|
Backpack then return S(ak)end end)aw=ah.Changed:connect(function(ax)if ax==
|
||||||
then R:disconnect()end if S then S:disconnect()end end)local T,U=nil,nil T=E.
|
'Name'then if ak and ak.GearImage.Image==''then ak.GearText.Text=ah.Name end
|
||||||
AncestryChanged:connect(function(V,W)if not checkToolAncestry(V,W)then if T then
|
elseif ax=='Active'then if ah and ah:IsA'HopperBin'then if not ah.Active then ak
|
||||||
T:disconnect()end if U then U:disconnect()end removeFromInventory(E)elseif W==
|
.Selected=false return S(ak)end end elseif ax=='TextureId'then ak.GearImage.
|
||||||
game.Players.LocalPlayer.Backpack then normalizeButton(I)end end)U=E.Changed:
|
Image=ah.TextureId end end)y=false return Spawn(function()while I()do wait(0.03)
|
||||||
connect(function(V)if V=='Name'then if I and I.GearImage.Image==''then I.
|
end for ax=1,#G do if G[ax]~='empty'then h.Position=UDim2.new(0.5,-60,1,-108)if
|
||||||
GearText.Text=E.Name end elseif V=='Active'then if E and E:IsA'HopperBin'then if
|
e then h.Visible=true j.Visible=true end end end end)end local ah ah=function(ai
|
||||||
not E.Active then I.Selected=false normalizeButton(I)end end elseif V==
|
)if not ai:IsA'Tool'or not ai:IsA'HopperBin'then return end local aj for ak=1,#F
|
||||||
'TextureId'then I.GearImage.Image=E.TextureId end end)t=false Spawn(function()
|
do if F[ak]and F[ak]==ai then return end if not F[ak]then aj=ak end end if aj
|
||||||
while backpackIsOpen()do wait(0.03)end for V=1,#B do if B[V]~='empty'then f.
|
then F[aj]=ai elseif#F<1 then F[1]=ai else F[#F+1]=ai end end local ai ai=
|
||||||
Position=UDim2.new(0.5,-60,1,-108)if c then f.Visible=true h.Visible=true end
|
function()local aj=c:GetChildren()for ak=1,#aj do if aj[ak]:IsA'Frame'then aj[ak
|
||||||
end end end)end function addToInventory(F)if not F:IsA'Tool'or not F:IsA
|
].BackgroundTransparency=0.5 local al=tonumber(string.sub(aj[ak].Name,5))if al==
|
||||||
'HopperBin'then return end local G=nil for H=1,#A do if A[H]and A[H]==F then
|
0 then al=10 end if f.AbsoluteSize.Y<=320 then aj[ak]:TweenPosition(UDim2.new(0,
|
||||||
return end if not A[H]then G=H end end if G then A[G]=F elseif#A<1 then A[1]=F
|
(al-1)*60,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)else aj[
|
||||||
else A[#A+1]=F end end function removeFromInventory(F)for G=1,#A do if A[G]==F
|
ak]:TweenPosition(UDim2.new((al-1)/10,0,0,0),Enum.EasingDirection.Out,Enum.
|
||||||
then table.remove(A,G)A[G]=nil end end end local F,G=function()loadoutChildren=a
|
EasingStyle.Quad,0.25,true)end end end end local aj aj=function()local ak,al,am=
|
||||||
:GetChildren()for F=1,#loadoutChildren do if loadoutChildren[F]:IsA'Frame'then
|
c:GetChildren(),{},nil for an=1,#ak do if ak[an]:IsA'Frame'then if#ak[an]:
|
||||||
loadoutChildren[F].BackgroundTransparency=0.5 local G=tonumber(string.sub(
|
GetChildren()>0 then if ak[an].Name=='Slot0'then am=ak[an]else table.insert(al,
|
||||||
loadoutChildren[F].Name,5))if G==0 then G=10 end if d.AbsoluteSize.Y<=320 then
|
ak[an])end end ak[an].BackgroundTransparency=1 end end if am then table.insert(
|
||||||
loadoutChildren[F]:TweenPosition(UDim2.new(0,(G-1)*60,0,0),Enum.EasingDirection.
|
al,am)end local an=(1-(#al*0.1))/2 for ao=1,#al do if f.AbsoluteSize.Y<=320 then
|
||||||
Out,Enum.EasingStyle.Quad,0.25,true)else loadoutChildren[F]:TweenPosition(UDim2.
|
an=0.5-(#al*0.333)/2 al[ao]:TweenPosition(UDim2.new(an+(ao-1)*0.33,0,0,0),Enum.
|
||||||
new((G-1)/10,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end
|
EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)else al[ao]:TweenPosition(
|
||||||
end end end,function()loadoutChildren=a:GetChildren()local F,G={},nil for H=1,#
|
UDim2.new(an+((ao-1)*0.1),0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,
|
||||||
loadoutChildren do if loadoutChildren[H]:IsA'Frame'then if#loadoutChildren[H]:
|
0.25,true)end end end local ak ak=function()H=true if u then return ai()end end
|
||||||
GetChildren()>0 then if loadoutChildren[H].Name=='Slot0'then G=loadoutChildren[H
|
local al al=function()if not u then return aj()end end local am am=function()if
|
||||||
]else table.insert(F,loadoutChildren[H])end end loadoutChildren[H].
|
x~=nil then x:disconnect()end x=nil x=n.Backpack.ChildAdded:connect(function(an)
|
||||||
BackgroundTransparency=1 end end if G then table.insert(F,G)end local H=(1-(#F*
|
if not E then E=true if e then h.Visible=true j.Visible=true end end ag(an)
|
||||||
0.1))/2 for I=1,#F do if d.AbsoluteSize.Y<=320 then H=(0.5-(#F*0.333)/2)F[I]:
|
return ah(an)end)end local an an=function(ao)ag(ao,true)return ah(ao)end local
|
||||||
TweenPosition(UDim2.new(H+(I-1)*0.33,0,0,0),Enum.EasingDirection.Out,Enum.
|
ao ao=function()c.Visible=true end local ap ap=function()c.Visible=false end
|
||||||
EasingStyle.Quad,0.25,true)else F[I]:TweenPosition(UDim2.new(H+((I-1)*0.1),0,0,0
|
local aq aq=function(ar)u=ar if ar then return ak()else return al()end end local
|
||||||
),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end end function
|
ar ar=function(as,at)if as==Enum.CoreGuiType.Backpack or as==Enum.CoreGuiType.
|
||||||
editLoadout()C=true if p then F()end end function readonlyLoadout()if not p then
|
All then h.Visible=at j.Visible=at e=at if at then L()else M()end end if as==
|
||||||
G()end end function setupBackpackListener()if s then s:disconnect()s=nil end s=i
|
Enum.CoreGuiType.Health or as==Enum.CoreGuiType.All then return m(game.Players.
|
||||||
.Backpack.ChildAdded:connect(function(H)if not z then z=true if c then f.Visible
|
LocalPlayer.PlayerGui,at)end end L()pcall(function()ar(Enum.CoreGuiType.Backpack
|
||||||
=true h.Visible=true end end E(H)addToInventory(H)end)end function
|
,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))ar(Enum.
|
||||||
playerCharacterChildAdded(H)E(H,true)addToInventory(H)end function
|
CoreGuiType.Health,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health))
|
||||||
activateLoadout()a.Visible=true end function deactivateLoadout()a.Visible=false
|
return Game.StarterGui.CoreGuiChangedSignal:connect(ar)end)wait()a(n,'Backpack')
|
||||||
end function tabHandler(H)p=H if H then editLoadout()else readonlyLoadout()end
|
b(n,'Character')delay(1,function()local as=n.Backpack:GetChildren()local at=math
|
||||||
end function coreGuiChanged(H,I)if H==Enum.CoreGuiType.Backpack or H==Enum.
|
.min(10,#as)for au=1,at do if e then h.Visible=true j.Visible=true end ag(as[au]
|
||||||
CoreGuiType.All then f.Visible=I h.Visible=I c=I if I then registerNumberKeys()
|
,false)end return am()end)delay(2,function()if not H then if f.AbsoluteSize.Y<=
|
||||||
else unregisterNumberKeys()end end if H==Enum.CoreGuiType.Health or H==Enum.
|
320 then local as=c:GetChildren()for at=1,#as do local au=tonumber(string.sub(as
|
||||||
CoreGuiType.All then setHealthBarVisible(game.Players.LocalPlayer.PlayerGui,I)
|
[at].Name,5,string.len(as[at].Name)))if type(au)=='number'then as[at].Position=
|
||||||
end end registerNumberKeys()pcall(function()coreGuiChanged(Enum.CoreGuiType.
|
UDim2.new(0,(au-1)*60,0,0)end end end end return wait(0.25)end)n.ChildAdded:
|
||||||
Backpack,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))
|
connect(function(as)if as:IsA'PlayerGui'then return l(as)end end)b(n,'Character'
|
||||||
coreGuiChanged(Enum.CoreGuiType.Health,Game.StarterGui:GetCoreGuiEnabled(Enum.
|
)for as,at in ipairs(n.Character:GetChildren())do an(at)end w=n.Character.
|
||||||
CoreGuiType.Health))Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
ChildAdded:connect(function(au)return an(au)end)a(n.Character,'Humanoid')local
|
||||||
end)wait()waitForChild(i,'Backpack')waitForProperty(i,'Character')delay(1,
|
au=n.Character.Humanoid.Died:connect(function()do local au=humanoidDiedCon if au
|
||||||
function()local H=i.Backpack:GetChildren()local I=math.min(10,#H)for J=1,I do if
|
~=nil then au:disconnect()end end humanoidDiedCon=nil ap()if x~=nil then x:
|
||||||
c then f.Visible=true h.Visible=true end E(H[J],false)end setupBackpackListener(
|
disconnect()end x=nil H=false end)n.CharacterRemoving:connect(function()for av=1
|
||||||
)end)delay(2,function()if not C then if d.AbsoluteSize.Y<=320 then local H=a:
|
,#G do if G[av]~='empty'then G[av].Parent=nil G[av]='empty'end end end)n.
|
||||||
GetChildren()for I=1,#H do local J=tonumber(string.sub(H[I].Name,5,string.len(H[
|
CharacterAdded:connect(function()b(game.Players,'LocalPlayer')n=game.Players.
|
||||||
I].Name)))if type(J)=='number'then H[I].Position=UDim2.new(0,(J-1)*60,0,0)end
|
LocalPlayer a(n,'Backpack')delay(1,function()local av=n.Backpack:GetChildren()
|
||||||
end end end wait(0.25)end)i.ChildAdded:connect(function(H)if H:IsA'PlayerGui'
|
local aw=math.min(10,#av)for ax=1,aw do if e then h.Visible=true j.Visible=true
|
||||||
then moveHealthBar(H)end end)waitForProperty(i,'Character')for H,I in ipairs(i.
|
end ag(av[ax],false)end return am()end)ao()if w~=nil then w:disconnect()end w=n.
|
||||||
Character:GetChildren())do playerCharacterChildAdded(I)end r=i.Character.
|
Character.ChildAdded:connect(function(av)return ag(av,true)end)a(n.Character,
|
||||||
ChildAdded:connect(function(J)playerCharacterChildAdded(J)end)waitForChild(i.
|
'Humanoid')if i.Visible then r:Fire()end au=n.Character.Humanoid.Died:connect(
|
||||||
Character,'Humanoid')humanoidDiedCon=i.Character.Humanoid.Died:connect(function(
|
function()if e then h.Visible=false j.Visible=false end E=false ap()if au~=nil
|
||||||
)if humanoidDiedCon then humanoidDiedCon:disconnect()humanoidDiedCon=nil end
|
then au:disconnect()end au=nil if x~=nil then x:disconnect()end x=nil end)a(n,
|
||||||
deactivateLoadout()if s then s:disconnect()s=nil end C=false end)i.
|
'PlayerGui')l(n.PlayerGui)return delay(2,function()if(not H)and(f.AbsoluteSize.Y
|
||||||
CharacterRemoving:connect(function()for J=1,#B do if B[J]~='empty'then B[J].
|
<=320)then local av=c:GetChildren()for aw=1,#av do local ax=tonumber(string.sub(
|
||||||
Parent=nil B[J]='empty'end end end)i.CharacterAdded:connect(function()
|
av[aw].Name,5,string.len(av[aw].Name)))if type(ax)=='number'then av[aw].Position
|
||||||
waitForProperty(game.Players,'LocalPlayer')i=game.Players.LocalPlayer
|
=UDim2.new(0,(ax-1)*60,0,0)end end end return wait(0.25)end)end)a(p,'SwapSlot')p
|
||||||
waitForChild(i,'Backpack')delay(1,function()local J=i.Backpack:GetChildren()
|
.SwapSlot.Changed:connect(function()if p.SwapSlot.Value then local av=p.SwapSlot
|
||||||
local K=math.min(10,#J)for L=1,K do if c then f.Visible=true h.Visible=true end
|
local aw=av.Slot.Value if aw==0 then aw=10 end if G[aw]then J(G[aw],false)end if
|
||||||
E(J[L],false)end setupBackpackListener()end)activateLoadout()if r then r:
|
av.GearButton.Value then ag(av.GearButton.Value.GearReference.Value,false,aw)end
|
||||||
disconnect()r=nil end r=i.Character.ChildAdded:connect(function(J)E(J,true)end)
|
p.SwapSlot.Value=false end end)game:GetService'GuiService'.KeyPressed:connect(
|
||||||
waitForChild(i.Character,'Humanoid')if g.Visible then m:Fire()end
|
function(av)if N()then return W(av)end end)r.Event:connect(ak)s.Event:connect(aj
|
||||||
humanoidDiedCon=i.Character.Humanoid.Died:connect(function()if c then f.Visible=
|
)return t.Event:connect(function(av)return aq(av==d)end)
|
||||||
false h.Visible=false end z=false deactivateLoadout()if humanoidDiedCon then
|
|
||||||
humanoidDiedCon:disconnect()humanoidDiedCon=nil end if s then s:disconnect()s=
|
|
||||||
nil end end)waitForChild(i,'PlayerGui')moveHealthBar(i.PlayerGui)delay(2,
|
|
||||||
function()if not C then if d.AbsoluteSize.Y<=320 then local J=a:GetChildren()for
|
|
||||||
K=1,#J do local L=tonumber(string.sub(J[K].Name,5,string.len(J[K].Name)))if
|
|
||||||
type(L)=='number'then J[K].Position=UDim2.new(0,(L-1)*60,0,0)end end end end
|
|
||||||
wait(0.25)end)end)waitForChild(k,'SwapSlot')k.SwapSlot.Changed:connect(function(
|
|
||||||
)if k.SwapSlot.Value then local J=k.SwapSlot local K=J.Slot.Value if K==0 then K
|
|
||||||
=10 end if B[K]then reorganizeLoadout(B[K],false)end if J.GearButton.Value then
|
|
||||||
E(J.GearButton.Value.GearReference.Value,false,K)end k.SwapSlot.Value=false end
|
|
||||||
end)game:GetService'GuiService'.KeyPressed:connect(function(J)if
|
|
||||||
characterInWorkspace()then activateGear(J)end end)m.Event:connect(editLoadout)n.
|
|
||||||
Event:connect(G)o.Event:connect(function(J)tabHandler(J==b)end)
|
|
||||||
|
|
@ -1,163 +1,164 @@
|
||||||
local a,b,c={},assert,{buffer={}}function c:New()local d={}setmetatable(d,self)
|
local a,b={},nil b=function(c,d,e)if not(e~=nil)then e=d d=nil end local f=
|
||||||
self.__index=self d.buffer={}return d end function c:Append(d)self.buffer[#self.
|
Instance.new(c)if d then f.Name=d end local g for h,i in pairs(e)do if type(h)==
|
||||||
buffer+1]=d end function c:ToString()return table.concat(self.buffer)end local d
|
'string'then if h=='Parent'then g=i else f[h]=i end elseif type(h)=='number'and
|
||||||
={backslashes={['\b']='\\b',['\t']='\\t',['\n']='\\n',['\f']='\\f',['\r']='\\r',
|
type(i)=='userdata'then i.Parent=f end end f.Parent=g return f end local c,d=
|
||||||
['"']='\\"',['\\']='\\\\',['/']='\\/'}}function d:New()local e={}e.writer=c:New(
|
assert,nil d=function()return d end local e={buffer={}}e.New=function(f)local g=
|
||||||
)setmetatable(e,self)self.__index=self return e end function d:Append(e)self.
|
setmetatable({},f)f.__index=f g.buffer={}return g end e.Append=function(f,g)do
|
||||||
writer:Append(e)end function d:ToString()return self.writer:ToString()end
|
local h=f.buffer h[#h+1]=g end end e.ToString=function(f)return table.concat(f.
|
||||||
function d:Write(e)local f=type(e)if f=='nil'then self:WriteNil()elseif f==
|
buffer)end local f={backslashes={['\b']='\\b',['\t']='\\t',['\n']='\\n',['\f']=
|
||||||
'boolean'or f=='number'then self:WriteString(e)elseif f=='string'then self:
|
'\\f',['\r']='\\r',['"']='\\"',['\\']='\\\\',['/']='\\/'}}f.New=function(g)local
|
||||||
ParseString(e)elseif f=='table'then self:WriteTable(e)elseif f=='function'then
|
h=setmetatable({},g)h.writer=e:New()g.__index=g return h end f.Append=function(g
|
||||||
self:WriteFunction(e)elseif f=='thread'or f=='userdata'then self:WriteError(e)
|
,h)return g.writer:Append(h)end f.ToString=function(g)return g.writer:ToString()
|
||||||
end end function d:WriteNil()self:Append'null'end function d:WriteString(e)self:
|
end f.Write=function(g,h)local i=type(h)if'nil'==i then return g:WriteNil()
|
||||||
Append(tostring(e))end function d:ParseString(e)self:Append'"'self:Append(string
|
elseif'boolean'==i or'number'==i then return g:WriteString(h)elseif'string'==i
|
||||||
.gsub(e,'[%z%c\\"/]',function(f)local g=self.backslashes[f]if g then return g
|
then return g:ParseString(h)elseif'table'==i then return g:WriteTable(h)elseif
|
||||||
end return string.format('\\u%.4X',string.byte(f))end))self:Append'"'end
|
'function'==i then return g:WriteFunction(h)elseif'thread'==i or'userdata'==i
|
||||||
function d:IsArray(e)local f,g=0,function(f)if type(f)=='number'and f>0 then if
|
then return g:WriteError(h)end end f.WriteNil=function(g)return g:Append'null'
|
||||||
math.floor(f)==f then return true end end return false end for h,i in pairs(e)do
|
end f.WriteString=function(g,h)return g:Append(tostring(h))end f.ParseString=
|
||||||
if not g(h)then return false,'{','}'else f=math.max(f,h)end end return true,'[',
|
function(g,h)g:Append'"'g:Append(string.gsub(h,'[%z%c\\"/]',function(i)local j=g
|
||||||
']',f end function d:WriteTable(e)local f,g,h,i=self:IsArray(e)self:Append(g)if
|
.backslashes[i]if j then return j end return string.format('\\u%.4X',string.
|
||||||
f then for j=1,i do self:Write(e[j])if j<i then self:Append','end end else local
|
byte(i))end))return g:Append'"'end f.IsArray=function(g,h)local i,j=0,nil j=
|
||||||
j=true for k,l in pairs(e)do if not j then self:Append','end j=false self:
|
function(k)if type(k)=='number'and k>0 and math.floor(k)==k then return true end
|
||||||
ParseString(k)self:Append':'self:Write(l)end end self:Append(h)end function d:
|
return false end for k,l in pairs(h)do if not j(k)then return false,'{','}'else
|
||||||
WriteError(e)error(string.format('Encoding of %s unsupported',tostring(e)))end
|
i=math.max(i,k)end end return true,'[',']',i end f.WriteTable=function(g,h)local
|
||||||
function d:WriteFunction(e)if e==Null then self:WriteNil()else self:WriteError(e
|
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
|
||||||
)end end local e={s='',i=0}function e:New(f)local g={}setmetatable(g,self)self.
|
:Append','end end else local m=true for n,o in pairs(h)do if not m then g:Append
|
||||||
__index=self g.s=f or g.s return g end function e:Peek()local f=self.i+1 if f<=#
|
','end m=false g:ParseString(n)g:Append':'g:Write(o)end end return g:Append(k)
|
||||||
self.s then return string.sub(self.s,f,f)end return nil end function e:Next()
|
end f.WriteError=function(g,h)return error(string.format(
|
||||||
self.i=self.i+1 if self.i<=#self.s then return string.sub(self.s,self.i,self.i)
|
'Encoding of %s unsupported',tostring(h)))end f.WriteFunction=function(g,h)if h
|
||||||
end return nil end function e:All()return self.s end local f={escapes={['t']=
|
==d then return g:WriteNil()else return g:WriteError(h)end end local g={s='',i=0
|
||||||
'\t',['n']='\n',['f']='\f',['r']='\r',['b']='\b'}}function f:New(g)local h={}h.
|
}g.New=function(h,i)local j=setmetatable({},h)h.__index=h j.s=i or j.s return j
|
||||||
reader=e:New(g)setmetatable(h,self)self.__index=self return h end function f:
|
end g.Peek=function(h)local i=h.i+1 if i<=#h.s then return string.sub(h.s,i,i)
|
||||||
Read()self:SkipWhiteSpace()local g=self:Peek()if g==nil then error(string.
|
end return nil end g.Next=function(h)h.i=h.i+1 if h.i<=#h.s then return string.
|
||||||
format("Nil string: '%s'",self:All()))elseif g=='{'then return self:ReadObject()
|
sub(h.s,h.i,h.i)end return nil end g.All=function(h)return h.s end local h={
|
||||||
elseif g=='['then return self:ReadArray()elseif g=='"'then return self:
|
escapes={['t']='\t',['n']='\n',['f']='\f',['r']='\r',['b']='\b'}}h.New=function(
|
||||||
ReadString()elseif string.find(g,'[%+%-%d]')then return self:ReadNumber()elseif
|
i,j)local k=setmetatable({},i)k.reader=g:New(j)i.__index=i return k end h.Read=
|
||||||
g=='t'then return self:ReadTrue()elseif g=='f'then return self:ReadFalse()elseif
|
function(i)i:SkipWhiteSpace()local j=i:Peek()if not(j~=nil)then return error(
|
||||||
g=='n'then return self:ReadNull()elseif g=='/'then self:ReadComment()return self
|
string.format("Nil string: '%s'",i:All()))elseif j=='{'then return i:ReadObject(
|
||||||
:Read()else return nil end end function f:ReadTrue()self:TestReservedWord{'t',
|
)elseif j=='['then return i:ReadArray()elseif j=='"'then return i:ReadString()
|
||||||
'r','u','e'}return true end function f:ReadFalse()self:TestReservedWord{'f','a',
|
elseif string.find(j,'[%+%-%d]')then return i:ReadNumber()elseif j=='t'then
|
||||||
'l','s','e'}return false end function f:ReadNull()self:TestReservedWord{'n','u',
|
return i:ReadTrue()elseif j=='f'then return i:ReadFalse()elseif j=='n'then
|
||||||
'l','l'}return nil end function f:TestReservedWord(g)for h,i in ipairs(g)do if
|
return i:ReadNull()elseif j=='/'then i:ReadComment()return i:Read()else return
|
||||||
self:Next()~=i then error(string.format("Error reading '%s': %s",table.concat(g)
|
nil end end h.ReadTrue=function(i)i:TestReservedWord{'t','r','u','e'}return true
|
||||||
,self:All()))end end end function f:ReadNumber()local g,h=self:Next(),self:Peek(
|
end h.ReadFalse=function(i)i:TestReservedWord{'f','a','l','s','e'}return false
|
||||||
)while h~=nil and string.find(h,'[%+%-%d%.eE]')do g=g..self:Next()h=self:Peek()
|
end h.ReadNull=function(i)i:TestReservedWord{'n','u','l','l'}return nil end h.
|
||||||
end g=tonumber(g)if g==nil then error(string.format("Invalid number: '%s'",g))
|
TestReservedWord=function(i,j)for k,l in ipairs(j)do if i:Next()~=l then error(
|
||||||
else return g end end function f:ReadString()local g=''b(self:Next()=='"')while
|
string.format("Error reading '%s': %s",table.concat(j),i:All()))end end end h.
|
||||||
self:Peek()~='"'do local h=self:Next()if h=='\\'then h=self:Next()if self.
|
ReadNumber=function(i)local j,k=i:Next(),i:Peek()while(k~=nil)and string.find(k,
|
||||||
escapes[h]then h=self.escapes[h]end end g=g..h end b(self:Next()=='"')local h=
|
'[%+%-%d%.eE]')do j=j..i:Next()k=i:Peek()end j=tonumber(j)if not(j~=nil)then
|
||||||
function(h)return string.char(tonumber(h,16))end return string.gsub(g,
|
return error(string.format("Invalid number: '%s'",j))else return j end end h.
|
||||||
'u%x%x(%x%x)',h)end function f:ReadComment()b(self:Next()=='/')local g=self:
|
ReadString=function(i)local j=''c(i:Next()=='"')while i:Peek()~='"'do local k=i:
|
||||||
Next()if g=='/'then self:ReadSingleLineComment()elseif g=='*'then self:
|
Next()if k=='\\'then k=i:Next()if i.escapes[k]then k=i.escapes[k]end end j=j..k
|
||||||
ReadBlockComment()else error(string.format('Invalid comment: %s',self:All()))end
|
end c(i:Next()=='"')local k k=function(l)return string.char(tonumber(l,16))end
|
||||||
end function f:ReadBlockComment()local g=false while not g do local h=self:Next(
|
return string.gsub(j,'u%x%x(%x%x)',k)end h.ReadComment=function(i)c(i:Next()==
|
||||||
)if h=='*'and self:Peek()=='/'then g=true end if not g and h=='/'and self:Peek()
|
'/')local j=i:Next()if j=='/'then return i:ReadSingleLineComment()elseif j=='*'
|
||||||
=='*'then error(string.format("Invalid comment: %s, '/*' illegal.",self:All()))
|
then return i:ReadBlockComment()else return error(string.format(
|
||||||
end end self:Next()end function f:ReadSingleLineComment()local g=self:Next()
|
'Invalid comment: %s',i:All()))end end h.ReadBlockComment=function(i)local j=
|
||||||
while g~='\r'and g~='\n'do g=self:Next()end end function f:ReadArray()local g={}
|
false while not j do local k=i:Next()if k=='*'and i:Peek()=='/'then j=true end
|
||||||
b(self:Next()=='[')local h=false if self:Peek()==']'then h=true end while not h
|
if not j and k=='/'and i:Peek()=='*'then error(string.format(
|
||||||
do local i=self:Read()g[#g+1]=i self:SkipWhiteSpace()if self:Peek()==']'then h=
|
"Invalid comment: %s, '/*' illegal.",i:All()))end end return i:Next()end h.
|
||||||
true end if not h then local j=self:Next()if j~=','then error(string.format(
|
ReadSingleLineComment=function(i)local j=i:Next()while j~='\r'and j~='\n'do j=i:
|
||||||
"Invalid array: '%s' due to: '%s'",self:All(),j))end end end b(']'==self:Next())
|
Next()end end h.ReadArray=function(i)local j={}c(i:Next()=='[')local k=false if
|
||||||
return g end function f:ReadObject()local g={}b(self:Next()=='{')local h=false
|
i:Peek()==']'then k=true end while not k do local l=i:Read()j[#j+1]=l i:
|
||||||
if self:Peek()=='}'then h=true end while not h do local i=self:Read()if type(i)
|
SkipWhiteSpace()if i:Peek()==']'then k=true end if not k then local m=i:Next()if
|
||||||
~='string'then error(string.format('Invalid non-string object key: %s',i))end
|
m~=','then error(string.format("Invalid array: '%s' due to: '%s'",i:All(),m))end
|
||||||
self:SkipWhiteSpace()local j=self:Next()if j~=':'then error(string.format(
|
end end c(']'==i:Next())return j end h.ReadObject=function(i)local j={}c(i:Next(
|
||||||
"Invalid object: '%s' due to: '%s'",self:All(),j))end self:SkipWhiteSpace()local
|
)=='{')local k=false if i:Peek()=='}'then k=true end while not k do local l=i:
|
||||||
k=self:Read()g[i]=k self:SkipWhiteSpace()if self:Peek()=='}'then h=true end if
|
Read()if type(l)~='string'then error(string.format(
|
||||||
not h then j=self:Next()if j~=','then error(string.format(
|
'Invalid non-string object key: %s',l))end i:SkipWhiteSpace()local m=i:Next()if
|
||||||
"Invalid array: '%s' near: '%s'",self:All(),j))end end end b(self:Next()=='}')
|
m~=':'then error(string.format("Invalid object: '%s' due to: '%s'",i:All(),m))
|
||||||
return g end function f:SkipWhiteSpace()local g=self:Peek()while g~=nil and
|
end i:SkipWhiteSpace()local n=i:Read()j[l]=n i:SkipWhiteSpace()if i:Peek()=='}'
|
||||||
string.find(g,'[%s/]')do if g=='/'then self:ReadComment()else self:Next()end g=
|
then k=true end if not k then m=i:Next()if m~=','then error(string.format(
|
||||||
self:Peek()end end function f:Peek()return self.reader:Peek()end function f:Next
|
"Invalid array: '%s' near: '%s'",i:All(),m))end end end c(i:Next()=='}')return j
|
||||||
()return self.reader:Next()end function f:All()return self.reader:All()end
|
end h.SkipWhiteSpace=function(i)local j=i:Peek()while(j~=nil)and string.find(j,
|
||||||
function Encode(g)local h=d:New()h:Write(g)return h:ToString()end function
|
'[%s/]')do if j=='/'then i:ReadComment()else i:Next()end j=i:Peek()end end h.
|
||||||
Decode(g)local h=f:New(g)return h:Read()end function Null()return Null end a.
|
Peek=function(i)return i.reader:Peek()end h.Next=function(i)return i.reader:
|
||||||
DecodeJSON=function(g)pcall(function()warn
|
Next()end h.All=function(i)return i.reader:All()end local i i=function(j)local k
|
||||||
[[RbxUtility.DecodeJSON is deprecated, please use Game:GetService('HttpService'):JSONDecode() instead.]]
|
=f:New()k:Write(j)k:ToString()return k end local j j=function(k)local l=h:New(k)
|
||||||
end)if type(g)=='string'then return Decode(g)end print
|
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=
|
'RbxUtil.DecodeJSON expects string argument!'return nil end a.EncodeJSON=
|
||||||
function(g)pcall(function()warn
|
function(k)pcall(function()return warn
|
||||||
[[RbxUtility.EncodeJSON is deprecated, please use Game:GetService('HttpService'):JSONEncode() instead.]]
|
[[RbxUtility.EncodeJSON is deprecated, please use Game:GetService("HttpService"):JSONEncode() instead.]]
|
||||||
end)return Encode(g)end a.MakeWedge=function(g,h,i,j)return game:GetService
|
end)return i(k)end a.MakeWedge=function(k,l,m,n)return game:GetService'Terrain':
|
||||||
'Terrain':AutoWedgeCell(g,h,i)end a.SelectTerrainRegion=function(g,h,i,j)local k
|
AutoWedgeCell(k,l,m)end a.SelectTerrainRegion=function(k,l,m,n)local o=game.
|
||||||
=game.Workspace:FindFirstChild'Terrain'if not k then return end b(g)b(h)if not
|
Workspace:FindFirstChild'Terrain'if not o then return end c(k)c(l)if not type(k)
|
||||||
type(g)=='Region3'then error(
|
=='Region3'then error(
|
||||||
[[regionToSelect (first arg), should be of type Region3, but is type]],type(g))
|
[[regionToSelect (first arg), should be of type Region3, but is type]],type(k))
|
||||||
end if not type(h)=='BrickColor'then error(
|
end if not type(l)=='BrickColor'then error(
|
||||||
[[color (second arg), should be of type BrickColor, but is type]],type(h))end
|
[[color (second arg), should be of type BrickColor, but is type]],type(l))end
|
||||||
local l,m,n,o,p=k.GetCell,k.WorldToCellPreferSolid,k.CellCenterToWorld,Enum.
|
local p,q,r,s,t,u,v,w,x,y,z,A,B,C=o.GetCell,o.WorldToCellPreferSolid,o.
|
||||||
CellMaterial.Empty,Instance.new'Model'p.Name='SelectionContainer'p.Archivable=
|
CellCenterToWorld,Enum.CellMaterial.Empty,b('Model','SelectionContainer',{
|
||||||
false if j then p.Parent=j else p.Parent=game.Workspace end local q,r,s,t,u,v,w=
|
Archivable=false,Parent=(function()if n then return n else return game.Workspace
|
||||||
nil,nil,0,nil,{},{},Instance.new'Part'w.Name='SelectionPart'w.Transparency=1 w.
|
end end)()}),nil,nil,0,nil,{},{},b('Part','SelectionPart',{Transparency=1,
|
||||||
Anchored=true w.Locked=true w.CanCollide=false w.Size=Vector3.new(4.2,4.2,4.2)
|
Anchored=true,Locked=true,CanCollide=false,Size=Vector3.new(4.2,4.2,4.2)}),
|
||||||
local x=Instance.new'SelectionBox'function createAdornment(y)local z,A=nil,nil
|
Instance.new'SelectionBox',nil C=function(D)local E,F if#z>0 then E=z[1]['part']
|
||||||
if#v>0 then z=v[1]['part']A=v[1]['box']table.remove(v,1)A.Visible=true else z=w:
|
F=z[1]['box']table.remove(z,1)F.Visible=true else E=A:Clone()E.Archivable=false
|
||||||
Clone()z.Archivable=false A=x:Clone()A.Archivable=false A.Adornee=z A.Parent=p A
|
F=B:Clone()F.Archivable=false F.Adornee=E F.Parent=t F.Adornee=E F.Parent=t end
|
||||||
.Adornee=z A.Parent=p end if y then A.Color=y end return z,A end function
|
if D then F.Color=D end return E,F end local D D=function()for E,F in pairs(y)do
|
||||||
cleanUpAdornments()for y,z in pairs(u)do if z.KeepAlive~=r then z.SelectionBox.
|
if F.KeepAlive~=v then F.SelectionBox.Visible=false table.insert(z,{part=F.
|
||||||
Visible=false table.insert(v,{part=z.SelectionPart,box=z.SelectionBox})u[y]=nil
|
SelectionPart,box=F.SelectionBox})y[E]=nil end end end local E E=function()w=w+1
|
||||||
end end end function incrementAliveCounter()s=s+1 if s>1000000 then s=0 end
|
if w>1000000 then w=0 end return w end local F F=function(G,H)local I,J=G.CFrame
|
||||||
return s end function adornFullCellsInRegion(y,z)local A,B=y.CFrame.p-(y.Size/2)
|
.p-G.Size/2+Vector3.new(2,2,2),G.CFrame.p+G.Size/2-Vector3.new(2,2,2)local K,L=
|
||||||
+Vector3.new(2,2,2),y.CFrame.p+(y.Size/2)-Vector3.new(2,2,2)local C,D=m(k,A),m(k
|
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
|
||||||
,B)r=incrementAliveCounter()for E=C.y,D.y do for F=C.z,D.z do for G=C.x,D.x do
|
,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
|
||||||
local H=l(k,G,E,F)if H~=o then local I,J,K=n(k,G,E,F),Vector3int16.new(G,E,F),
|
in pairs(y)do if T==R then U.KeepAlive=v if H then U.SelectionBox.Color=H end S=
|
||||||
false for L,M in pairs(u)do if L==J then M.KeepAlive=r if z then M.SelectionBox.
|
true break end end if not S then local V,W V,W=C(H)V.Size=Vector3.new(4,4,4)V.
|
||||||
Color=z end K=true break end end if not K then local N,O=createAdornment(z)N.
|
CFrame=CFrame.new(Q)local X={SelectionPart=V,SelectionBox=W,KeepAlive=v}y[R]=X
|
||||||
Size=Vector3.new(4,4,4)N.CFrame=CFrame.new(I)local P={SelectionPart=N,
|
end end end end end return D()end x=k if m then local G,H G,H=C(l)G.Size=k.Size
|
||||||
SelectionBox=O,KeepAlive=r}u[J]=P end end end end end cleanUpAdornments()end t=g
|
G.CFrame=k.CFrame y.SelectionPart=G y.SelectionBox=H u=function(I,J)if I and I~=
|
||||||
if i then local y,z=createAdornment(h)y.Size=g.Size y.CFrame=g.CFrame u.
|
x then x=I G.Size=I.Size G.CFrame=I.CFrame end if J then H.Color=J end end else
|
||||||
SelectionPart=y u.SelectionBox=z q=function(A,B)if A and A~=t then t=A y.Size=A.
|
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=
|
||||||
Size y.CFrame=A.CFrame end if B then z.Color=B end end else
|
function()u=nil if t~=nil then t:Destroy()end y=nil end return u,G end a.
|
||||||
adornFullCellsInRegion(g,h)q=function(y,z)if y and y~=t then t=y
|
CreateSignal=function()local k,l,m={},Instance.new'BindableEvent',{}k.connect=
|
||||||
adornFullCellsInRegion(y,z)end end end local y=function()q=nil if p then p:
|
function(n,o)if n~=k then error('connect must be called with `:`, not `.`',2)end
|
||||||
Destroy()end u=nil end return q,y end function a.CreateSignal()local g,h,i={},
|
if type(o)~='function'then error(
|
||||||
Instance.new'BindableEvent',{}function g:connect(j)if self~=g then error(
|
'Argument #1 of connect must be a function, got a '..tostring(type(o)),2)end
|
||||||
'connect must be called with `:`, not `.`',2)end if type(j)~='function'then
|
local p=l.Event:connect(o)m[p]=true local q={}q.disconnect=function(r)p:
|
||||||
error('Argument #1 of connect must be a function, got a '..type(j),2)end local k
|
disconnect()m[p]=nil end q.Disconnect=q.disconnect return q end k.disconnect=
|
||||||
=h.Event:connect(j)i[k]=true local l={}function l:disconnect()k:disconnect()i[k]
|
function(n)if n~=k then error('disconnect must be called with `:`, not `.`',2)
|
||||||
=nil end l.Disconnect=l.disconnect return l end function g:disconnect()if self~=
|
end for o,p in pairs(m)do o:disconnect()m[o]=nil end end k.wait=function(n)if n
|
||||||
g then error('disconnect must be called with `:`, not `.`',2)end for j,k in
|
~=k then error('wait must be called with `:`, not `.`',2)end return l.Event:
|
||||||
pairs(i)do j:disconnect()i[j]=nil end end function g:wait()if self~=g then
|
wait()end k.fire=function(n,...)if n~=k then error(
|
||||||
error('wait must be called with `:`, not `.`',2)end return h.Event:wait()end
|
'fire must be called with `:`, not `.`',2)end return l:Fire(...)end k.Connect=k.
|
||||||
function g:fire(...)if self~=g then error(
|
connect k.Disconnect=k.disconnect k.Wait=k.wait k.Fire=k.fire return k end local
|
||||||
'fire must be called with `:`, not `.`',2)end h:Fire(...)end g.Connect=g.connect
|
k k=function(l)if type(l)~='string'then error(
|
||||||
g.Disconnect=g.disconnect g.Wait=g.wait g.Fire=g.fire return g end
|
'Argument of Create must be a string',2)end return function(m)m=m or{}local n,o,
|
||||||
local function Create_PrivImpl(g)if type(g)~='string'then error(
|
p=Instance.new(l),nil,nil for q,r in pairs(m)do if type(q)=='string'then if q==
|
||||||
'Argument of Create must be a string',2)end return function(h)h=h or{}local i,j,
|
'Parent'then o=r else n[q]=r end elseif type(q)=='number'then if type(r)~=
|
||||||
k=Instance.new(g),nil,nil for l,m in pairs(h)do if type(l)=='string'then if l==
|
|
||||||
'Parent'then j=m else i[l]=m end elseif type(l)=='number'then if type(m)~=
|
|
||||||
'userdata'then error(
|
'userdata'then error(
|
||||||
[[Bad entry in Create body: Numeric keys must be paired with children, got a: ]]
|
[[Bad entry in Create body: Numeric keys must be paired with children, got a: ]]
|
||||||
..type(m),2)end m.Parent=i elseif type(l)=='table'and l.__eventname then if
|
..tostring(type(r)),2)end r.Parent=n elseif type(q)=='table'and q.__eventname
|
||||||
type(m)~='function'then error("Bad entry in Create body: Key `[Create.E'"..l.
|
then if type(r)~='function'then error(
|
||||||
__eventname.."']` must have a function value, got: "..tostring(m),2)end i[l.
|
"Bad entry in Create body: Key `[Create.E'"..tostring(q.__eventname)..
|
||||||
__eventname]:connect(m)elseif l==a.Create then if type(m)~='function'then error(
|
"']` 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: ]]
|
[[Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: ]]
|
||||||
..tostring(m),2)elseif k then error(
|
..tostring(r),2)elseif p then error(
|
||||||
[[Bad entry in Create body: Only one constructor function is allowed]],2)end k=m
|
[[Bad entry in Create body: Only one constructor function is allowed]],2)end p=r
|
||||||
else error('Bad entry ('..tostring(l)..' => '..tostring(m)..') in Create body',2
|
else error('Bad entry ('..tostring(q)..' => '..tostring(r)..') in Create body',2
|
||||||
)end end if k then k(i)end if j then i.Parent=j end return i end end a.Create=
|
)end end if p~=nil then p(n)end if o then n.Parent=o end return n end end a.
|
||||||
setmetatable({},{__call=function(g,...)return Create_PrivImpl(...)end})a.Create.
|
Create=setmetatable({},{['__call']=function(l,...)return k(...)end})a.Create.E=
|
||||||
E=function(g)return{__eventname=g}end a.Help=function(g)if g=='DecodeJSON'or g==
|
function(l)return{__eventname=l}end a.Help=function(l)if'DecodeJSON'==l or a.
|
||||||
a.DecodeJSON then return
|
DecodeJSON==l then return
|
||||||
[[Function DecodeJSON. Arguments: (string). Side effect: returns a table with all parsed JSON values]]
|
[[Function DecodeJSON. Arguments: (string). Side effect: returns a table with all parsed JSON values]]
|
||||||
end if g=='EncodeJSON'or g==a.EncodeJSON then return
|
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]]
|
[[Function EncodeJSON. Arguments: (table). Side effect: returns a string composed of argument table in JSON data format]]
|
||||||
end if g=='MakeWedge'or g==a.MakeWedge then return
|
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 ]]
|
[[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 ]]
|
||||||
end if g=='SelectTerrainRegion'or g==a.SelectTerrainRegion then return
|
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]]
|
[[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]]
|
||||||
end if g=='CreateSignal'or g==a.CreateSignal then return
|
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').]]
|
[[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').]]
|
||||||
end if g=='Signal:connect'then return
|
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|.]]
|
[[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|.]]
|
||||||
end if g=='Signal:wait'then return
|
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.]]
|
[[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.]]
|
||||||
end if g=='Signal:fire'then return
|
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.]]
|
[[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.]]
|
||||||
end if g=='Signal:disconnect'then return
|
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.]]
|
[[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.]]
|
||||||
end if g=='Create'then return
|
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.]]
|
[[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
|
end end return a
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
local a,b,c=3569749,game:GetService'ScriptContext',0 while not b and c<3 do c=c+
|
local a,b,c=3569749,game:GetService'ScriptContext',0 while not(b or c>2)do c=c+1
|
||||||
1 b=game:GetService'ScriptContext'wait(0.2)end if b then b:RegisterLibrary(
|
b=game:GetService'ScriptContext'wait(0.2)end if b then b:RegisterLibrary(
|
||||||
'Libraries/RbxGui','45284430')b:RegisterLibrary('Libraries/RbxGear','45374389')
|
'Libraries/RbxGui','45284430')b:RegisterLibrary('Libraries/RbxGear','45374389')
|
||||||
if game.PlaceId==a then b:RegisterLibrary('Libraries/RbxStatus','52177566')end b
|
if game.PlaceId==a then b:RegisterLibrary('Libraries/RbxStatus','52177566')end b
|
||||||
:RegisterLibrary('Libraries/RbxUtility','60595411')b:RegisterLibrary(
|
:RegisterLibrary('Libraries/RbxUtility','60595411')b:RegisterLibrary(
|
||||||
'Libraries/RbxStamper','73157242')b:LibraryRegistrationComplete()else print
|
'Libraries/RbxStamper','73157242')b:LibraryRegistrationComplete()else print
|
||||||
'failed to find script context, libraries did not load'end
|
'failed to find script context, libraries did not load'end return b
|
||||||
|
|
@ -1,522 +1,481 @@
|
||||||
local a={}function PlaneIntersection(b)local c,d=false,game.Workspace.
|
local a,b={},nil b=function(c)local d,e,f=false,game.Workspace.CurrentCamera,nil
|
||||||
CurrentCamera local e,f,g,h=Vector3.new(d.CoordinateFrame.p.X,d.CoordinateFrame.
|
do local g=e.CoordinateFrame.p f=Vector3.new(g.X,g.Y,g.Z)end local g,h,i=Vector3
|
||||||
p.Y,d.CoordinateFrame.p.Z),Vector3.new(b.X,b.Y,b.Z),Vector3.new(0,1,0),Vector3.
|
.new(c.X,c.Y,c.Z),Vector3.new(0,1,0),Vector3.new(0,0,0)local j,k=h:Dot(g-f),c if
|
||||||
new(0,0,0)local i,j=g:Dot(f-e),b if i~=0 then local k=g:Dot(h-e)/i if k>=0 and k
|
j~=0 then a=h:Dot(i-f)/j if a>=0 and a<=1 then local l=((g-f)*a)+f k=game.
|
||||||
<=1 then local l=((f-e)*k)+e j=game.Workspace.Terrain:WorldToCell(l)c=true end
|
Workspace.Terrain:WorldToCell(l)d=true end end return k,d end local c c=function
|
||||||
end return j,c end function GetTerrainForMouse(b)local c,d=game.Workspace.
|
(d)local e,f=game.Workspace.Terrain:WorldToCellPreferSolid(Vector3.new(d.hit.x,d
|
||||||
Terrain:WorldToCellPreferSolid(Vector3.new(b.hit.x,b.hit.y,b.hit.z)),nil if 0==
|
.hit.y,d.hit.z)),nil if 0==game.Workspace.Terrain:GetCell(e.X,e.Y,e.Z).Value
|
||||||
game.Workspace.Terrain:GetCell(c.X,c.Y,c.Z).Value then c=nil d,hit=
|
then e=nil local g f,g=b(Vector3.new(d.hit.x,d.hit.y,d.hit.z))if g then e=f end
|
||||||
PlaneIntersection(Vector3.new(b.hit.x,b.hit.y,b.hit.z))if hit then c=d end end
|
end return e end local d,e=Vector3.new(0.3,0.3,0.3),nil e=function(f,g,h)if f:
|
||||||
return c end local b=Vector3.new(0.3,0.3,0.3)local function
|
IsA'BasePart'then f.CFrame=(g*(f.CFrame-h))+h end local i=f:GetChildren()for j=1
|
||||||
rotatePartAndChildren(c,d,e)if c:IsA'BasePart'then c.CFrame=(d*(c.CFrame-e))+e
|
,#i do e(i[j],g,h)end end local f f=function(g,h)local i,j=CFrame.Angles(0,h,0),
|
||||||
end local f=c:GetChildren()for g=1,#f do rotatePartAndChildren(f[g],d,e)end end
|
g:GetModelCFrame().p return e(g,i,j)end local g g=function(h,i,j,k)if h:IsA
|
||||||
local function modelRotate(c,d)local e,f=CFrame.Angles(0,d,0),c:GetModelCFrame()
|
'BasePart'then i[#i+1]=h elseif h:IsA'Script'then j[#j+1]=h elseif h:IsA'Decal'
|
||||||
.p rotatePartAndChildren(c,e,f)end local function collectParts(c,d,e,f)if c:IsA
|
then k[#k+1]=h end for l,m in pairs(h:GetChildren())do g(m,i,j,k)end end local h
|
||||||
'BasePart'then d[#d+1]=c elseif c:IsA'Script'then e[#e+1]=c elseif c:IsA'Decal'
|
h=function(i,j)local k=game.Workspace:FindFirstChild'Terrain'local l,m=k:
|
||||||
then f[#f+1]=c end for g,h in pairs(c:GetChildren())do collectParts(h,d,e,f)end
|
WorldToCell(i),k:WorldToCell(j)local n,o,p,q,r,s=l.X,l.Y,l.Z,m.X,m.Y,m.Z if n<k.
|
||||||
end local function clusterPartsInRegion(c,d)local e=game.Workspace:
|
MaxExtents.Min.X then n=k.MaxExtents.Min.X end if o<k.MaxExtents.Min.Y then o=k.
|
||||||
FindFirstChild'Terrain'local f,g=e:WorldToCell(c),e:WorldToCell(d)local h,i,j,k,
|
MaxExtents.Min.Y end if p<k.MaxExtents.Min.Z then p=k.MaxExtents.Min.Z end if q>
|
||||||
l,m=f.X,f.Y,f.Z,g.X,g.Y,g.Z if h<e.MaxExtents.Min.X then h=e.MaxExtents.Min.X
|
k.MaxExtents.Max.X then q=k.MaxExtents.Max.X end if r>k.MaxExtents.Max.Y then r=
|
||||||
end if i<e.MaxExtents.Min.Y then i=e.MaxExtents.Min.Y end if j<e.MaxExtents.Min.
|
k.MaxExtents.Max.Y end if s>k.MaxExtents.Max.Z then s=k.MaxExtents.Max.Z end for
|
||||||
Z then j=e.MaxExtents.Min.Z end if k>e.MaxExtents.Max.X then k=e.MaxExtents.Max.
|
t=n,q do for u=o,r do for v=p,s do if k:GetCell(t,u,v).Value>0 then return true
|
||||||
X end if l>e.MaxExtents.Max.Y then l=e.MaxExtents.Max.Y end if m>e.MaxExtents.
|
end end end end return false end local i i=function(j,k)if not j then return end
|
||||||
Max.Z then m=e.MaxExtents.Max.Z end for n=h,k do for o=i,l do for p=j,m do if e:
|
if j.className=='Seat'or j.className=='VehicleSeat'then table.insert(k,j)end
|
||||||
GetCell(n,o,p).Value>0 then return true end end end end return false end
|
local l=j:GetChildren()for m=1,#l do i(l[m],k)end end local j j=function(k,l)
|
||||||
local function findSeatsInModel(c,d)if not c then return end if c.className==
|
local m={}i(k,m)if l then for n=1,#m do local o=m[n]:FindFirstChild'SeatWeld'
|
||||||
'Seat'or c.className=='VehicleSeat'then table.insert(d,c)end local e=c:
|
while o do o:Remove()o=m[n]:FindFirstChild'SeatWeld'end end else for n=1,#m do
|
||||||
GetChildren()for f=1,#e do findSeatsInModel(e[f],d)end end local function
|
local o=Instance.new'Weld'o.Name='SeatWeld'o.Parent=m[n]end end end local k k=
|
||||||
setSeatEnabledStatus(c,d)local e={}findSeatsInModel(c,e)if d then for f=1,#e do
|
function(l)local m=l:FindFirstChild'AutoAlignToFace'if m then return m.Value
|
||||||
local g=e[f]:FindFirstChild'SeatWeld'while g do g:Remove()g=e[f]:FindFirstChild
|
else return false end end local l l=function(m)local n,o,p=Vector3.new(1,0,0),
|
||||||
'SeatWeld'end end else for f=1,#e do local g=Instance.new'Weld'g.Name='SeatWeld'
|
Vector3.new(0,1,0),Vector3.new(0,0,1)local q,r,s=m.x*n.x+m.y*n.y+m.z*n.z,m.x*o.x
|
||||||
g.Parent=e[f]end end end local function autoAlignToFace(c)local d=c:
|
+m.y*o.y+m.z*o.z,m.x*p.x+m.y*p.y+m.z*p.z if math.abs(q)>math.abs(r)and math.abs(
|
||||||
FindFirstChild'AutoAlignToFace'if d then return d.Value else return false end
|
q)>math.abs(s)then if q>0 then return 0 else return 3 end elseif math.abs(r)>
|
||||||
end local function getClosestAlignedWorldDirection(c)local d,e,f=Vector3.new(1,0
|
math.abs(q)and math.abs(r)>math.abs(s)then if r>0 then return 1 else return 4
|
||||||
,0),Vector3.new(0,1,0),Vector3.new(0,0,1)local g,h,i=c.x*d.x+c.y*d.y+c.z*d.z,c.x
|
end else if s>0 then return 2 else return 5 end end end local m m=function(n,o)
|
||||||
*e.x+c.y*e.y+c.z*e.z,c.x*f.x+c.y*f.y+c.z*f.z if math.abs(g)>math.abs(h)and math.
|
local p if not o then return o end if o and(o:IsA'Model'or o:IsA'Tool')then p=o:
|
||||||
abs(g)>math.abs(i)then if g>0 then return 0 else return 3 end elseif math.abs(h)
|
GetModelCFrame()o:TranslateBy(n.p-p.p)else o.CFrame=n end return o end local n n
|
||||||
>math.abs(g)and math.abs(h)>math.abs(i)then if h>0 then return 1 else return 4
|
=function(o,p,q)if math.abs(p)<0.01 then return 0 end return(q-o)/p end local o
|
||||||
end else if i>0 then return 2 else return 5 end end end local function
|
o=function(p,q,r)if not p then return 0 end local s,t if p:IsA'Model'then s=p:
|
||||||
positionPartsAtCFrame3(c,d)local e=nil if not d then return d end if d and(d:IsA
|
GetModelCFrame()t=p:GetModelSize()else s=p.CFrame t=p.Size end local u,v=s:
|
||||||
'Model'or d:IsA'Tool')then e=d:GetModelCFrame()d:TranslateBy(c.p-e.p)else d.
|
pointToObjectSpace(q),s:pointToObjectSpace(r)local w,x,y,z=v-u,1,1,1 if w.X>0
|
||||||
CFrame=c end return d end local function calcRayHitTime(c,d,e)if math.abs(d)<
|
then x=-1 end if w.Y>0 then y=-1 end if w.Z>0 then z=-1 end local A,B,C,D=n(u.X,
|
||||||
0.01 then return 0 end return(e-c)/d end local function modelTargetSurface(c,d,e
|
w.X,t.X/2*x),n(u.Y,w.Y,t.Y/2*y),n(u.Z,w.Z,t.Z/2*z),0 if A>B then if A>C then D=1
|
||||||
)if not c then return 0 end local f,g=nil,nil if c:IsA'Model'then f=c:
|
*x else D=3*z end else if B>C then D=2*y else D=3*z end end return D end local p
|
||||||
GetModelCFrame()g=c:GetModelSize()else f=c.CFrame g=c.Size end local h,i=f:
|
p=function(q)local r,s=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-
|
||||||
pointToObjectSpace(d),f:pointToObjectSpace(e)local j,k,l,m=i-h,1,1,1 if j.X>0
|
math.huge,-math.huge,-math.huge)if q:IsA'Terrain'then r=Vector3.new(-2,-2,-2)s=
|
||||||
then k=-1 end if j.Y>0 then l=-1 end if j.Z>0 then m=-1 end local n,o,p,q=
|
Vector3.new(2,2,2)elseif q:IsA'BasePart'then r=-0.5*q.Size s=-r else s=q:
|
||||||
calcRayHitTime(h.X,j.X,g.X/2*k),calcRayHitTime(h.Y,j.Y,g.Y/2*l),calcRayHitTime(h
|
GetModelSize()*0.5 r=-s end local t=q:FindFirstChild'Justification'if(t~=nil)
|
||||||
.Z,j.Z,g.Z/2*m),0 if n>o then if n>p then q=1*k else q=3*m end else if o>p then
|
then local u,v,w=t.Value,Vector3.new(2,2,2),s-r-Vector3.new(0.01,0.01,0.01)local
|
||||||
q=2*l else q=3*m end end return q end local function getBoundingBox2(c)local d,e
|
x=Vector3.new(4*math.ceil(w.x/4),4*math.ceil(w.y/4),4*math.ceil(w.z/4))local y=x
|
||||||
=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,-math.huge,-
|
-w r=r-(0.5*y*u)s=s+(0.5*y*(v-u))end return r,s end local q q=function(r)local s
|
||||||
math.huge)if c:IsA'Terrain'then d=Vector3.new(-2,-2,-2)e=Vector3.new(2,2,2)
|
,t=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,-math.huge,
|
||||||
elseif c:IsA'BasePart'then d=-0.5*c.Size e=-d else e=c:GetModelSize()*0.5 d=-e
|
-math.huge)if r:IsA'BasePart'and not r:IsA'Terrain'then local u,v=r.CFrame:
|
||||||
end local f=c:FindFirstChild'Justification'if f~=nil then local g,h,i=f.Value,
|
pointToWorldSpace(-0.5*r.Size),r.CFrame:pointToWorldSpace(0.5*r.Size)s=Vector3.
|
||||||
Vector3.new(2,2,2),e-d-Vector3.new(0.01,0.01,0.01)local j=Vector3.new(4*math.
|
new(math.min(u.X,v.X),math.min(u.Y,v.Y),math.min(u.Z,v.Z))t=Vector3.new(math.
|
||||||
ceil(i.x/4),4*math.ceil(i.y/4),4*math.ceil(i.z/4))local k=j-i d=d-0.5*k*g e=e+
|
max(u.X,v.X),math.max(u.Y,v.Y),math.max(u.Z,v.Z))elseif not r:IsA'Terrain'then
|
||||||
0.5*k*(h-g)end return d,e end local function getBoundingBoxInWorldCoordinates(c)
|
local u,v=r:GetModelCFrame():pointToWorldSpace(-0.5*r:GetModelSize()),r:
|
||||||
local d,e=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,-
|
GetModelCFrame():pointToWorldSpace(0.5*r:GetModelSize())s=Vector3.new(math.min(u
|
||||||
math.huge,-math.huge)if c:IsA'BasePart'and not c:IsA'Terrain'then local f,g=c.
|
.X,v.X),math.min(u.Y,v.Y),math.min(u.Z,v.Z))t=Vector3.new(math.max(u.X,v.X),math
|
||||||
CFrame:pointToWorldSpace(-0.5*c.Size),c.CFrame:pointToWorldSpace(0.5*c.Size)d=
|
.max(u.Y,v.Y),math.max(u.Z,v.Z))end return s,t end local r r=function(s)return
|
||||||
Vector3.new(math.min(f.X,g.X),math.min(f.Y,g.Y),math.min(f.Z,g.Z))e=Vector3.new(
|
p((function()if(s.Parent:FindFirstChild'RobloxModel'~=nil)then return s.Parent
|
||||||
math.max(f.X,g.X),math.max(f.Y,g.Y),math.max(f.Z,g.Z))elseif not c:IsA'Terrain'
|
else return s end end)())end local s s=function(t)if(t.Parent:FindFirstChild
|
||||||
then local f,g=c:GetModelCFrame():pointToWorldSpace(-0.5*c:GetModelSize()),c:
|
'RobloxModel'~=nil)then if t.Parent:IsA'Tool'then return t.Parent.Handle.CFrame
|
||||||
GetModelCFrame():pointToWorldSpace(0.5*c:GetModelSize())d=Vector3.new(math.min(f
|
else return t.Parent:GetModelCFrame()end else return t.CFrame end end local t t=
|
||||||
.X,g.X),math.min(f.Y,g.Y),math.min(f.Z,g.Z))e=Vector3.new(math.max(f.X,g.X),math
|
function(u)if not u then return false end if not u.Parent then return false end
|
||||||
.max(f.Y,g.Y),math.max(f.Z,g.Z))end return d,e end local function
|
if u:FindFirstChild'Humanoid'then return false end if u:FindFirstChild
|
||||||
getTargetPartBoundingBox(c)if c.Parent:FindFirstChild'RobloxModel'~=nil then
|
'RobloxStamper'then return true end if u:IsA'Part'and not u.CanCollide then
|
||||||
return getBoundingBox2(c.Parent)else return getBoundingBox2(c)end end
|
return false end if u==game.Lighting then return false end return t(u.Parent)end
|
||||||
local function getMouseTargetCFrame(c)if c.Parent:FindFirstChild'RobloxModel'~=
|
local u u=function(v,w,x)local y=game.Workspace:FindPartsInRegion3(Region3.new(
|
||||||
nil then if c.Parent:IsA'Tool'then return c.Parent.Handle.CFrame else return c.
|
Vector3.new(v.Position.X,w,v.Position.Z)-Vector3.new(0.75,2.75,0.75),Vector3.
|
||||||
Parent:GetModelCFrame()end else return c.CFrame end end local function isBlocker
|
new(v.Position.X,w,v.Position.Z)+Vector3.new(0.75,1.75,0.75)),v.Parent,100)for z
|
||||||
(c)if not c then return false end if not c.Parent then return false end if c:
|
=1,#y do if y[z].CanCollide and not y[z]:IsDescendantOf(x.CurrentParts)then
|
||||||
FindFirstChild'Humanoid'then return false end if c:FindFirstChild'RobloxStamper'
|
return false end end if h(Vector3.new(v.Position.X,w,v.Position.Z)-Vector3.new(
|
||||||
or c:FindFirstChild'RobloxModel'then return true end if c:IsA'Part'and not c.
|
0.75,2.75,0.75),Vector3.new(v.Position.X,w,v.Position.Z)+Vector3.new(0.75,1.75,
|
||||||
CanCollide then return false end if c==game.Lighting then return false end
|
0.75))then return false end return true end local v v=function(w,x)if not w then
|
||||||
return isBlocker(c.Parent)end local function spaceAboveCharacter(c,d,e)local f=
|
return end if not x then return error'findConfigAtMouseTarget: stampData is nil'
|
||||||
game.Workspace:FindPartsInRegion3(Region3.new(Vector3.new(c.Position.X,d,c.
|
end if not x['CurrentParts']then return end local y,z,A,B,C=4,false,CFrame.new(0
|
||||||
Position.Z)-Vector3.new(0.75,2.75,0.75),Vector3.new(c.Position.X,d,c.Position.Z)
|
,0,0),p(x.CurrentParts)local D,E=C-B,nil if x.CurrentParts:IsA'Model'or x.
|
||||||
+Vector3.new(0.75,1.75,0.75)),c.Parent,100)for g=1,#f do if f[g].CanCollide and
|
CurrentParts:IsA'Tool'then E=x.CurrentParts:GetModelCFrame()else E=x.
|
||||||
not f[g]:IsDescendantOf(e.CurrentParts)then return false end end if
|
CurrentParts.CFrame end if w then if x.CurrentParts:IsA'Tool'then w.TargetFilter
|
||||||
clusterPartsInRegion(Vector3.new(c.Position.X,d,c.Position.Z)-Vector3.new(0.75,
|
=x.CurrentParts.Handle else w.TargetFilter=x.CurrentParts end end local F,G=
|
||||||
2.75,0.75),Vector3.new(c.Position.X,d,c.Position.Z)+Vector3.new(0.75,1.75,0.75))
|
false,nil local H=pcall(function()G=w.Target end)if not H then return z,A end
|
||||||
then return false end return true end local function findConfigAtMouseTarget(c,d
|
local I=Vector3.new(0,0,0)if w then I=Vector3.new(w.Hit.x,w.Hit.y,w.Hit.z)end
|
||||||
)if not c then return nil end if not d then error
|
local J if nil==G then J=c(w)if nil==J then F=false return z,A else G=game.
|
||||||
'findConfigAtMouseTarget: stampData is nil'return nil end if not d[
|
Workspace.Terrain F=true J=Vector3.new(J.X-1,J.Y,J.Z)I=game.Workspace.Terrain:
|
||||||
'CurrentParts']then return nil end local e,f,g,h,i=4,false,CFrame.new(0,0,0),
|
CellCenterToWorld(J.x,J.y,J.z)end end local K,L K,L=r(G)local M,N=L-K,s(G)if G:
|
||||||
getBoundingBox2(d.CurrentParts)local j,k=i-h,nil if d.CurrentParts:IsA'Model'or
|
IsA'Terrain'then if not cluster then cluster=game.Workspace:FindFirstChild
|
||||||
d.CurrentParts:IsA'Tool'then k=d.CurrentParts:GetModelCFrame()else k=d.
|
'Terrain'end local O=cluster:WorldToCellPreferSolid(I)if F then O=J end N=CFrame
|
||||||
CurrentParts.CFrame end if c then if d.CurrentParts:IsA'Tool'then c.TargetFilter
|
.new(game.Workspace.Terrain:CellCenterToWorld(O.x,O.y,O.z))end local O,P=N:
|
||||||
=d.CurrentParts.Handle else c.TargetFilter=d.CurrentParts end end local l,m=
|
pointToObjectSpace(I),Vector3.new(0,0,0)if w then P=G.CFrame:vectorToWorldSpace(
|
||||||
false,nil local n=pcall(function()m=c.Target end)if not n then return f,g end
|
Vector3.FromNormalId(w.TargetSurface))end local Q,R,S if l(P)==0 then Q=N:
|
||||||
local o=Vector3.new(0,0,0)if c then o=Vector3.new(c.Hit.x,c.Hit.y,c.Hit.z)end
|
vectorToObjectSpace(Vector3.new(1,-1,1))R=E:vectorToObjectSpace(Vector3.new(-1,-
|
||||||
local p=nil if nil==m then p=GetTerrainForMouse(c)if nil==p then l=false return
|
1,1))S=Vector3.new(0,1,1)elseif l(P)==3 then Q=N:vectorToObjectSpace(Vector3.
|
||||||
f,g else m=game.Workspace.Terrain l=true p=Vector3.new(p.X-1,p.Y,p.Z)o=game.
|
new(-1,-1,-1))R=E:vectorToObjectSpace(Vector3.new(1,-1,-1))S=Vector3.new(0,1,1)
|
||||||
Workspace.Terrain:CellCenterToWorld(p.x,p.y,p.z)end end local q,r=
|
elseif l(P)==1 then Q=N:vectorToObjectSpace(Vector3.new(-1,1,1))R=E:
|
||||||
getTargetPartBoundingBox(m)local s,t=r-q,getMouseTargetCFrame(m)if m:IsA
|
vectorToObjectSpace(Vector3.new(-1,-1,1))S=Vector3.new(1,0,1)elseif l(P)==4 then
|
||||||
'Terrain'then if not cluster then cluster=game.Workspace:FindFirstChild'Terrain'
|
Q=N:vectorToObjectSpace(Vector3.new(-1,-1,1))R=E:vectorToObjectSpace(Vector3.
|
||||||
end local u=cluster:WorldToCellPreferSolid(o)if l then u=p end t=CFrame.new(game
|
new(-1,1,1))S=Vector3.new(1,0,1)elseif l(P)==2 then Q=N:vectorToObjectSpace(
|
||||||
.Workspace.Terrain:CellCenterToWorld(u.x,u.y,u.z))end local u,v=t:
|
Vector3.new(-1,-1,1))R=E:vectorToObjectSpace(Vector3.new(-1,-1,-1))S=Vector3.
|
||||||
pointToObjectSpace(o),Vector3.new(0,0,0)if c then v=m.CFrame:vectorToWorldSpace(
|
new(1,1,0)else Q=N:vectorToObjectSpace(Vector3.new(1,-1,-1))R=E:
|
||||||
Vector3.FromNormalId(c.TargetSurface))end local w,x if
|
vectorToObjectSpace(Vector3.new(1,-1,1))S=Vector3.new(1,1,0)end Q=Q*((0.5*M)+0.5
|
||||||
getClosestAlignedWorldDirection(v)==0 then w=t:vectorToObjectSpace(Vector3.new(1
|
*(L+K))R=R*((0.5*D)+0.5*(C+B))local T=O-Q local U=Vector3.new(y*math.modf(T.x/y)
|
||||||
,-1,1))insertRefPointInInsert=k:vectorToObjectSpace(Vector3.new(-1,-1,1))x=
|
,y*math.modf(T.y/y),y*math.modf(T.z/y))U=U*S local V=U+Q local W,X=N:
|
||||||
Vector3.new(0,1,1)elseif getClosestAlignedWorldDirection(v)==3 then w=t:
|
pointToWorldSpace(V),E:vectorToWorldSpace(R)local Y,Z,_,aa,ab,ac,ad,ae,af,ag,ah,
|
||||||
vectorToObjectSpace(Vector3.new(-1,-1,-1))insertRefPointInInsert=k:
|
ai,aj=W-X,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil aa,aa,aa,ab,ac,ad,ae,
|
||||||
vectorToObjectSpace(Vector3.new(1,-1,-1))x=Vector3.new(0,1,1)elseif
|
af,ag,ah,ai,aj=E:components()A=CFrame.new(Y.x,Y.y,Y.z,ab,ac,ad,ae,af,ag,ah,ai,aj
|
||||||
getClosestAlignedWorldDirection(v)==1 then w=t:vectorToObjectSpace(Vector3.new(-
|
)z=true return z,A,l(P)end local aa aa=function(ab,ac)local ad,ae=math.abs(ab),
|
||||||
1,1,1))insertRefPointInInsert=k:vectorToObjectSpace(Vector3.new(-1,-1,1))x=
|
math.abs(ac)local af=math.sqrt(ad*ad+ae*ae)local ag,ah,ai=ae/af,1,1 if ab<0 then
|
||||||
Vector3.new(1,0,1)elseif getClosestAlignedWorldDirection(v)==4 then w=t:
|
ah=-1 end if ac<0 then ai=-1 end if ag>0.382683432 then return 0.707106781*af*ah
|
||||||
vectorToObjectSpace(Vector3.new(-1,-1,1))insertRefPointInInsert=k:
|
,0.707106781*af*ai else return af*ah,0 end end local ab ab=function(ac,ad,ae)if
|
||||||
vectorToObjectSpace(Vector3.new(-1,1,1))x=Vector3.new(1,0,1)elseif
|
ac:IsA'ManualWeld'or ac:IsA'Rotate'then table.insert(ad,ac)return table.insert(
|
||||||
getClosestAlignedWorldDirection(v)==2 then w=t:vectorToObjectSpace(Vector3.new(-
|
ae,ac.Parent)else local af=ac:GetChildren()for ag=1,#af do ab(af[ag],ad,ae)end
|
||||||
1,-1,1))insertRefPointInInsert=k:vectorToObjectSpace(Vector3.new(-1,-1,-1))x=
|
end end local ac ac=function(ad,ae)for af=1,#ad do ad[af].Parent=ae[af]end end a
|
||||||
Vector3.new(1,1,0)else w=t:vectorToObjectSpace(Vector3.new(1,-1,-1))
|
.CanEditRegion=function(ad,ae)if not ae then return true,false end local af,ag
|
||||||
insertRefPointInInsert=k:vectorToObjectSpace(Vector3.new(1,-1,1))x=Vector3.new(1
|
af,ag=q(ad)if af.X<ae.CFrame.p.X-ae.Size.X/2 or af.Y<ae.CFrame.p.Y-ae.Size.Y/2
|
||||||
,1,0)end w=w*(0.5*s)+0.5*(r+q)insertRefPointInInsert=insertRefPointInInsert*(0.5
|
or af.Z<ae.CFrame.p.Z-ae.Size.Z/2 then return false,false end if ag.X>ae.CFrame.
|
||||||
*j)+0.5*(i+h)local y=u-w local z=Vector3.new(e*math.modf(y.x/e),e*math.modf(y.y/
|
p.X+ae.Size.X/2 or ag.Y>ae.CFrame.p.Y+ae.Size.Y/2 or ag.Z>ae.CFrame.p.Z+ae.Size.
|
||||||
e),e*math.modf(y.z/e))z=z*x local A=z+w local B,C=t:pointToWorldSpace(A),k:
|
Z/2 then return false,false end return true,false end a.GetStampModel=function(
|
||||||
vectorToWorldSpace(insertRefPointInInsert)local D,E,F,G,H,I,J,K,L,M,N,O,P=B-C,k:
|
ad,ae,af)if ad==0 then return nil,'No Asset'end if ad<0 then return nil,
|
||||||
components()g=CFrame.new(D.x,D.y,D.z,H,I,J,K,L,M,N,O,P)f=true return f,g,
|
'Negative Asset'end local ag ag=function(ah)if ah:IsA'BasePart'then ah.Locked=
|
||||||
getClosestAlignedWorldDirection(v)end local function truncateToCircleEighth(c,d)
|
false end for ai,aj in pairs(ah:GetChildren())do ag(aj)end end local ah ah=
|
||||||
local e,f=math.abs(c),math.abs(d)local g=math.sqrt(e*e+f*f)local h,i,j=f/g,1,1
|
function(ai)return BrickColor.new((function()if 1==ai then return'Bright green'
|
||||||
if c<0 then i=-1 end if d<0 then j=-1 end if h>0.382683432 then return
|
elseif 2==ai then return'Bright yellow'elseif 3==ai then return'Bright red'
|
||||||
0.707106781*g*i,0.707106781*g*j else return g*i,0 end end local function
|
elseif 4==ai then return'Sand red'elseif 5==ai then return'Black'elseif 6==ai
|
||||||
saveTheWelds(c,d,e)if c:IsA'ManualWeld'or c:IsA'Rotate'then table.insert(d,c)
|
then return'Dark stone grey'elseif 7==ai then return'Sand blue'elseif 8==ai then
|
||||||
table.insert(e,c.Parent)else local f=c:GetChildren()for g=1,#f do saveTheWelds(f
|
return'Deep orange'elseif 9==ai then return'Dark orange'elseif 10==ai then
|
||||||
[g],d,e)end end end local function restoreTheWelds(c,d)for e=1,#c do c[e].Parent
|
return'Reddish brown'elseif 11==ai then return'Light orange'elseif 12==ai then
|
||||||
=d[e]end end a.CanEditRegion=function(c,d)if not d then return true,false end
|
return'Light stone grey'elseif 13==ai then return'Sand green'elseif 14==ai then
|
||||||
local e,f=getBoundingBoxInWorldCoordinates(c)if e.X<d.CFrame.p.X-d.Size.X/2 or e
|
return'Medium stone grey'elseif 15==ai then return'Really red'elseif 16==ai then
|
||||||
.Y<d.CFrame.p.Y-d.Size.Y/2 or e.Z<d.CFrame.p.Z-d.Size.Z/2 then return false,
|
return'Really blue'elseif 17==ai then return'Bright blue'else return
|
||||||
false end if f.X>d.CFrame.p.X+d.Size.X/2 or f.Y>d.CFrame.p.Y+d.Size.Y/2 or f.Z>d
|
'Bright green'end end)())end local ai ai=function(aj,w,x)local y if w==1 or w==4
|
||||||
.CFrame.p.Z+d.Size.Z/2 then return false,false end return true,false end a.
|
then y=Instance.new'WedgePart'y.formFactor='Custom'elseif w==2 then y=Instance.
|
||||||
GetStampModel=function(c,d,e)if c==0 then return nil,'No Asset'end if c<0 then
|
new'CornerWedgePart'else y=Instance.new'Part'y.formFactor='Custom'end y.Name=
|
||||||
return nil,'Negative Asset'end local function UnlockInstances(f)if f:IsA
|
'MegaClusterCube'y.Size=Vector3.new(4,4,4)y.BottomSurface='Smooth'y.TopSurface=
|
||||||
'BasePart'then f.Locked=false end for g,h in pairs(f:GetChildren())do
|
'Smooth'y.BrickColor=ah(aj)local z,A=0,math.pi if w==4 then z=-math.pi/2 end if
|
||||||
UnlockInstances(h)end end local function getClosestColorToTerrainMaterial(f)if f
|
w==2 or w==3 then A=0 end y.CFrame=CFrame.Angles(0,math.pi/2*x+A,z)if w==3 then
|
||||||
==1 then return BrickColor.new'Bright green'elseif f==2 then return BrickColor.
|
local B=Instance.new'SpecialMesh'B.MeshType='FileMesh'B.MeshId=
|
||||||
new'Bright yellow'elseif f==3 then return BrickColor.new'Bright red'elseif f==4
|
'http://www.roblox.com/asset?id=66832495'B.Scale=Vector3.new(2,2,2)B.Parent=y
|
||||||
then return BrickColor.new'Sand red'elseif f==5 then return BrickColor.new
|
end local B=Instance.new'Vector3Value'B.Value=Vector3.new(aj,w,x)B.Name=
|
||||||
'Black'elseif f==6 then return BrickColor.new'Dark stone grey'elseif f==7 then
|
'ClusterMaterial'B.Parent=y return y end local aj,w,x=nil,nil,true if af then w=
|
||||||
return BrickColor.new'Sand blue'elseif f==8 then return BrickColor.new
|
coroutine.create(function()aj=game:GetService'InsertService':LoadAssetVersion(ad
|
||||||
'Deep orange'elseif f==9 then return BrickColor.new'Dark orange'elseif f==10
|
)x=false end)coroutine.resume(w)else w=coroutine.create(function()aj=game:
|
||||||
then return BrickColor.new'Reddish brown'elseif f==11 then return BrickColor.new
|
GetService'InsertService':LoadAsset(ad)x=false end)coroutine.resume(w)end local
|
||||||
'Light orange'elseif f==12 then return BrickColor.new'Light stone grey'elseif f
|
y,z,A=0,0,8 while x and z<A do y=tick()wait(1)z=z+(tick()-y)end x=false if z>=A
|
||||||
==13 then return BrickColor.new'Sand green'elseif f==14 then return BrickColor.
|
then return nil,'Load Time Fail'end if aj==nil then return nil,'Load Asset Fail'
|
||||||
new'Medium stone grey'elseif f==15 then return BrickColor.new'Really red'elseif
|
end if not aj:IsA'Model'then return nil,'Load Type Fail'end local B=aj:
|
||||||
f==16 then return BrickColor.new'Really blue'elseif f==17 then return BrickColor
|
GetChildren()if#B==0 then return nil,'Empty Model Fail'end ag(aj)aj=aj:
|
||||||
.new'Bright blue'else return BrickColor.new'Bright green'end end local function
|
GetChildren()[1]for C,D in pairs(B)do if D:IsA'Team'then D.Parent=game:
|
||||||
setupFakeTerrainPart(f,g,h)local i=nil if g==1 or g==4 then i=Instance.new
|
GetService'Teams'elseif D:IsA'Sky'then local E=game:GetService'Lighting'for F,G
|
||||||
'WedgePart'i.formFactor='Custom'elseif g==2 then i=Instance.new'CornerWedgePart'
|
in pairs(E:GetChildren())do if G:IsA'Sky'then G:Remove()end end D.Parent=E
|
||||||
else i=Instance.new'Part'i.formFactor='Custom'end i.Name='MegaClusterCube'i.Size
|
return end end if not(aj:FindFirstChild'RobloxModel'~=nil)then local E=Instance.
|
||||||
=Vector3.new(4,4,4)i.BottomSurface='Smooth'i.TopSurface='Smooth'i.BrickColor=
|
new'BoolValue'E.Name='RobloxModel'E.Parent=aj if not(aj:FindFirstChild
|
||||||
getClosestColorToTerrainMaterial(f)local j,k=0,math.pi if g==4 then j=-math.pi/2
|
'RobloxStamper'~=nil)then local F=Instance.new'BoolValue'F.Name='RobloxStamper'F
|
||||||
end if g==2 or g==3 then k=0 end i.CFrame=CFrame.Angles(0,math.pi/2*h+k,j)if g==
|
.Parent=aj end end if ae then if aj.Name=='MegaClusterCube'then if ae==6 then
|
||||||
3 then local l=Instance.new'SpecialMesh'l.MeshType='FileMesh'l.MeshId=
|
local E=Instance.new'BoolValue'E.Name='AutoWedge'E.Parent=aj else local E=aj:
|
||||||
'http://www.roblox.com/asset?id=66832495'l.Scale=Vector3.new(2,2,2)l.Parent=i
|
FindFirstChild'ClusterMaterial'if E then if E:IsA'Vector3Value'then aj=ai(E.
|
||||||
end local l=Instance.new'Vector3Value'l.Value=Vector3.new(f,g,h)l.Name=
|
Value.X,ae,E.Value.Z)else aj=ai(E.Value,ae,0)end else aj=ai(1,ae,0)end end end
|
||||||
'ClusterMaterial'l.Parent=i return i end local f,g,h=nil,nil,true if e then g=
|
end return aj end a.SetupStamperDragger=function(ad,ae,af,ag,ah)if not ad then
|
||||||
coroutine.create(function()f=game:GetService'InsertService':LoadAssetVersion(c)h
|
error
|
||||||
=false end)coroutine.resume(g)else g=coroutine.create(function()f=game:
|
|
||||||
GetService'InsertService':LoadAsset(c)h=false end)coroutine.resume(g)end local i
|
|
||||||
,j,k=0,0,8 while h and j<k do i=tick()wait(1)j=j+tick()-i end h=false if j>=k
|
|
||||||
then return nil,'Load Time Fail'end if f==nil then return nil,'Load Asset Fail'
|
|
||||||
end if not f:IsA'Model'then return nil,'Load Type Fail'end local l=f:
|
|
||||||
GetChildren()if#l==0 then return nil,'Empty Model Fail'end UnlockInstances(f)f=f
|
|
||||||
:GetChildren()[1]for m,n in pairs(l)do if n:IsA'Team'then n.Parent=game:
|
|
||||||
GetService'Teams'elseif n:IsA'Sky'then local o=game:GetService'Lighting'for p,q
|
|
||||||
in pairs(o:GetChildren())do if q:IsA'Sky'then q:Remove()end end n.Parent=o
|
|
||||||
return end end if f:FindFirstChild'RobloxModel'==nil then local o=Instance.new
|
|
||||||
'BoolValue'o.Name='RobloxModel'o.Parent=f if f:FindFirstChild'RobloxStamper'==
|
|
||||||
nil then local p=Instance.new'BoolValue'p.Name='RobloxStamper'p.Parent=f end end
|
|
||||||
if d then if f.Name=='MegaClusterCube'then if d==6 then local o=Instance.new
|
|
||||||
'BoolValue'o.Name='AutoWedge'o.Parent=f else local o=f:FindFirstChild
|
|
||||||
'ClusterMaterial'if o then if o:IsA'Vector3Value'then f=setupFakeTerrainPart(o.
|
|
||||||
Value.X,d,o.Value.Z)else f=setupFakeTerrainPart(o.Value,d,0)end else f=
|
|
||||||
setupFakeTerrainPart(1,d,0)end end end end return f end a.SetupStamperDragger=
|
|
||||||
function(c,d,e,f,g)if not c then error
|
|
||||||
[[SetupStamperDragger: modelToStamp (first arg) is nil! Should be a stamper model]]
|
[[SetupStamperDragger: modelToStamp (first arg) is nil! Should be a stamper model]]
|
||||||
return nil end if not c:IsA'Model'and not c:IsA'BasePart'then error
|
return nil end if not ad:IsA'Model'and not ad:IsA'BasePart'then error
|
||||||
[[SetupStamperDragger: modelToStamp (first arg) is neither a Model or Part!]]
|
[[SetupStamperDragger: modelToStamp (first arg) is neither a Model or Part!]]
|
||||||
return nil end if not d then error
|
return nil end if not ae then error
|
||||||
[[SetupStamperDragger: Mouse (second arg) is nil! Should be a mouse object]]
|
[[SetupStamperDragger: Mouse (second arg) is nil! Should be a mouse object]]
|
||||||
return nil end if not d:IsA'Mouse'then error
|
return nil end if not ae:IsA'Mouse'then error
|
||||||
[[SetupStamperDragger: Mouse (second arg) is not of type Mouse!]]return nil end
|
[[SetupStamperDragger: Mouse (second arg) is not of type Mouse!]]return nil end
|
||||||
local h,i,j=nil,nil,nil if e then if not e:IsA'Model'then error
|
local ai,aj,w if af then if not af:IsA'Model'then error
|
||||||
[[SetupStamperDragger: StampInModel (optional third arg) is not of type 'Model']]
|
[[SetupStamperDragger: StampInModel (optional third arg) is not of type 'Model']]
|
||||||
return nil end if not f then error
|
return nil end if not ag then error
|
||||||
[[SetupStamperDragger: AllowedStampRegion (optional fourth arg) is nil when StampInModel (optional third arg) is defined]]
|
[[SetupStamperDragger: AllowedStampRegion (optional fourth arg) is nil when StampInModel (optional third arg) is defined]]
|
||||||
return nil end j=g h=e i=f end local k,l,m,n=0,nil,nil,Instance.new
|
return nil end w=ah ai=af aj=ag end local x,y,z,A=0,nil,nil,Instance.new
|
||||||
'SelectionBox'n.Color=BrickColor.new'Bright red'n.Transparency=0 n.Archivable=
|
'SelectionBox'A.Color=BrickColor.new'Bright red'A.Transparency=0 A.Archivable=
|
||||||
false local o=Instance.new'Part'o.Parent=nil o.formFactor='Custom'o.Size=Vector3
|
false local B=Instance.new'Part'B.Parent=nil B.formFactor='Custom'B.Size=Vector3
|
||||||
.new(4,4,4)o.CFrame=CFrame.new()o.Archivable=false local p=Instance.new
|
.new(4,4,4)B.CFrame=CFrame.new()B.Archivable=false local C=Instance.new
|
||||||
'SelectionBox'p.Color=BrickColor.new'Toothpaste'p.Adornee=o p.Visible=true p.
|
'SelectionBox'C.Color=BrickColor.new'Toothpaste'C.Adornee=B C.Visible=true C.
|
||||||
Transparency=0 p.Name='HighScalabilityStamperLine'p.Archivable=false local q={}q
|
Transparency=0 C.Name='HighScalabilityStamperLine'C.Archivable=false local D={}D
|
||||||
.Start=nil q.End=nil q.Adorn=p q.AdornPart=o q.InternalLine=nil q.NewHint=true q
|
.Start=nil D.End=nil D.Adorn=C D.AdornPart=B D.InternalLine=nil D.NewHint=true D
|
||||||
.MorePoints={nil,nil}q.MoreLines={nil,nil}q.Dimensions=1 local r,s,t,u,v,w,x={},
|
.MorePoints={nil,nil}D.MoreLines={nil,nil}D.Dimensions=1 local E,F,G,H,I,J,K={},
|
||||||
false,false,false,{},nil,Instance.new'BoolValue'x.Archivable=false x.Value=false
|
false,false,false,{},nil,Instance.new'BoolValue'K.Archivable=false K.Value=false
|
||||||
local y={}y.TerrainOrientation=0 y.CFrame=0 local z={}z.Material=1 z.clusterType
|
local L={}L.TerrainOrientation=0 L.CFrame=0 local M={}M.Material=1 M.clusterType
|
||||||
=0 z.clusterOrientation=0 local function isMegaClusterPart()if not l then return
|
=0 M.clusterOrientation=0 local N N=function()if not y then return false end if
|
||||||
false end if not l.CurrentParts then return false end return(l.CurrentParts:
|
not y.CurrentParts then return false end return y.CurrentParts:FindFirstChild(
|
||||||
FindFirstChild('ClusterMaterial',true)or(l.CurrentParts.Name=='MegaClusterCube')
|
'ClusterMaterial',true)or(y.CurrentParts.Name=='MegaClusterCube')end local O O=
|
||||||
)end local function DoHighScalabilityRegionSelect()local A=l.CurrentParts:
|
function()local P=y.CurrentParts:FindFirstChild'MegaClusterCube'if not P then if
|
||||||
FindFirstChild'MegaClusterCube'if not A then if not l.CurrentParts.Name==
|
not y.CurrentParts.Name=='MegaClusterCube'then return else P=y.CurrentParts end
|
||||||
'MegaClusterCube'then return else A=l.CurrentParts end end q.End=A.CFrame.p
|
end D.End=P.CFrame.p local Q,R,S=nil,Vector3.new(0,0,0),Vector3.new(0,0,0)if D.
|
||||||
local B,C,D=nil,Vector3.new(0,0,0),Vector3.new(0,0,0)if q.Dimensions==1 then B=(
|
Dimensions==1 then Q=(D.End-D.Start)if math.abs(Q.X)<math.abs(Q.Y)then if math.
|
||||||
q.End-q.Start)if math.abs(B.X)<math.abs(B.Y)then if math.abs(B.X)<math.abs(B.Z)
|
abs(Q.X)<math.abs(Q.Z)then local T,U if math.abs(Q.Y)>math.abs(Q.Z)then T,U=aa(Q
|
||||||
then local G,H if math.abs(B.Y)>math.abs(B.Z)then G,H=truncateToCircleEighth(B.Y
|
.Y,Q.Z)else U,T=aa(Q.Z,Q.Y)end Q=Vector3.new(0,T,U)else local T,U T,U=aa(Q.Y,Q.X
|
||||||
,B.Z)else H,G=truncateToCircleEighth(B.Z,B.Y)end B=Vector3.new(0,G,H)else local
|
)Q=Vector3.new(U,T,0)end else if math.abs(Q.Y)<math.abs(Q.Z)then local T,U if
|
||||||
G,H=truncateToCircleEighth(B.Y,B.X)B=Vector3.new(H,G,0)end else if math.abs(B.Y)
|
math.abs(Q.X)>math.abs(Q.Z)then T,U=aa(Q.X,Q.Z)else U,T=aa(Q.Z,Q.X)end Q=Vector3
|
||||||
<math.abs(B.Z)then local G,H if math.abs(B.X)>math.abs(B.Z)then G,H=
|
.new(T,0,U)else local T,U T,U=aa(Q.X,Q.Y)Q=Vector3.new(T,U,0)end end D.
|
||||||
truncateToCircleEighth(B.X,B.Z)else H,G=truncateToCircleEighth(B.Z,B.X)end B=
|
InternalLine=Q elseif D.Dimensions==2 then Q=D.MoreLines[1]R=D.End-D.MorePoints[
|
||||||
Vector3.new(G,0,H)else local G,H=truncateToCircleEighth(B.X,B.Y)B=Vector3.new(G,
|
1]R=R-(Q.unit*Q.unit:Dot(R))local T=CFrame.new(D.Start,D.Start+Q)local U,V=T:
|
||||||
H,0)end end q.InternalLine=B elseif q.Dimensions==2 then B=q.MoreLines[1]C=q.End
|
vectorToWorldSpace(Vector3.new(0,1,0)),T:vectorToWorldSpace(Vector3.new(1,0,0))
|
||||||
-q.MorePoints[1]C=C-B.unit*B.unit:Dot(C)tempCFrame=CFrame.new(q.Start,q.Start+B)
|
local W,X=V:Dot(R),U:Dot(R)if math.abs(X)>math.abs(W)then R=R-(V*W)else R=R-(U*X
|
||||||
local G,H=tempCFrame:vectorToWorldSpace(Vector3.new(0,1,0)),tempCFrame:
|
)end D.InternalLine=R elseif D.Dimensions==3 then Q=D.MoreLines[1]R=D.MoreLines[
|
||||||
vectorToWorldSpace(Vector3.new(1,0,0))local I,J=H:Dot(C),G:Dot(C)if math.abs(J)>
|
2]S=D.End-D.MorePoints[2]S=S-(Q.unit*Q.unit:Dot(S))S=S-(R.unit*R.unit:Dot(S))D.
|
||||||
math.abs(I)then C=C-H*I else C=C-G*J end q.InternalLine=C elseif q.Dimensions==3
|
InternalLine=S end local T=CFrame.new(D.Start,D.Start+Q)if D.Dimensions==1 then
|
||||||
then B=q.MoreLines[1]C=q.MoreLines[2]D=q.End-q.MorePoints[2]D=D-B.unit*B.unit:
|
D.AdornPart.Size=Vector3.new(4,4,Q.magnitude+4)D.AdornPart.CFrame=T+T:
|
||||||
Dot(D)D=D-C.unit*C.unit:Dot(D)q.InternalLine=D end tempCFrame=CFrame.new(q.Start
|
vectorToWorldSpace(Vector3.new(2,2,2)-D.AdornPart.Size/2)else local U=T:
|
||||||
,q.Start+B)if q.Dimensions==1 then q.AdornPart.Size=Vector3.new(4,4,B.magnitude+
|
vectorToObjectSpace(Q+R+S)D.AdornPart.Size=Vector3.new(4,4,4)+Vector3.new(math.
|
||||||
4)q.AdornPart.CFrame=tempCFrame+tempCFrame:vectorToWorldSpace(Vector3.new(2,2,2)
|
abs(U.X),math.abs(U.Y),math.abs(U.Z))D.AdornPart.CFrame=T+T:vectorToWorldSpace(U
|
||||||
-q.AdornPart.Size/2)else local G=tempCFrame:vectorToObjectSpace(B+C+D)q.
|
/2)end local U if game.Players['LocalPlayer']then U=game.Players.LocalPlayer:
|
||||||
AdornPart.Size=Vector3.new(4,4,4)+Vector3.new(math.abs(G.X),math.abs(G.Y),math.
|
FindFirstChild'PlayerGui'if U and U:IsA'PlayerGui'then if(D.Dimensions==1 and Q.
|
||||||
abs(G.Z))q.AdornPart.CFrame=tempCFrame+tempCFrame:vectorToWorldSpace(G/2)end
|
magnitude>3)or D.Dimensions>1 then D.Adorn.Parent=U end end end if not(U~=nil)
|
||||||
local G=nil if game.Players['LocalPlayer']then G=game.Players.LocalPlayer:
|
then U=game:GetService'CoreGui'if(D.Dimensions==1 and Q.magnitude>3)or D.
|
||||||
FindFirstChild'PlayerGui'if G and G:IsA'PlayerGui'then if(q.Dimensions==1 and B.
|
Dimensions>1 then D.Adorn.Parent=U end end end local P P=function(Q)if not Q
|
||||||
magnitude>3)or q.Dimensions>1 then q.Adorn.Parent=G end end end if G==nil then G
|
|
||||||
=game:GetService'CoreGui'if(q.Dimensions==1 and B.magnitude>3)or q.Dimensions>1
|
|
||||||
then q.Adorn.Parent=G end end end local function DoStamperMouseMove(A)if not A
|
|
||||||
then error'Error: RbxStamper.DoStamperMouseMove: Mouse is nil'return end if not
|
then error'Error: RbxStamper.DoStamperMouseMove: Mouse is nil'return end if not
|
||||||
A:IsA'Mouse'then error('Error: RbxStamper.DoStamperMouseMove: Mouse is of type',
|
Q:IsA'Mouse'then error('Error: RbxStamper.DoStamperMouseMove: Mouse is of type',
|
||||||
A.className,'should be of type Mouse')return end if not A.Target then local B=
|
Q.className,'should be of type Mouse')return end if not Q.Target then local R=c(
|
||||||
GetTerrainForMouse(A)if nil==B then return end end if not l then return end
|
Q)if nil==R then return end end if not y then return end local R,S,T=v(Q,y)if
|
||||||
configFound,targetCFrame,targetSurface=findConfigAtMouseTarget(A,l)if not
|
not R then error'RbxStamper.DoStamperMouseMove No configFound, returning'return
|
||||||
configFound then error'RbxStamper.DoStamperMouseMove No configFound, returning'
|
end local U=0 if k(y.CurrentParts)and T~=1 and T~=4 then if T==3 then U=0-x+k(y.
|
||||||
return end local B=0 if autoAlignToFace(l.CurrentParts)and targetSurface~=1 and
|
CurrentParts)elseif T==0 then U=2-x+k(y.CurrentParts)elseif T==5 then U=3-x+k(y.
|
||||||
targetSurface~=4 then if targetSurface==3 then B=0-k+autoAlignToFace(l.
|
CurrentParts)elseif T==2 then U=1-x+k(y.CurrentParts)end end local V=math.pi/2 x
|
||||||
CurrentParts)elseif targetSurface==0 then B=2-k+autoAlignToFace(l.CurrentParts)
|
=x+U if y.CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool'then f(y.
|
||||||
elseif targetSurface==5 then B=3-k+autoAlignToFace(l.CurrentParts)elseif
|
CurrentParts,V*U)else y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,V*U,0){y
|
||||||
targetSurface==2 then B=1-k+autoAlignToFace(l.CurrentParts)end end local C=math.
|
.CurrentParts.CFrame}end local W,X W,X=q(y.CurrentParts)local Y if y.
|
||||||
pi/2 k=k+B if l.CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then
|
CurrentParts:IsA'Model'then Y=y.CurrentParts:GetModelCFrame()else Y=y.
|
||||||
modelRotate(l.CurrentParts,C*B)else l.CurrentParts.CFrame=CFrame.
|
CurrentParts.CFrame end W=W+(S.p-Y.p)X=X+(S.p-Y.p)if h(W+d,X-d)then if L.CFrame
|
||||||
fromEulerAnglesXYZ(0,C*B,0)*l.CurrentParts.CFrame end local D,G=
|
then if y.CurrentParts:FindFirstChild('ClusterMaterial',true)then local ak=y.
|
||||||
getBoundingBoxInWorldCoordinates(l.CurrentParts)local H=nil if l.CurrentParts:
|
CurrentParts:FindFirstChild('ClusterMaterial',true)if ak:IsA'Vector3Value'then
|
||||||
IsA'Model'then H=l.CurrentParts:GetModelCFrame()else H=l.CurrentParts.CFrame end
|
local al=y.CurrentParts:FindFirstChild('ClusterMaterial',true)if al then al=
|
||||||
D=D+targetCFrame.p-H.p G=G+targetCFrame.p-H.p if clusterPartsInRegion(D+b,G-b)
|
clusterMat end end end end return end if N()then local ak=game.Workspace.Terrain
|
||||||
then if y.CFrame then if l.CurrentParts:FindFirstChild('ClusterMaterial',true)
|
:WorldToCell(S.p)local al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax=game.Workspace.
|
||||||
then local I=l.CurrentParts:FindFirstChild('ClusterMaterial',true)if I:IsA
|
Terrain:CellCenterToWorld(ak.X,ak.Y,ak.Z),nil,nil,nil,nil,nil,nil,nil,nil,nil,
|
||||||
'Vector3Value'then local J=l.CurrentParts:FindFirstChild('ClusterMaterial',true)
|
nil,nil,nil ao,ao,ao,ap,aq,ar,as,at,au,av,aw,ax=S:components()S=CFrame.new(al.X,
|
||||||
if J then J=clusterMat end end end end return end if isMegaClusterPart()then
|
al.Y,al.Z,ap,aq,ar,as,at,au,av,aw,ax)end m(S,y.CurrentParts)L.CFrame=S if y.
|
||||||
local I=game.Workspace.Terrain:WorldToCell(targetCFrame.p)local J,K,L,M,N,O,P,Q,
|
CurrentParts:FindFirstChild('ClusterMaterial',true)then local ak=y.CurrentParts:
|
||||||
R,S,T,U,V=game.Workspace.Terrain:CellCenterToWorld(I.X,I.Y,I.Z),targetCFrame:
|
FindFirstChild('ClusterMaterial',true)if ak:IsA'Vector3Value'then L.
|
||||||
components()targetCFrame=CFrame.new(J.X,J.Y,J.Z,N,O,P,Q,R,S,T,U,V)end
|
TerrainOrientation=ak.Value.Z end end if Q and Q.Target and Q.Target.Parent then
|
||||||
positionPartsAtCFrame3(targetCFrame,l.CurrentParts)y.CFrame=targetCFrame if l.
|
local ak=Q.Target:FindFirstChild'RobloxModel'if not ak then ak=Q.Target.Parent:
|
||||||
CurrentParts:FindFirstChild('ClusterMaterial',true)then local I=l.CurrentParts:
|
FindFirstChild'RobloxModel'end local al=y.CurrentParts:FindFirstChild
|
||||||
FindFirstChild('ClusterMaterial',true)if I:IsA'Vector3Value'then y.
|
'UnstampableFaces'do local ao,ap='',''if ak and ak.Parent:FindFirstChild
|
||||||
TerrainOrientation=I.Value.Z end end if A and A.Target and A.Target.Parent then
|
'UnstampableFaces'then ao=ak.Parent.UnstampableFaces.Value end if al then ap=al.
|
||||||
local I=A.Target:FindFirstChild'RobloxModel'if not I then I=A.Target.Parent:
|
Value end local aq=0 if ak then aq=o(ak.Parent,game.Workspace.CurrentCamera.
|
||||||
FindFirstChild'RobloxModel'end local J=l.CurrentParts:FindFirstChild
|
CoordinateFrame.p,Q.Hit.p)end for ar in string.gmatch(ao,'[^,]+')do if aq==
|
||||||
'UnstampableFaces'do local M,N='',''if I and I.Parent:FindFirstChild
|
tonumber(ar)then H=true game.JointsService:ClearJoinAfterMoveJoints()return end
|
||||||
'UnstampableFaces'then M=I.Parent.UnstampableFaces.Value end if J then N=J.Value
|
end aq=o(y.CurrentParts,Q.Hit.p,game.Workspace.CurrentCamera.CoordinateFrame.p)
|
||||||
end local O=0 if I then O=modelTargetSurface(I.Parent,game.Workspace.
|
for as in string.gmatch(ap,'[^,]+')do if aq==tonumber(as)then H=true game.
|
||||||
CurrentCamera.CoordinateFrame.p,A.Hit.p)end for P in string.gmatch(M,'[^,]+')do
|
JointsService:ClearJoinAfterMoveJoints()return end end end end H=false game.
|
||||||
if O==tonumber(P)then u=true game.JointsService:ClearJoinAfterMoveJoints()return
|
JointsService:SetJoinAfterMoveInstance(y.CurrentParts)if(not pcall(function()if
|
||||||
end end O=modelTargetSurface(l.CurrentParts,A.Hit.p,game.Workspace.CurrentCamera
|
Q and Q.Target and not(Q.Target.Parent:FindFirstChild'RobloxModel'~=nil)then
|
||||||
.CoordinateFrame.p)for Q in string.gmatch(N,'[^,]+')do if O==tonumber(Q)then u=
|
return else return end end))then error
|
||||||
true game.JointsService:ClearJoinAfterMoveJoints()return end end end end u=false
|
|
||||||
game.JointsService:SetJoinAfterMoveInstance(l.CurrentParts)if not pcall(function
|
|
||||||
()if A and A.Target and A.Target.Parent:FindFirstChild'RobloxModel'==nil then
|
|
||||||
return else return end end)then error
|
|
||||||
[[Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check]]game.
|
[[Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check]]game.
|
||||||
JointsService:ClearJoinAfterMoveJoints()A=nil return end if A and A.Target and A
|
JointsService:ClearJoinAfterMoveJoints()Q=nil return end if Q and Q.Target and
|
||||||
.Target.Parent:FindFirstChild'RobloxModel'==nil then game.JointsService:
|
not(Q.Target.Parent:FindFirstChild'RobloxModel'~=nil)then game.JointsService:
|
||||||
SetJoinAfterMoveTarget(A.Target)else game.JointsService:SetJoinAfterMoveTarget(
|
SetJoinAfterMoveTarget(Q.Target)else game.JointsService:SetJoinAfterMoveTarget(
|
||||||
nil)end game.JointsService:ShowPermissibleJoints()if isMegaClusterPart()and q
|
nil)end game.JointsService:ShowPermissibleJoints()if N()and D and D.Start then
|
||||||
and q.Start then DoHighScalabilityRegionSelect()end end local function
|
return O()end end local ak ak=function(al,ao)if E and E['Paused']then return end
|
||||||
setupKeyListener(A,B)if r and r['Paused']then return end A=string.lower(A)if A==
|
al=string.lower(al)if al=='r'and not k(y.CurrentParts)then x=x+1 local ap=y.
|
||||||
'r'and not autoAlignToFace(l.CurrentParts)then k=k+1 local C=l.CurrentParts:
|
CurrentParts:FindFirstChild('ClusterMaterial',true)if ap and ap:IsA
|
||||||
FindFirstChild('ClusterMaterial',true)if C and C:IsA'Vector3Value'then C.Value=
|
'Vector3Value'then ap.Value=Vector3.new(ap.Value.X,ap.Value.Y,(ap.Value.Z+1)%4)
|
||||||
Vector3.new(C.Value.X,C.Value.Y,(C.Value.Z+1)%4)end local D=math.pi/2 if l.
|
end local aq=math.pi/2 if y.CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool'
|
||||||
CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then modelRotate(l.
|
then f(y.CurrentParts,aq)else y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,
|
||||||
CurrentParts,D)else l.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,D,0)*l.
|
aq,0)*y.CurrentParts.CFrame end local as,at=v(ao,y)if as then m(at,y.
|
||||||
CurrentParts.CFrame end configFound,targetCFrame=findConfigAtMouseTarget(B,l)if
|
CurrentParts)return P(ao)end elseif al=='c'then if D.InternalLine and D.
|
||||||
configFound then positionPartsAtCFrame3(targetCFrame,l.CurrentParts)
|
InternalLine.magnitude>0 and D.Dimensions<3 then D.MorePoints[D.Dimensions]=D.
|
||||||
DoStamperMouseMove(B)end elseif A=='c'then if q.InternalLine and q.InternalLine.
|
End D.MoreLines[D.Dimensions]=D.InternalLine D.Dimensions=D.Dimensions+1 D.
|
||||||
magnitude>0 and q.Dimensions<3 then q.MorePoints[q.Dimensions]=q.End q.MoreLines
|
NewHint=true end end end J=ae.KeyDown:connect(function(al)return ak(al,ae)end)
|
||||||
[q.Dimensions]=q.InternalLine q.Dimensions=q.Dimensions+1 q.NewHint=true end end
|
local al al=function()if D then D.Start=nil D.End=nil D.InternalLine=nil D.
|
||||||
end w=d.KeyDown:connect(function(A)setupKeyListener(A,d)end)local function
|
NewHint=true end end local ao ao=function()local ap=game.CoreGui if game:
|
||||||
resetHighScalabilityLine()if q then q.Start=nil q.End=nil q.InternalLine=nil q.
|
|
||||||
NewHint=true end end local function flashRedBox()local A=game.CoreGui if game:
|
|
||||||
FindFirstChild'Players'then if game.Players['LocalPlayer']then if game.Players.
|
FindFirstChild'Players'then if game.Players['LocalPlayer']then if game.Players.
|
||||||
LocalPlayer:FindFirstChild'PlayerGui'then A=game.Players.LocalPlayer.PlayerGui
|
LocalPlayer:FindFirstChild'PlayerGui'then ap=game.Players.LocalPlayer.PlayerGui
|
||||||
end end end if not l['ErrorBox']then return end l.ErrorBox.Parent=A if l.
|
end end end if not y['ErrorBox']then return end y.ErrorBox.Parent=ap if y.
|
||||||
CurrentParts:IsA'Tool'then l.ErrorBox.Adornee=l.CurrentParts.Handle else l.
|
CurrentParts:IsA'Tool'then y.ErrorBox.Adornee=y.CurrentParts.Handle else y.
|
||||||
ErrorBox.Adornee=l.CurrentParts end delay(0,function()for B=1,3 do if l[
|
ErrorBox.Adornee=y.CurrentParts end return delay(0,function()for aq=1,3 do if y[
|
||||||
'ErrorBox']then l.ErrorBox.Visible=true end wait(0.13)if l['ErrorBox']then l.
|
'ErrorBox']then y.ErrorBox.Visible=true end wait(0.13)if y['ErrorBox']then y.
|
||||||
ErrorBox.Visible=false end wait(0.13)end if l['ErrorBox']then l.ErrorBox.Adornee
|
ErrorBox.Visible=false end wait(0.13)end if y['ErrorBox']then y.ErrorBox.Adornee
|
||||||
=nil l.ErrorBox.Parent=Tool end end)end local function DoStamperMouseDown(A)if
|
=nil y.ErrorBox.Parent=Tool end end)end local ap ap=function(aq)if not aq then
|
||||||
not A then error'Error: RbxStamper.DoStamperMouseDown: Mouse is nil'return end
|
error'Error: RbxStamper.DoStamperMouseDown: Mouse is nil'return end if not aq:
|
||||||
if not A:IsA'Mouse'then error(
|
IsA'Mouse'then error('Error: RbxStamper.DoStamperMouseDown: Mouse is of type',aq
|
||||||
'Error: RbxStamper.DoStamperMouseDown: Mouse is of type',A.className,
|
.className,'should be of type Mouse')return end if not y then return end if N()
|
||||||
'should be of type Mouse')return end if not l then return end if
|
then if aq and D then local as,at=y.CurrentParts:FindFirstChild(
|
||||||
isMegaClusterPart()then if A and q then local B,C=l.CurrentParts:FindFirstChild(
|
'MegaClusterCube',true),game.Workspace.Terrain if as then D.Dimensions=1 local
|
||||||
'MegaClusterCube',true),game.Workspace.Terrain if B then q.Dimensions=1 local D=
|
au=at:WorldToCell(as.CFrame.p)D.Start=at:CellCenterToWorld(au.X,au.Y,au.Z)return
|
||||||
C:WorldToCell(B.CFrame.p)q.Start=C:CellCenterToWorld(D.X,D.Y,D.Z)return else q.
|
else D.Dimensions=1 local au=at:WorldToCell(y.CurrentParts.CFrame.p)D.Start=at:
|
||||||
Dimensions=1 local D=C:WorldToCell(l.CurrentParts.CFrame.p)q.Start=C:
|
CellCenterToWorld(au.X,au.Y,au.Z)return end end end end local aq aq=function(as,
|
||||||
CellCenterToWorld(D.X,D.Y,D.Z)return end end end end local function
|
at)as.TopSurface=at[1]as.BottomSurface=at[2]as.LeftSurface=at[3]as.RightSurface=
|
||||||
loadSurfaceTypes(A,B)A.TopSurface=B[1]A.BottomSurface=B[2]A.LeftSurface=B[3]A.
|
at[4]as.FrontSurface=at[5]as.BackSurface=at[6]return as end local as as=function
|
||||||
RightSurface=B[4]A.FrontSurface=B[5]A.BackSurface=B[6]end local function
|
(at,au)local av={}av[1]=at.TopSurface av[2]=at.BottomSurface av[3]=at.
|
||||||
saveSurfaceTypes(A,B)local C={}C[1]=A.TopSurface C[2]=A.BottomSurface C[3]=A.
|
LeftSurface av[4]=at.RightSurface av[5]=at.FrontSurface av[6]=at.BackSurface au[
|
||||||
LeftSurface C[4]=A.RightSurface C[5]=A.FrontSurface C[6]=A.BackSurface B[A]=C
|
at]=av end local at at=function(au)if not au then return nil end local av,aw,ax,
|
||||||
end local function prepareModel(A)if not A then return nil end local B,C,D,G,H,I
|
Q,R,S=0.7,1,au:Clone(),{},{},{}y={}y.DisabledScripts={}y.TransparencyTable={}y.
|
||||||
=0.7,1,A:Clone(),{},{},{}l={}l.DisabledScripts={}l.TransparencyTable={}l.
|
MaterialTable={}y.CanCollideTable={}y.AnchoredTable={}y.ArchivableTable={}y.
|
||||||
MaterialTable={}l.CanCollideTable={}l.AnchoredTable={}l.ArchivableTable={}l.
|
DecalTransparencyTable={}y.SurfaceTypeTable={}g(ax,R,Q,S)if#R<=0 then return nil
|
||||||
DecalTransparencyTable={}l.SurfaceTypeTable={}collectParts(D,H,G,I)if#H<=0 then
|
,'no parts found in modelToStamp'end for T,U in pairs(Q)do if not U.Disabled
|
||||||
return nil,'no parts found in modelToStamp'end for J,M in pairs(G)do if not M.
|
then U.Disabled=true y.DisabledScripts[#y.DisabledScripts+1]=U end end for V,W
|
||||||
Disabled then M.Disabled=true l.DisabledScripts[#l.DisabledScripts+1]=M end end
|
in pairs(R)do y.TransparencyTable[W]=W.Transparency W.Transparency=aw+(1-aw)*W.
|
||||||
for N,O in pairs(H)do l.TransparencyTable[O]=O.Transparency O.Transparency=C+(1-
|
Transparency y.MaterialTable[W]=W.Material W.Material=Enum.Material.Plastic y.
|
||||||
C)*O.Transparency l.MaterialTable[O]=O.Material O.Material=Enum.Material.Plastic
|
CanCollideTable[W]=W.CanCollide W.CanCollide=false y.AnchoredTable[W]=W.Anchored
|
||||||
l.CanCollideTable[O]=O.CanCollide O.CanCollide=false l.AnchoredTable[O]=O.
|
W.Anchored=true y.ArchivableTable[W]=W.Archivable W.Archivable=false as(W,y.
|
||||||
Anchored O.Anchored=true l.ArchivableTable[O]=O.Archivable O.Archivable=false
|
SurfaceTypeTable)local X,Y=0.5,0.5 delay(0,function()wait(X)local ay=tick()local
|
||||||
saveSurfaceTypes(O,l.SurfaceTypeTable)local Q,R=0.5,0.5 delay(0,function()wait(Q
|
az=ay while(az-ay)<Y and W and W:IsA'BasePart'and W.Transparency>av do local aA=
|
||||||
)local S=tick()local T=S while(T-S)<R and O and O:IsA'BasePart'and O.
|
1-(((az-ay)/Y)*(aw-av))if y['TransparencyTable']and y.TransparencyTable[W]then W
|
||||||
Transparency>B do local U=1-(((T-S)/R)*(C-B))if l['TransparencyTable']and l.
|
.Transparency=aA+(1-aA)*y.TransparencyTable[W]end wait(0.03)az=tick()end if W
|
||||||
TransparencyTable[O]then O.Transparency=U+(1-U)*l.TransparencyTable[O]end wait(
|
and W:IsA'BasePart'then if y['TransparencyTable']and y.TransparencyTable[W]then
|
||||||
0.03)T=tick()end if O and O:IsA'BasePart'then if l['TransparencyTable']and l.
|
W.Transparency=av+(1-av)*y.TransparencyTable[W]end end end)end for ay,az in
|
||||||
TransparencyTable[O]then O.Transparency=B+(1-B)*l.TransparencyTable[O]end end
|
pairs(S)do y.DecalTransparencyTable[az]=az.Transparency az.Transparency=av+(1-av
|
||||||
end)end for Q,R in pairs(I)do l.DecalTransparencyTable[R]=R.Transparency R.
|
)*az.Transparency end j(ax,true)j(ax,false)y.CurrentParts=ax if k(ax)then y.
|
||||||
Transparency=B+(1-B)*R.Transparency end setSeatEnabledStatus(D,true)
|
CurrentParts:ResetOrientationToIdentity()x=0 else local aA=x*math.pi/2 if y.
|
||||||
setSeatEnabledStatus(D,false)l.CurrentParts=D if autoAlignToFace(D)then l.
|
CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool'then f(y.CurrentParts,aA)else
|
||||||
CurrentParts:ResetOrientationToIdentity()k=0 else local S=k*math.pi/2 if l.
|
y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,aA,0)*y.CurrentParts.CFrame
|
||||||
CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then modelRotate(l.
|
end end local aA=y.CurrentParts:FindFirstChild('ClusterMaterial',true)if aA and
|
||||||
CurrentParts,S)else l.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,S,0)*l.
|
aA:IsA'Vector3Value'then aA.Value=Vector3.new(aA.Value.X,aA.Value.Y,(aA.Value.Z+
|
||||||
CurrentParts.CFrame end end local S=l.CurrentParts:FindFirstChild(
|
x)%4)end local X,Y X,Y=v(ae,y)if X then y.CurrentParts=m(Y,y.CurrentParts)end
|
||||||
'ClusterMaterial',true)if S and S:IsA'Vector3Value'then S.Value=Vector3.new(S.
|
game.JointsService:SetJoinAfterMoveInstance(y.CurrentParts)return ax,R end local
|
||||||
Value.X,S.Value.Y,(S.Value.Z+k)%4)end local T,U=findConfigAtMouseTarget(d,l)if T
|
au au=function(av,aw)local ax=game.Workspace.Terrain.CellCenterToWorld local ay=
|
||||||
then l.CurrentParts=positionPartsAtCFrame3(U,l.CurrentParts)end game.
|
ax(game.Workspace.Terrain,av.X,av.Y,av.Z)local az,aA=game.Workspace:
|
||||||
JointsService:SetJoinAfterMoveInstance(l.CurrentParts)return D,H end
|
FindPartsInRegion3(Region3.new(ay-Vector3.new(2,2,2)+d,ay+Vector3.new(2,2,2)-d),
|
||||||
local function checkTerrainBlockCollisions(A,B)local C=game.Workspace.Terrain.
|
y.CurrentParts,100),false for Q=1,#az do if t(az[Q])then aA=true break end end
|
||||||
CellCenterToWorld local D=C(game.Workspace.Terrain,A.X,A.Y,A.Z)local G,H=game.
|
if not aA then local Q={}for R=1,#az do if az[R].Parent and not Q[az[R].Parent]
|
||||||
Workspace:FindPartsInRegion3(Region3.new(D-Vector3.new(2,2,2)+b,D+Vector3.new(2,
|
and az[R].Parent:FindFirstChild(az[R].Parent:FindFirstChild'Humanoid':IsA
|
||||||
2,2)-b),l.CurrentParts,100),false for I=1,#G do if isBlocker(G[I])then H=true
|
'Humanoid')then local S=az[R].Parent:FindFirstChild'Torso'Q[az[R].Parent]=true
|
||||||
break end end if not H then local I={}for M=1,#G do if G[M].Parent and not I[G[M
|
if S then local U=ay.Y+5 if u(S,U,y)then S.CFrame=S.CFrame+Vector3.new(0,U-S.
|
||||||
].Parent]and G[M].Parent:FindFirstChild'Humanoid'and G[M].Parent:FindFirstChild
|
CFrame.p.Y,0)else aA=true break end end end end end if not aA then local Q=true
|
||||||
'Humanoid':IsA'Humanoid'then local O=G[M].Parent:FindFirstChild'Torso'I[G[M].
|
if aw then if aj then av=ax(game.Workspace.Terrain,av.X,av.Y,av.Z)if(av.X+2>aj.
|
||||||
Parent]=true if O then local Q=D.Y+5 if spaceAboveCharacter(O,Q,l)then O.CFrame=
|
CFrame.p.X+aj.Size.X/2)or(av.X-2<aj.CFrame.p.X-aj.Size.X/2)or(av.Y+2>aj.CFrame.p
|
||||||
O.CFrame+Vector3.new(0,Q-O.CFrame.p.Y,0)else H=true break end end end end end if
|
.Y+aj.Size.Y/2)or(av.Y-2<aj.CFrame.p.Y-aj.Size.Y/2)or(av.Z+2>aj.CFrame.p.Z+aj.
|
||||||
not H then local I=true if B then if i then local M=C(game.Workspace.Terrain,A.X
|
Size.Z/2)or(av.Z-2<aj.CFrame.p.Z-aj.Size.Z/2)then Q=false end end end return Q
|
||||||
,A.Y,A.Z)if(M.X+2>i.CFrame.p.X+i.Size.X/2)or(M.X-2<i.CFrame.p.X-i.Size.X/2)or(M.
|
end return false end local av av=function(aw)local ax,ay,az,aA,Q,R,S,U,W=false,
|
||||||
Y+2>i.CFrame.p.Y+i.Size.Y/2)or(M.Y-2<i.CFrame.p.Y-i.Size.Y/2)or(M.Z+2>i.CFrame.p
|
game.Workspace.Terrain,D.InternalLine,game.Workspace.Terrain.MaxExtents.Max,game
|
||||||
.Z+i.Size.Z/2)or(M.Z-2<i.CFrame.p.Z-i.Size.Z/2)then I=false end end end return I
|
.Workspace.Terrain.MaxExtents.Min,1,0,0,false if y.CurrentParts:FindFirstChild
|
||||||
end return false end local function ResolveMegaClusterStamp(A)local B,C,D,G,H,I,
|
'AutoWedge'then W=true end if y.CurrentParts:FindFirstChild('ClusterMaterial',
|
||||||
M,O,Q=false,game.Workspace.Terrain,q.InternalLine,game.Workspace.Terrain.
|
true)then R=y.CurrentParts:FindFirstChild('ClusterMaterial',true)if R:IsA
|
||||||
MaxExtents.Max,game.Workspace.Terrain.MaxExtents.Min,1,0,0,false if l.
|
'Vector3Value'then S=R.Value.Y U=R.Value.Z R=R.Value.X elseif R:IsA'IntValue'
|
||||||
CurrentParts:FindFirstChild'AutoWedge'then Q=true end if l.CurrentParts:
|
then R=R.Value end end if D.Adorn.Parent and D.Start and((D.Dimensions>1)or(az
|
||||||
FindFirstChild('ClusterMaterial',true)then I=l.CurrentParts:FindFirstChild(
|
and az.magnitude>0))then local X,Y,aB,aC,aD,aE,aF,aG=game.Workspace.Terrain:
|
||||||
'ClusterMaterial',true)if I:IsA'Vector3Value'then M=I.Value.Y O=I.Value.Z I=I.
|
WorldToCell(D.Start),{0,0,0},{0,0,0},{0,0,0},{nil,nil,nil},{Vector3.new(0,0,0),
|
||||||
Value.X elseif I:IsA'IntValue'then I=I.Value end end if q.Adorn.Parent and q.
|
Vector3.new(0,0,0),Vector3.new(0,0,0)},{Vector3.new(1,0,0),Vector3.new(0,1,0),
|
||||||
Start and((q.Dimensions>1)or(D and D.magnitude>0))then local R,S,T,U,V,W,X,Y=
|
Vector3.new(0,0,1)},{}if D.Dimensions>1 then table.insert(aG,D.MoreLines[1])end
|
||||||
game.Workspace.Terrain:WorldToCell(q.Start),{0,0,0},{0,0,0},{0,0,0},{nil,nil,nil
|
if az and az.magnitude>0 then table.insert(aG,az)end if D.Dimensions>2 then
|
||||||
},{Vector3.new(0,0,0),Vector3.new(0,0,0),Vector3.new(0,0,0)},{Vector3.new(1,0,0)
|
table.insert(aG,D.MoreLines[2])end for aH=1,#aG do aG[aH]=Vector3.new(math.
|
||||||
,Vector3.new(0,1,0),Vector3.new(0,0,1)},{}if q.Dimensions>1 then table.insert(Y,
|
floor(aG[aH].X+0.5),math.floor(aG[aH].Y+0.5),math.floor(aG[aH].Z+0.5))if aG[aH].
|
||||||
q.MoreLines[1])end if D and D.magnitude>0 then table.insert(Y,D)end if q.
|
X>0 then Y[aH]=1 elseif aG[aH].X<0 then Y[aH]=-1 end if aG[aH].Y>0 then aB[aH]=1
|
||||||
Dimensions>2 then table.insert(Y,q.MoreLines[2])end for Z=1,#Y do Y[Z]=Vector3.
|
elseif aG[aH].Y<0 then aB[aH]=-1 end if aG[aH].Z>0 then aC[aH]=1 elseif aG[aH].Z
|
||||||
new(math.floor(Y[Z].X+0.5),math.floor(Y[Z].Y+0.5),math.floor(Y[Z].Z+0.5))if Y[Z]
|
<0 then aC[aH]=-1 end aD[aH]=Vector3.new(Y[aH],aB[aH],aC[aH])if aD[aH].magnitude
|
||||||
.X>0 then S[Z]=1 elseif Y[Z].X<0 then S[Z]=-1 end if Y[Z].Y>0 then T[Z]=1 elseif
|
<0.9 then aD[aH]=nil end end if not aG[2]then aG[2]=Vector3.new(0,0,0)end if not
|
||||||
Y[Z].Y<0 then T[Z]=-1 end if Y[Z].Z>0 then U[Z]=1 elseif Y[Z].Z<0 then U[Z]=-1
|
aG[3]then aG[3]=Vector3.new(0,0,0)end local aH,aI=y.CurrentParts:FindFirstChild(
|
||||||
end V[Z]=Vector3.new(S[Z],T[Z],U[Z])if V[Z].magnitude<0.9 then V[Z]=nil end end
|
'WaterForceTag',true),y.CurrentParts:FindFirstChild('WaterForceDirectionTag',
|
||||||
if not Y[2]then Y[2]=Vector3.new(0,0,0)end if not Y[3]then Y[3]=Vector3.new(0,0,
|
true)while aE[3].magnitude*4<=aG[3].magnitude do local aJ=1 while aJ<4 do aE[2]=
|
||||||
0)end local Z,_=l.CurrentParts:FindFirstChild('WaterForceTag',true),l.
|
Vector3.new(0,0,0)while aE[2].magnitude*4<=aG[2].magnitude do local aK=1 while
|
||||||
CurrentParts:FindFirstChild('WaterForceDirectionTag',true)while W[3].magnitude*4
|
aK<4 do aE[1]=Vector3.new(0,0,0)while aE[1].magnitude*4<=aG[1].magnitude do
|
||||||
<=Y[3].magnitude do local aa=1 while aa<4 do W[2]=Vector3.new(0,0,0)while W[2].
|
local aL=aE[1]+aE[2]+aE[3]local aM=Vector3int16.new(X.X+aL.X,X.Y+aL.Y,X.Z+aL.Z)
|
||||||
magnitude*4<=Y[2].magnitude do local ab=1 while ab<4 do W[1]=Vector3.new(0,0,0)
|
if aM.X>=Q.X and aM.Y>=Q.Y and aM.Z>=Q.Z and aM.X<aA.X and aM.Y<aA.Y and aM.Z<aA
|
||||||
while W[1].magnitude*4<=Y[1].magnitude do local ac=W[1]+W[2]+W[3]local ad=
|
.Z then local aN=au(aM,aw)if aN then if aH then ay:SetWaterCell(aM.X,aM.Y,aM.Z,
|
||||||
Vector3int16.new(R.X+ac.X,R.Y+ac.Y,R.Z+ac.Z)if ad.X>=H.X and ad.Y>=H.Y and ad.Z
|
Enum.WaterForce[aH.Value],Enum.WaterDirection[aI.Value])else ay:SetCell(aM.X,aM.
|
||||||
>=H.Z and ad.X<G.X and ad.Y<G.Y and ad.Z<G.Z then local ae=
|
Y,aM.Z,R,S,U)end ax=true if W then game.Workspace.Terrain:AutowedgeCells(
|
||||||
checkTerrainBlockCollisions(ad,A)if ae then if Z then C:SetWaterCell(ad.X,ad.Y,
|
Region3int16.new(Vector3int16.new(aM.x-1,aM.y-1,aM.z-1),Vector3int16.new(aM.x+1,
|
||||||
ad.Z,Enum.WaterForce[Z.Value],Enum.WaterDirection[_.Value])else C:SetCell(ad.X,
|
aM.y+1,aM.z+1)))end end end aE[1]=aE[1]+aD[1]end if aD[2]then while aK<4 and aF[
|
||||||
ad.Y,ad.Z,I,M,O)end B=true if Q then game.Workspace.Terrain:AutowedgeCells(
|
aK]:Dot(aD[2])==0 do aK=aK+1 end if aK<4 then aE[2]=aE[2]+aF[aK]*aF[aK]:Dot(aD[2
|
||||||
Region3int16.new(Vector3int16.new(ad.x-1,ad.y-1,ad.z-1),Vector3int16.new(ad.x+1,
|
])end aK=aK+1 else aE[2]=Vector3.new(1,0,0)aK=4 end if aE[2].magnitude*4>aG[2].
|
||||||
ad.y+1,ad.z+1)))end end end W[1]=W[1]+V[1]end if V[2]then while ab<4 and X[ab]:
|
magnitude then aK=4 end end end if aD[3]then while aJ<4 and aF[aJ]:Dot(aD[3])==0
|
||||||
Dot(V[2])==0 do ab=ab+1 end if ab<4 then W[2]=W[2]+X[ab]*X[ab]:Dot(V[2])end ab=
|
do aJ=aJ+1 end if aJ<4 then aE[3]=aE[3]+aF[aJ]*aF[aJ]:Dot(aD[3])end aJ=aJ+1 else
|
||||||
ab+1 else W[2]=Vector3.new(1,0,0)ab=4 end if W[2].magnitude*4>Y[2].magnitude
|
aE[3]=Vector3.new(1,0,0)aJ=4 end if aE[3].magnitude*4>aG[3].magnitude then aJ=4
|
||||||
then ab=4 end end end if V[3]then while aa<4 and X[aa]:Dot(V[3])==0 do aa=aa+1
|
end end end end D.Start=nil D.Adorn.Parent=nil if ax then y.CurrentParts.Parent=
|
||||||
end if aa<4 then W[3]=W[3]+X[aa]*X[aa]:Dot(V[3])end aa=aa+1 else W[3]=Vector3.
|
nil pcall(function()return game:GetService'ChangeHistoryService':SetWaypoint
|
||||||
new(1,0,0)aa=4 end if W[3].magnitude*4>Y[3].magnitude then aa=4 end end end end
|
'StamperMulti'end)end return ax end local aw aw=function(ax)if not ax then error
|
||||||
q.Start=nil q.Adorn.Parent=nil if B then l.CurrentParts.Parent=nil pcall(
|
'Error: RbxStamper.DoStamperMouseUp: Mouse is nil'return false end if not ax:IsA
|
||||||
function()game:GetService'ChangeHistoryService':SetWaypoint'StamperMulti'end)end
|
'Mouse'then error('Error: RbxStamper.DoStamperMouseUp: Mouse is of type',ax.
|
||||||
return B end local function DoStamperMouseUp(aa)if not aa then error
|
className,'should be of type Mouse')return false end if not y.Dragger then error
|
||||||
'Error: RbxStamper.DoStamperMouseUp: Mouse is nil'return false end if not aa:IsA
|
|
||||||
'Mouse'then error('Error: RbxStamper.DoStamperMouseUp: Mouse is of type',aa.
|
|
||||||
className,'should be of type Mouse')return false end if not l.Dragger then error
|
|
||||||
[[Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil]]return false end
|
[[Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil]]return false end
|
||||||
if not q then return false end local ab=nil if h then local ac,ad=nil,
|
if not D then return false end local ay if ai then local az,aA=nil,N()if aA and
|
||||||
isMegaClusterPart()if ad and q and q.Start and q.InternalLine and q.InternalLine
|
D and D.Start and D.InternalLine and D.InternalLine.magnitude>0 then az=true ay=
|
||||||
.magnitude>0 then ac=true ab=true else ac,ab=a.CanEditRegion(l.CurrentParts,i)
|
true else az,ay=a.CanEditRegion(y.CurrentParts,aj)end if not az then if w then
|
||||||
end if not ac then if j then j()end return false end end if u then flashRedBox()
|
w()end return false end end if H then ao()return false end local az az,ay=a.
|
||||||
return false end canStamp,ab=a.CanEditRegion(l.CurrentParts,i)if not canStamp
|
CanEditRegion(y.CurrentParts,aj)if not az then if w then w()end return false end
|
||||||
then if j then j()end return false end local ac,ad=
|
local aA,aB aA,aB=q(y.CurrentParts)local aC,aD=v(ax,y)if aC and not D.Adorn.
|
||||||
getBoundingBoxInWorldCoordinates(l.CurrentParts)configFound,targetCFrame=
|
Parent then if h(aA+d,aB-d)then ao()return false end local aE=game.Workspace:
|
||||||
findConfigAtMouseTarget(aa,l)if configFound and not q.Adorn.Parent then if
|
FindPartsInRegion3(Region3.new(aA+d,aB-d),y.CurrentParts,100)for aF=1,#aE do if
|
||||||
clusterPartsInRegion(ac+b,ad-b)then flashRedBox()return false end local ae=game.
|
t(aE[aF])then ao()return false end end local aF={}for aG=1,#aE do if aE[aG].
|
||||||
Workspace:FindPartsInRegion3(Region3.new(ac+b,ad-b),l.CurrentParts,100)for A=1,#
|
Parent and not aF[aE[aG].Parent]and aE[aG].Parent:FindFirstChild'Humanoid'and aE
|
||||||
ae do if isBlocker(ae[A])then flashRedBox()return false end end local A={}for B=
|
[aG].Parent:FindFirstChild'Humanoid':IsA'Humanoid'then local aH=aE[aG].Parent:
|
||||||
1,#ae do if ae[B].Parent and not A[ae[B].Parent]and ae[B].Parent:FindFirstChild
|
FindFirstChild'Torso'aF[aE[aG].Parent]=true if aH then local aI=aB.Y+3 if u(aH,
|
||||||
'Humanoid'and ae[B].Parent:FindFirstChild'Humanoid':IsA'Humanoid'then local C=ae
|
aI,y)then aH.CFrame=aH.CFrame+Vector3.new(0,aI-aH.CFrame.p.Y,0)else ao()return
|
||||||
[B].Parent:FindFirstChild'Torso'A[ae[B].Parent]=true if C then local D=ad.Y+3 if
|
false end end end end elseif(not aC)and not(D.Start and D.Adorn.Parent)then al()
|
||||||
spaceAboveCharacter(C,D,l)then C.CFrame=C.CFrame+Vector3.new(0,D-C.CFrame.p.Y,0)
|
return false end if game:FindFirstChild'Players'then if game.Players[
|
||||||
else flashRedBox()return false end end end end elseif(not configFound)and not(q.
|
'LocalPlayer']then if game.Players.LocalPlayer['Character']then local aE=game.
|
||||||
Start and q.Adorn.Parent)then resetHighScalabilityLine()return false end if game
|
Players.LocalPlayer.Character local aF=aE:FindFirstChild'StampTracker'if aF and
|
||||||
:FindFirstChild'Players'then if game.Players['LocalPlayer']then if game.Players.
|
not aF.Value then aF.Value=true end end end end if D.Start and D.Adorn.Parent
|
||||||
LocalPlayer['Character']then local ae=game.Players.LocalPlayer.Character local A
|
and N()then if av(ay)or ay then y.CurrentParts.Parent=nil return true end end D.
|
||||||
=ae:FindFirstChild'StampTracker'if A and not A.Value then A.Value=true end end
|
Start=nil D.Adorn.Parent=nil local aE=game.Workspace.Terrain if N()then local aF
|
||||||
end end if q.Start and q.Adorn.Parent and isMegaClusterPart()then if
|
if y.CurrentParts:IsA'Model'then aF=aE:WorldToCell(y.CurrentParts:
|
||||||
ResolveMegaClusterStamp(ab)or ab then l.CurrentParts.Parent=nil return true end
|
GetModelCFrame().p)else aF=aE:WorldToCell(y.CurrentParts.CFrame.p)end local aG,
|
||||||
end q.Start=nil q.Adorn.Parent=nil local ae=game.Workspace.Terrain if
|
aH=game.Workspace.Terrain.MaxExtents.Max,game.Workspace.Terrain.MaxExtents.Min
|
||||||
isMegaClusterPart()then local A if l.CurrentParts:IsA'Model'then A=ae:
|
if au(aF,false)then local aI,aJ,aK=y.CurrentParts:FindFirstChild(
|
||||||
WorldToCell(l.CurrentParts:GetModelCFrame().p)else A=ae:WorldToCell(l.
|
'ClusterMaterial',true),y.CurrentParts:FindFirstChild('WaterForceTag',true),y.
|
||||||
CurrentParts.CFrame.p)end local B,C=game.Workspace.Terrain.MaxExtents.Max,game.
|
CurrentParts:FindFirstChild('WaterForceDirectionTag',true)if aF.X>=aH.X and aF.Y
|
||||||
Workspace.Terrain.MaxExtents.Min if checkTerrainBlockCollisions(A,false)then
|
>=aH.Y and aF.Z>=aH.Z and aF.X<aG.X and aF.Y<aG.Y and aF.Z<aG.Z then if aJ then
|
||||||
local D,G,H=l.CurrentParts:FindFirstChild('ClusterMaterial',true),l.CurrentParts
|
aE:SetWaterCell(aF.X,aF.Y,aF.Z,Enum.WaterForce[aJ.Value],Enum.WaterDirection[aK.
|
||||||
:FindFirstChild('WaterForceTag',true),l.CurrentParts:FindFirstChild(
|
Value])elseif not aI then aE:SetCell(aF.X,aF.Y,aF.Z,M.Material,M.clusterType,x%4
|
||||||
'WaterForceDirectionTag',true)if A.X>=C.X and A.Y>=C.Y and A.Z>=C.Z and A.X<B.X
|
)elseif aI:IsA'Vector3Value'then aE:SetCell(aF.X,aF.Y,aF.Z,aI.Value.X,aI.Value.Y
|
||||||
and A.Y<B.Y and A.Z<B.Z then if G then ae:SetWaterCell(A.X,A.Y,A.Z,Enum.
|
,aI.Value.Z)else aE:SetCell(aF.X,aF.Y,aF.Z,aI.Value,0,0)end local aL=false if y.
|
||||||
WaterForce[G.Value],Enum.WaterDirection[H.Value])elseif not D then ae:SetCell(A.
|
CurrentParts:FindFirstChild'AutoWedge'then aL=true end if aL then game.Workspace
|
||||||
X,A.Y,A.Z,z.Material,z.clusterType,k%4)elseif D:IsA'Vector3Value'then ae:
|
.Terrain:AutowedgeCells(Region3int16.new(Vector3int16.new(aF.x-1,aF.y-1,aF.z-1),
|
||||||
SetCell(A.X,A.Y,A.Z,D.Value.X,D.Value.Y,D.Value.Z)else ae:SetCell(A.X,A.Y,A.Z,D.
|
Vector3int16.new(aF.x+1,aF.y+1,aF.z+1)))end y.CurrentParts.Parent=nil pcall(
|
||||||
Value,0,0)end local I=false if l.CurrentParts:FindFirstChild'AutoWedge'then I=
|
function()return game:GetService'ChangeHistoryService':SetWaypoint
|
||||||
true end if I then game.Workspace.Terrain:AutowedgeCells(Region3int16.new(
|
'StamperSingle'end)return true end else ao()return false end end local aF aF=
|
||||||
Vector3int16.new(A.x-1,A.y-1,A.z-1),Vector3int16.new(A.x+1,A.y+1,A.z+1)))end l.
|
function()if game:FindFirstChild'Players'then if game.Players['LocalPlayer']then
|
||||||
CurrentParts.Parent=nil pcall(function()game:GetService'ChangeHistoryService':
|
return game.Players.LocalPlayer end end return nil end if y.CurrentParts:IsA
|
||||||
SetWaypoint'StamperSingle'end)return true end else flashRedBox()return false end
|
'Model'or y.CurrentParts:IsA'Tool'then if y.CurrentParts:IsA'Model'then local aG
|
||||||
end local function getPlayer()if game:FindFirstChild'Players'then if game.
|
,aH={},{}ab(y.CurrentParts,aG,aH)y.CurrentParts:BreakJoints()y.CurrentParts:
|
||||||
Players['LocalPlayer']then return game.Players.LocalPlayer end end return nil
|
MakeJoints()ac(aG,aH)end local aG,aH=y.CurrentParts:FindFirstChild'PlayerIdTag',
|
||||||
end if l.CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then if l.
|
y.CurrentParts:FindFirstChild'PlayerNameTag'if(aG~=nil)then local aI=aF()if(aI~=
|
||||||
CurrentParts:IsA'Model'then local A,B={},{}saveTheWelds(l.CurrentParts,A,B)l.
|
nil)then aG.Value=aI.userId end end if(aH~=nil)then if game:FindFirstChild(game.
|
||||||
CurrentParts:BreakJoints()l.CurrentParts:MakeJoints()restoreTheWelds(A,B)end
|
Players['LocalPlayer'])then local aI=game.Players.LocalPlayer if(aI~=nil)then aH
|
||||||
playerIdTag=l.CurrentParts:FindFirstChild'PlayerIdTag'playerNameTag=l.
|
.Value=aI.Name end end end if not(y.CurrentParts:FindFirstChild'RobloxModel'~=
|
||||||
CurrentParts:FindFirstChild'PlayerNameTag'if playerIdTag~=nil then
|
nil)then local aI=Instance.new'BoolValue'aI.Name='RobloxModel'aI.Parent=y.
|
||||||
tempPlayerValue=getPlayer()if tempPlayerValue~=nil then playerIdTag.Value=
|
CurrentParts if not(y.CurrentParts:FindFirstChild'RobloxStamper'~=nil)then local
|
||||||
tempPlayerValue.userId end end if playerNameTag~=nil then if game:FindFirstChild
|
aJ=Instance.new'BoolValue'aJ.Name='RobloxStamper'aJ.Parent=y.CurrentParts end
|
||||||
'Players'and game.Players['LocalPlayer']then tempPlayerValue=game.Players.
|
end else y.CurrentParts:BreakJoints()if not(y.CurrentParts:FindFirstChild
|
||||||
LocalPlayer if tempPlayerValue~=nil then playerNameTag.Value=tempPlayerValue.
|
'RobloxStamper'~=nil)then local aG=Instance.new'BoolValue'aG.Name=
|
||||||
Name end end end if l.CurrentParts:FindFirstChild'RobloxModel'==nil then local A
|
'RobloxStamper'aG.Parent=y.CurrentParts end end if not createJoints then game.
|
||||||
=Instance.new'BoolValue'A.Name='RobloxModel'A.Parent=l.CurrentParts if l.
|
JointsService:CreateJoinAfterMoveJoints()end for aG,aH in pairs(y.
|
||||||
CurrentParts:FindFirstChild'RobloxStamper'==nil then local B=Instance.new
|
TransparencyTable)do aG.Transparency=aH end for aI,aJ in pairs(y.ArchivableTable
|
||||||
'BoolValue'B.Name='RobloxStamper'B.Parent=l.CurrentParts end end else l.
|
)do aI.Archivable=aJ end for aK,aL in pairs(y.MaterialTable)do aK.Material=aL
|
||||||
CurrentParts:BreakJoints()if l.CurrentParts:FindFirstChild'RobloxStamper'==nil
|
end for aM,aN in pairs(y.CanCollideTable)do aM.CanCollide=aN end for Q,R in
|
||||||
then local A=Instance.new'BoolValue'A.Name='RobloxStamper'A.Parent=l.
|
pairs(y.AnchoredTable)do Q.Anchored=R end for S,U in pairs(y.
|
||||||
CurrentParts end end if not createJoints then game.JointsService:
|
DecalTransparencyTable)do S.Transparency=U end for W,X in pairs(y.
|
||||||
CreateJoinAfterMoveJoints()end for A,B in pairs(l.TransparencyTable)do A.
|
SurfaceTypeTable)do aq(W,X)end if N()then y.CurrentParts.Transparency=0 end j(y.
|
||||||
Transparency=B end for C,D in pairs(l.ArchivableTable)do C.Archivable=D end for
|
CurrentParts,true)y.TransparencyTable=nil y.ArchivableTable=nil y.MaterialTable=
|
||||||
G,H in pairs(l.MaterialTable)do G.Material=H end for I,M in pairs(l.
|
nil y.CanCollideTable=nil y.AnchoredTable=nil y.SurfaceTypeTable=nil if not(y.
|
||||||
CanCollideTable)do I.CanCollide=M end for O,Q in pairs(l.AnchoredTable)do O.
|
CurrentParts:FindFirstChild'RobloxModel'~=nil)then local Y=Instance.new
|
||||||
Anchored=Q end for R,S in pairs(l.DecalTransparencyTable)do R.Transparency=S end
|
'BoolValue'Y.Name='RobloxModel'Y.Parent=y.CurrentParts end if ghostRemovalScript
|
||||||
for T,U in pairs(l.SurfaceTypeTable)do loadSurfaceTypes(T,U)end if
|
then ghostRemovalScript.Parent=nil end for Y,aO in pairs(y.DisabledScripts)do aO
|
||||||
isMegaClusterPart()then l.CurrentParts.Transparency=0 end setSeatEnabledStatus(l
|
.Disabled=false end for aP,aQ in pairs(y.DisabledScripts)do local aR=aQ.Parent
|
||||||
.CurrentParts,true)l.TransparencyTable=nil l.ArchivableTable=nil l.MaterialTable
|
aQ.Parent=nil aQ:Clone().Parent=aR end y.DisabledScripts=nil y.Dragger=nil y.
|
||||||
=nil l.CanCollideTable=nil l.AnchoredTable=nil l.SurfaceTypeTable=nil if l.
|
CurrentParts=nil pcall(function()return game:GetService'ChangeHistoryService':
|
||||||
CurrentParts:FindFirstChild'RobloxModel'==nil then local V=Instance.new
|
SetWaypoint'StampedObject'end)return true end local ax ax=function()for ay=1,#I
|
||||||
'BoolValue'V.Name='RobloxModel'V.Parent=l.CurrentParts end if ghostRemovalScript
|
do I[ay]:disconnect()I[ay]=nil end I={}if y and y.CurrentParts then y.
|
||||||
then ghostRemovalScript.Parent=nil end for V,W in pairs(l.DisabledScripts)do W.
|
CurrentParts.Parent=nil y.CurrentParts:Remove()end al()return game.JointsService
|
||||||
Disabled=false end for X,Y in pairs(l.DisabledScripts)do local Z=Y.Parent Y.
|
:ClearJoinAfterMoveJoints()end local ay ay=function(az,aA,aB)local aC,aD={
|
||||||
Parent=nil Y:Clone().Parent=Z end l.DisabledScripts=nil l.Dragger=nil l.
|
Vector3.new(1,0,0),Vector3.new(0,1,0),Vector3.new(0,0,1)},1 if aB<0 then aD=aD*(
|
||||||
CurrentParts=nil pcall(function()game:GetService'ChangeHistoryService':
|
-1)aB=aB*(-1)end local aE=aD*az:vectorToWorldSpace(aC[aB])for aF=1,#aA do local
|
||||||
SetWaypoint'StampedObject'end)return true end local function pauseStamper()for
|
aJ=aA[aF]local aL=aJ.CFrame:vectorToObjectSpace(aE)if math.abs(aL.X)>math.abs(aL
|
||||||
aa=1,#v do v[aa]:disconnect()v[aa]=nil end v={}if l and l.CurrentParts then l.
|
.Y)then if math.abs(aL.X)>math.abs(aL.Z)then if aL.X>0 then aJ.RightSurface=
|
||||||
CurrentParts.Parent=nil l.CurrentParts:Remove()end resetHighScalabilityLine()
|
'Unjoinable'else aJ.LeftSurface='Unjoinable'end else if aL.Z>0 then aJ.
|
||||||
game.JointsService:ClearJoinAfterMoveJoints()end local function
|
BackSurface='Unjoinable'else aJ.FrontSurface='Unjoinable'end end else if math.
|
||||||
prepareUnjoinableSurfaces(aa,ab,ac)local ad,ae={Vector3.new(1,0,0),Vector3.new(0
|
abs(aL.Y)>math.abs(aL.Z)then if aL.Y>0 then aJ.TopSurface='Unjoinable'else aJ.
|
||||||
,1,0),Vector3.new(0,0,1)},1 if ac<0 then ae=ae*-1 ac=ac*-1 end local D=ae*aa:
|
BottomSurface='Unjoinable'end else if aL.Z>0 then aJ.BackSurface='Unjoinable'
|
||||||
vectorToWorldSpace(ad[ac])for H=1,#ab do local M=ab[H]local Q=M.CFrame:
|
else aJ.FrontSurface='Unjoinable'end end end end end local az az=function()local
|
||||||
vectorToObjectSpace(D)if math.abs(Q.X)>math.abs(Q.Y)then if math.abs(Q.X)>math.
|
aA,aB=at(ad)if not aA or not aB then return end local aC=aA:FindFirstChild(
|
||||||
abs(Q.Z)then if Q.X>0 then M.RightSurface='Unjoinable'else M.LeftSurface=
|
'UnjoinableFaces',true)if aC then for aD in string.gmatch(aC.Value,'[^,]*')do if
|
||||||
'Unjoinable'end else if Q.Z>0 then M.BackSurface='Unjoinable'else M.FrontSurface
|
tonumber(aD)then if aA:IsA'Model'then ay(aA:GetModelCFrame(),aB,tonumber(aD))
|
||||||
='Unjoinable'end end else if math.abs(Q.Y)>math.abs(Q.Z)then if Q.Y>0 then M.
|
else ay(aA.CFrame,aB,tonumber(aD))end end end end y.ErrorBox=A if ai then aA.
|
||||||
TopSurface='Unjoinable'else M.BottomSurface='Unjoinable'end else if Q.Z>0 then M
|
Parent=ai else aA.Parent=game.Workspace end if aA:FindFirstChild(
|
||||||
.BackSurface='Unjoinable'else M.FrontSurface='Unjoinable'end end end end end
|
'ClusterMaterial',true)then local aD=aA:FindFirstChild('ClusterMaterial',true)if
|
||||||
local function resumeStamper()clone,parts=prepareModel(c)if not clone or not
|
aD:IsA'Vector3Value'then M.Material=aD.Value.X M.clusterType=aD.Value.Y M.
|
||||||
parts then return end local aa=clone:FindFirstChild('UnjoinableFaces',true)if aa
|
clusterOrientation=aD.Value.Z elseif aD:IsA'IntValue'then M.Material=aD.Value
|
||||||
then for ab in string.gmatch(aa.Value,'[^,]*')do if tonumber(ab)then if clone:
|
end end pcall(function()z=ae.Target end)if z and not(z.Parent:FindFirstChild
|
||||||
IsA'Model'then prepareUnjoinableSurfaces(clone:GetModelCFrame(),parts,tonumber(
|
'RobloxModel'~=nil)then game.JointsService:SetJoinAfterMoveTarget(z)else game.
|
||||||
ab))else prepareUnjoinableSurfaces(clone.CFrame,parts,tonumber(ab))end end end
|
JointsService:SetJoinAfterMoveTarget(nil)end game.JointsService:
|
||||||
end l.ErrorBox=n if h then clone.Parent=h else clone.Parent=game.Workspace end
|
ShowPermissibleJoints()for aD,aE in pairs(y.DisabledScripts)do if aE.Name==
|
||||||
if clone:FindFirstChild('ClusterMaterial',true)then clusterMaterial=clone:
|
'GhostRemovalScript'then aE.Parent=y.CurrentParts end end y.Dragger=Instance.new
|
||||||
FindFirstChild('ClusterMaterial',true)if clusterMaterial:IsA'Vector3Value'then z
|
'Dragger'y.Dragger:MouseDown(aB[1],Vector3.new(0,0,0,aB))y.Dragger:MouseUp()P(ae
|
||||||
.Material=clusterMaterial.Value.X z.clusterType=clusterMaterial.Value.Y z.
|
)table.insert(I,ae.Move:connect(function()if F or G then return end F=true P(ae)
|
||||||
clusterOrientation=clusterMaterial.Value.Z elseif clusterMaterial:IsA'IntValue'
|
F=false end))table.insert(I,ae.Button1Down:connect(function()return ap(ae)end))
|
||||||
then z.Material=clusterMaterial.Value end end pcall(function()m=d.Target end)if
|
table.insert(I,ae.Button1Up:connect(function()G=true while F do wait()end K.
|
||||||
m and m.Parent:FindFirstChild'RobloxModel'==nil then game.JointsService:
|
Value=aw(ae)al()G=false end))K.Value=false end local aA aA=function(aB)if aB
|
||||||
SetJoinAfterMoveTarget(m)else game.JointsService:SetJoinAfterMoveTarget(nil)end
|
then if not aB:IsA'Model'and not aB:IsA'BasePart'then error
|
||||||
game.JointsService:ShowPermissibleJoints()for ab,ac in pairs(l.DisabledScripts)
|
|
||||||
do if ac.Name=='GhostRemovalScript'then ac.Parent=l.CurrentParts end end l.
|
|
||||||
Dragger=Instance.new'Dragger'l.Dragger:MouseDown(parts[1],Vector3.new(0,0,0),
|
|
||||||
parts)l.Dragger:MouseUp()DoStamperMouseMove(d)table.insert(v,d.Move:connect(
|
|
||||||
function()if s or t then return end s=true DoStamperMouseMove(d)s=false end))
|
|
||||||
table.insert(v,d.Button1Down:connect(function()DoStamperMouseDown(d)end))table.
|
|
||||||
insert(v,d.Button1Up:connect(function()t=true while s do wait()end x.Value=
|
|
||||||
DoStamperMouseUp(d)resetHighScalabilityLine()t=false end))x.Value=false end
|
|
||||||
local function resetStamperState(aa)if aa then if not aa:IsA'Model'and not aa:
|
|
||||||
IsA'BasePart'then error
|
|
||||||
[[resetStamperState: newModelToStamp (first arg) is not nil, but not a model or part!]]
|
[[resetStamperState: newModelToStamp (first arg) is not nil, but not a model or part!]]
|
||||||
end c=aa end pauseStamper()resumeStamper()end resetStamperState()r.Stamped=x r.
|
end ad=aB end ax()return az()end aA()E.Stamped=K E.Paused=false E.LoadNewModel=
|
||||||
Paused=false r.LoadNewModel=function(aa)if aa and not aa:IsA'Model'and not aa:
|
function(aB)if aB and not aB:IsA'Model'and not aB:IsA'BasePart'then error
|
||||||
IsA'BasePart'then error
|
|
||||||
[[Control.LoadNewModel: newStampModel (first arg) is not a Model or Part!]]
|
[[Control.LoadNewModel: newStampModel (first arg) is not a Model or Part!]]
|
||||||
return nil end resetStamperState(aa)end r.ReloadModel=function()
|
return nil end return aA(aB)end E.ReloadModel=function()return aA()end E.Pause=
|
||||||
resetStamperState()end r.Pause=function()if not r.Paused then pauseStamper()r.
|
function()if not E.Paused then ax()E.Paused=true else return print
|
||||||
Paused=true else print
|
[[RbxStamper Warning: Tried to call Control.Pause! when already paused]]end end
|
||||||
[[RbxStamper Warning: Tried to call Control.Pause() when already paused]]end end
|
E.Resume=function()if E.Paused then az()E.Paused=false else return print
|
||||||
r.Resume=function()if r.Paused then resumeStamper()r.Paused=false else print
|
[[RbxStamper Warning: Tried to call Control.Resume! without Pausing First]]end
|
||||||
[[RbxStamper Warning: Tried to call Control.Resume() without Pausing First]]end
|
end E.ResetRotation=function()end E.Destroy=function()for aB=1,#I do I[aB]:
|
||||||
end r.ResetRotation=function()end r.Destroy=function()for aa=1,#v do v[aa]:
|
disconnect()I[aB]=nil end if J~=nil then J:disconnect()end game.JointsService:
|
||||||
disconnect()v[aa]=nil end if w then w:disconnect()end game.JointsService:
|
ClearJoinAfterMoveJoints()if C~=nil then C:Destroy()end if B~=nil then B:
|
||||||
ClearJoinAfterMoveJoints()if p then p:Destroy()end if o then o:Destroy()end if n
|
Destroy()end if A~=nil then A:Destroy()end if y~=nil then do local aB=y.Dragger
|
||||||
then n:Destroy()end if l then if l['Dragger']then l.Dragger:Destroy()end if l.
|
if aB~=nil then aB:Destroy()end end end if y~=nil then do local aB=y.
|
||||||
CurrentParts then l.CurrentParts:Destroy()end end if r and r['Stamped']then r.
|
CurrentParts if aB~=nil then aB:Destroy()end end end if E and E['Stamped']then E
|
||||||
Stamped:Destroy()end r=nil end return r end a.Help=function(aa)if aa==
|
.Stamped:Destroy()end E=nil end return E end a.Help=function(ad)if
|
||||||
'GetStampModel'or aa==a.GetStampModel then return
|
'GetStampModel'==ad or a.GetStampModel==ad then return
|
||||||
[[Function GetStampModel. Arguments: assetId, useAssetVersionId. assetId is the asset to load in, define useAssetVersionId as true if assetId is a version id instead of a relative assetId. Side effect: returns a model of the assetId, or a string with error message if something fails]]
|
[[Function GetStampModel. Arguments: assetId, useAssetVersionId. assetId is the asset to load in, define useAssetVersionId as true if assetId is a version id instead of a relative assetId. Side effect: returns a model of the assetId, or a string with error message if something fails]]
|
||||||
end if aa=='SetupStamperDragger'or aa==a.SetupStamperDragger then return
|
elseif'SetupStamperDragger'==ad or a.SetupStamperDragger==ad then return
|
||||||
[[Function SetupStamperDragger. Side Effect: Creates 4x4 stamping mechanism for building out parts quickly. Arguments: ModelToStamp, Mouse, LegalStampCheckFunction. ModelToStamp should be a Model or Part, preferrably loaded from RbxStamper.GetStampModel and should have extents that are multiples of 4. Mouse should be a mouse object (obtained from things such as Tool.OnEquipped), used to drag parts around 'stamp' them out. LegalStampCheckFunction is optional, used as a callback with a table argument (table is full of instances about to be stamped). Function should return either true or false, false stopping the stamp action.]]
|
[[Function SetupStamperDragger. Side Effect: Creates 4x4 stamping mechanism for building out parts quickly. Arguments: ModelToStamp, Mouse, LegalStampCheckFunction. ModelToStamp should be a Model or Part, preferrably loaded from RbxStamper.GetStampModel and should have extents that are multiples of 4. Mouse should be a mouse object (obtained from things such as Tool.OnEquipped), used to drag parts around 'stamp' them out. LegalStampCheckFunction is optional, used as a callback with a table argument (table is full of instances about to be stamped). Function should return either true or false, false stopping the stamp action.]]
|
||||||
end end return a
|
end end return a
|
||||||
|
|
@ -1,189 +1,181 @@
|
||||||
local function waitForChild(a,b)assert(a)assert(b)while not a:FindFirstChild(b)
|
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=a(b)if c then
|
||||||
do print('Waiting for ...',a,b)a.ChildAdded:wait()end return a:FindFirstChild(b)
|
e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then if g==
|
||||||
end local function waitForProperty(a,b)assert(a)assert(b)while not a[b]do a.
|
'Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)=='userdata'
|
||||||
Changed:wait()end end local function IsTouchDevice()local a=false pcall(function
|
then h.Parent=e end end e.Parent=f return e end local b b=function(c,d)assert(c)
|
||||||
()a=Game:GetService'UserInputService'.TouchEnabled end)return a end
|
assert(d)while not c:FindFirstChild(d)do print('Waiting for ...',c,d)c.
|
||||||
waitForChild(game,'Players')waitForProperty(game.Players,'LocalPlayer')local a,b
|
ChildAdded:wait()end return c:FindFirstChild(d)end local c c=function(d,e)
|
||||||
,c=game.Players.LocalPlayer,LoadLibrary'RbxGui'if not b then print
|
assert(d)assert(e)while not d[e]do d.Changed:wait()end end local d d=function()
|
||||||
'could not find RbxGui!'return end local d,e,f,g,h,i,j,k,l,m,n,o='gear',script.
|
local e=false pcall(function()e=Game:GetService'UserInputService'.TouchEnabled
|
||||||
Parent,{},{},false,false,{},{},nil,nil,nil,waitForChild(a,'Backpack')
|
end)return e end b(game,'Players')c(game.Players,'LocalPlayer')local e,f,g=game.
|
||||||
waitForChild(e,'Tabs')waitForChild(e,'Gear')local p,q,r,s=waitForChild(e.Gear,
|
Players.LocalPlayer,nil,nil f,g=LoadLibrary'RbxGui'if not f then print
|
||||||
'GearPreview'),waitForChild(e.Gear,'GearGridScrollingArea'),waitForChild(e.
|
'could not find RbxGui!'return end local h,i,j,k,l,m,n,o,p,q,r,s='gear',script.
|
||||||
Parent,'CurrentLoadout'),waitForChild(e.Gear,'GearGrid')local t,u,v=
|
Parent,{},{},false,false,{},{},nil,nil,nil,b(e,'Backpack')b(i,'Tabs')b(i,'Gear')
|
||||||
waitForChild(s,'GearButton'),waitForChild(script.Parent,'SwapSlot'),
|
local t,u,v,w=b(i.Gear,'GearPreview'),b(i.Gear,'GearGridScrollingArea'),b(i.
|
||||||
waitForChild(script.Parent,'CoreScripts/BackpackScripts/BackpackManager')local w
|
Parent,'CurrentLoadout'),b(i.Gear,'GearGrid')local x,y,z=b(w,'GearButton'),b(
|
||||||
,x,y,z,A,B,C,D,E,F=waitForChild(v,'BackpackOpenEvent'),waitForChild(v,
|
script.Parent,'SwapSlot'),b(script.Parent,
|
||||||
'BackpackCloseEvent'),waitForChild(v,'TabClickedEvent'),waitForChild(v,
|
'CoreScripts/BackpackScripts/BackpackManager')local A,B,C,D,E,F,G,H,I,J=b(z,
|
||||||
'ResizeEvent'),waitForChild(v,'SearchRequestedEvent'),waitForChild(v,
|
'BackpackOpenEvent'),b(z,'BackpackCloseEvent'),b(z,'TabClickedEvent'),b(z,
|
||||||
'BackpackReady'),b.CreateScrollingFrame(nil,'grid',Vector2.new(6,6))C.Position=
|
'ResizeEvent'),b(z,'SearchRequestedEvent'),b(z,'BackpackReady'),nil,nil,nil,nil
|
||||||
UDim2.new(0,0,0,30)C.Size=UDim2.new(1,0,1,-30)C.Parent=e.Gear.GearGrid local G=
|
G,H,I,J=f.CreateScrollingFrame(nil,'grid',Vector2.new(6,6))G.Position=UDim2.new(
|
||||||
Instance.new'Frame'G.Name='ScrollBar'G.BackgroundTransparency=0.9 G.
|
0,0,0,30)G.Size=UDim2.new(1,0,1,-30)G.Parent=i.Gear.GearGrid local K=a('Frame',
|
||||||
BackgroundColor3=Color3.new(1,1,1)G.BorderSizePixel=0 G.Size=UDim2.new(0,17,1,-
|
'ScrollBar',{BackgroundTransparency=0.9,BackgroundColor3=Color3.new(1,1,1),
|
||||||
36)G.Position=UDim2.new(0,0,0,18)G.Parent=q E.Position=UDim2.new(0,0,1,-17)D.
|
BorderSizePixel=0,Size=UDim2.new(0,17,1,-36),Position=UDim2.new(0,0,0,18),Parent
|
||||||
Parent=q E.Parent=q local H,I,J,K=b.CreateScrollingFrame()H.Position=UDim2.new(0
|
=u})I.Position=UDim2.new(0,0,1,-17)H.Parent=u I.Parent=u local L,M,N,O L,M,N,O=f
|
||||||
,0,0,0)H.Size=UDim2.new(1,0,1,0)H.Parent=e.Gear.GearLoadouts.LoadoutsList local
|
.CreateScrollingFrame()L.Position=UDim2.new(0,0,0,0)L.Size=UDim2.new(1,0,1,0)L.
|
||||||
L=Instance.new'TextButton'L.RobloxLocked=true L.Name='LoadoutButton'L.Font=Enum.
|
Parent=i.Gear.GearLoadouts.LoadoutsList local P=a('TextButton','LoadoutButton',{
|
||||||
Font.ArialBold L.FontSize=Enum.FontSize.Size14 L.Position=UDim2.new(0,0,0,0)L.
|
RobloxLocked=true,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size14,
|
||||||
Size=UDim2.new(1,0,0,32)L.Style=Enum.ButtonStyle.RobloxButton L.Text=
|
Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,32),Style=Enum.ButtonStyle.
|
||||||
'Loadout #1'L.TextColor3=Color3.new(1,1,1)L.Parent=H local M=L:clone()M.Text=
|
RobloxButton,Text='Loadout #1',TextColor3=Color3.new(1,1,1),Parent=L})do local Q
|
||||||
'Loadout #2'M.Parent=H local N=L:clone()N.Text='Loadout #3'N.Parent=H local O=L:
|
=P:clone()Q.Text='Loadout #2'Q.Parent=L end do local Q=P:clone()Q.Text=
|
||||||
clone()O.Text='Loadout #4'O.Parent=H local P=Instance.new'Frame'P.Name=
|
'Loadout #3'Q.Parent=L end do local Q=P:clone()Q.Text='Loadout #4'Q.Parent=L end
|
||||||
'ScrollBarLoadout'P.BackgroundTransparency=0.9 P.BackgroundColor3=Color3.new(1,1
|
a('Frame','ScrollBarLoadout',{BackgroundTransparency=0.9,BackgroundColor3=Color3
|
||||||
,1)P.BorderSizePixel=0 P.Size=UDim2.new(0,17,1,-36)P.Position=UDim2.new(0,0,0,18
|
.new(1,1,1),BorderSizePixel=0,Size=UDim2.new(0,17,1,-36),Position=UDim2.new(0,0,
|
||||||
)P.Parent=e.Gear.GearLoadouts.GearLoadoutsScrollingArea J.Position=UDim2.new(0,0
|
0,18),Parent=i.Gear.GearLoadouts.GearLoadoutsScrollingArea})N.Position=UDim2.
|
||||||
,1,-17)I.Parent=e.Gear.GearLoadouts.GearLoadoutsScrollingArea J.Parent=e.Gear.
|
new(0,0,1,-17)M.Parent=i.Gear.GearLoadouts.GearLoadoutsScrollingArea N.Parent=i.
|
||||||
GearLoadouts.GearLoadoutsScrollingArea function removeFromMap(Q,R)for S=1,#Q do
|
Gear.GearLoadouts.GearLoadoutsScrollingArea local Q Q=function(R,S)for T=1,#R do
|
||||||
if Q[S]==R then table.remove(Q,S)break end end end function robloxLock(Q)Q.
|
if R[T]==S then table.remove(R,T)break end end end local R R=function(S)S.
|
||||||
RobloxLocked=true children=Q:GetChildren()if children then for R,S in ipairs(
|
RobloxLocked=true local T=S:GetChildren()if T then for U,V in ipairs(T)do R(V)
|
||||||
children)do robloxLock(S)end end end function resize()local Q=0 if p.
|
end end end local S S=function()t.GearImage.Image=''t.GearStats.GearName.Text=''
|
||||||
AbsoluteSize.Y>p.AbsoluteSize.X then Q=p.AbsoluteSize.X*0.75 else Q=p.
|
end local T T=function(U)U.TextColor3=Color3.new(1,1,1)U.BackgroundColor3=Color3
|
||||||
AbsoluteSize.Y*0.75 end waitForChild(p,'GearImage')p.GearImage.Size=UDim2.new(0,
|
.new(0,0,0)end local U U=function(V)local W=v:GetChildren()for X=1,#W do if W[X]
|
||||||
Q,0,Q)p.GearImage.Position=UDim2.new(0,p.AbsoluteSize.X/2-Q/2,0.75,-Q)
|
:IsA'Frame'then local Y=W[X]:GetChildren()if#Y>0 and Y[1].GearReference.Value
|
||||||
resizeGrid()end function addToGrid(Q)if not Q:IsA'Tool'then if not Q:IsA
|
and Y[1].GearReference.Value==V then return true end end end return false end
|
||||||
'HopperBin'then return end end if Q:FindFirstChild'RobloxBuildTool'then return
|
local V V=function()for W,X in pairs(j)do if k[X]then local Y,Z=nil,k[X]:
|
||||||
end for R,S in pairs(f)do if S==Q then return end end table.insert(f,Q)local T,U
|
FindFirstChild'GearReference'if Z then Y=Z.Value end if(not Y)or U(Y)then k[X].
|
||||||
=Q.Changed:connect(function(T)if T=='Name'then if g[Q]then if g[Q].Image==''then
|
Active=false else k[X].Active=true end end end end local W W=function(X,Y)if not
|
||||||
g[Q].GearText.Text=Q.Name end end end end),nil U=Q.AncestryChanged:connect(
|
y.Value then y.Slot.Value=X y.GearButton.Value=Y y.Value=true return V()end end
|
||||||
function(V,W)local X=nil for Y,Z in pairs(f)do if Z==Q then X=Z break end end
|
local X X=function(Y)Y.Parent=s return V()end local Y Y=function(Z,_)if type(Z.
|
||||||
waitForProperty(a,'Character')waitForChild(a,'Backpack')if Q.Parent~=a.Backpack
|
Action)~='number'then return end local aa=Z.Action if aa==1 then X(_.Parent.
|
||||||
and Q.Parent~=a.Character then if U then U:disconnect()end if T then T:
|
GearReference.Value)local ab=_.Parent local ac,ad,ae=ab.GearReference.Value,v:
|
||||||
disconnect()end for _,aa in pairs(f)do if aa==X then if j[g[aa]]then j[g[aa]]:
|
GetChildren(),-1 for af=1,#ad do if ad[af]:IsA'Frame'then local ag=ad[af]:
|
||||||
disconnect()end if k[g[aa]]then k[g[aa]]:disconnect()end g[aa].Parent=nil g[aa]=
|
GetChildren()if ag[1]and ag[1].GearReference.Value==ac then ae=ag[1].SlotNumber.
|
||||||
nil break end end removeFromMap(f,X)resizeGrid()else resizeGrid()end
|
Text break end end end return W(ae,nil)end end local aa aa=function(ab)ab.
|
||||||
updateGridActive()end)resizeGrid()end function buttonClick(aa)if aa:
|
TextColor3=Color3.new(0,0,0)ab.BackgroundColor3=Color3.new(0.8,0.8,0.8)end local
|
||||||
FindFirstChild'UnequipContextMenu'and not aa.Active then aa.UnequipContextMenu.
|
ab ab=function()local ac=a('Frame','UnequipContextMenu',{Active=true,Size=UDim2.
|
||||||
Visible=true i=true end end function previewGear(aa)if not i then p.Visible=
|
new(0,115,0,70),Position=UDim2.new(0,-16,0,-16),BackgroundTransparency=1,Visible
|
||||||
false p.GearImage.Image=aa.Image p.GearStats.GearName.Text=aa.GearReference.
|
=false})local ad,ae,af,ag=a('TextButton','UnequipContextMenuButton',{Text='',
|
||||||
Value.Name end end function findEmptySlot()local aa,Q=nil,r:GetChildren()for R=1
|
Style=Enum.ButtonStyle.RobloxButtonDefault,ZIndex=8,Size=UDim2.new(1,0,1,-20),
|
||||||
,#Q do if Q[R]:IsA'Frame'and#Q[R]:GetChildren()<=0 then local S=tonumber(string.
|
Visible=true,Parent=ac}),12,{},{'Remove Hotkey'}for Z=1,#ag do local _={}_.Type=
|
||||||
sub(Q[R].Name,5))if S==0 then S=10 end if not aa or(aa>S)then aa=S end end end
|
'Button'_.Text=ag[Z]_.Action=Z _.DoIt=Y table.insert(af,_)end for Z,_ in ipairs(
|
||||||
if aa==10 then aa=0 end return aa end function checkForSwap(aa,Q,R)local S=r:
|
af)do local ah=_ if ah.Type=='Button'then local ai=a('TextButton',
|
||||||
GetChildren()for T=1,#S do if S[T]:IsA'Frame'and string.find(S[T].Name,'Slot')
|
'UnequipContextButton'..tostring(Z),{BackgroundColor3=Color3.new(0,0,0),
|
||||||
then if Q>=S[T].AbsolutePosition.x and Q<=(S[T].AbsolutePosition.x+S[T].
|
BorderSizePixel=0,TextXAlignment=Enum.TextXAlignment.Left,Text=' '..tostring(_.
|
||||||
AbsoluteSize.x)then if R>=S[T].AbsolutePosition.y and R<=(S[T].AbsolutePosition.
|
Text),Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,Size=UDim2.new(1,8,0,ae
|
||||||
y+S[T].AbsoluteSize.y)then local U=tonumber(string.sub(S[T].Name,5))
|
),Position=UDim2.new(0,0,0,ae*Z),TextColor3=Color3.new(1,1,1),ZIndex=9,Parent=ad
|
||||||
swapGearSlot(U,aa)return true end end end end return false end function
|
})if not d()then ai.MouseButton1Click:connect(function()if ai.Active and not ac.
|
||||||
resizeGrid()for aa,Q in pairs(f)do if not Q:FindFirstChild'RobloxBuildTool'then
|
Parent.Active then pcall(function()return ah.DoIt(ah,ac)end)m=false ac.Visible=
|
||||||
if not g[Q]then local R=t:clone()R.Parent=s.ScrollingFrame R.Visible=true R.
|
false T(ai)return S()end end)ai.MouseEnter:connect(function()if ai.Active and ac
|
||||||
Image=Q.TextureId if R.Image==''then R.GearText.Text=Q.Name end R.GearReference.
|
.Parent.Active then return aa(ai)end end)ai.MouseLeave:connect(function()if ai.
|
||||||
Value=Q R.Draggable=true g[Q]=R if not IsTouchDevice()then local S=
|
Active and ac.Parent.Active then return T(ai)end end)end _.Button=ai _.Element=
|
||||||
getGearContextMenu()S.Visible=false S.Parent=R end local S=nil R.DragBegin:
|
ai elseif ah.Type=='Label'then local ai=a('Frame','ContextLabel'..tostring(Z),{
|
||||||
connect(function(T)waitForChild(R,'Background')R['Background'].ZIndex=10 R.
|
BackgroundTransparency=1,Size=UDim2.new(1,8,0,ae),a('TextLabel','Text1',{
|
||||||
ZIndex=10 S=T end)R.DragStopped:connect(function(T,U)waitForChild(R,'Background'
|
BackgroundTransparency=1,BackgroundColor3=Color3.new(1,1,1),BorderSizePixel=0,
|
||||||
)R['Background'].ZIndex=1 R.ZIndex=2 if S~=R.Position then if not checkForSwap(R
|
TextXAlignment=Enum.TextXAlignment.Left,Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||||
,T,U)then R:TweenPosition(S,Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.5,
|
FontSize.Size14,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0.5,0,1,0),TextColor3
|
||||||
true)R.Draggable=false delay(0.5,function()R.Draggable=true end)else R.Position=
|
=Color3.new(1,1,1),ZIndex=9})})ah.Label1=ai.Text1 if ah.GetText2 then ah.Label2=
|
||||||
S end end end)local T=tick()j[R]=R.MouseEnter:connect(function()previewGear(R)
|
a('TextLabel','Text2',{BackgroundTransparency=1,BackgroundColor3=Color3.new(1,1,
|
||||||
end)k[R]=R.MouseButton1Click:connect(function()local U=tick()if R.Active and(U-T
|
1),BorderSizePixel=0,TextXAlignment=Enum.TextXAlignment.Right,Font=Enum.Font.
|
||||||
)<0.5 then local W=findEmptySlot()if W then R.ZIndex=1 swapGearSlot(W,R)end else
|
Arial,FontSize=Enum.FontSize.Size14,Position=UDim2.new(0.5,0,0,0),Size=UDim2.
|
||||||
buttonClick(R)end T=U end)end end end F()end function showPartialGrid(aa)for Q,R
|
new(0.5,0,1,0),TextColor3=Color3.new(1,1,1),ZIndex=9,Parent=ai})end ai.Parent=ad
|
||||||
in pairs(g)do R.Parent=nil end if aa then for S,T in pairs(aa)do T.Parent=s.
|
ah.Label=ai ah.Element=ai end end ac.ZIndex=4 ac.MouseLeave:connect(function()m=
|
||||||
ScrollingFrame end end F()end function showEntireGrid()for aa,Q in pairs(g)do Q.
|
false ac.Visible=false return S()end)R(ac)return ac end local ac ac=function()
|
||||||
Parent=s.ScrollingFrame end F()end function inLoadout(aa)local Q=r:GetChildren()
|
local ad,ae=nil,v:GetChildren()for af=1,#ae do if ae[af]:IsA'Frame'and#ae[af]:
|
||||||
for R=1,#Q do if Q[R]:IsA'Frame'then local S=Q[R]:GetChildren()if#S>0 then if S[
|
GetChildren()<=0 then local ag=tonumber(string.sub(ae[af].Name,5))if ag==0 then
|
||||||
1].GearReference.Value and S[1].GearReference.Value==aa then return true end end
|
ag=10 end if not ad or(ad>ag)then ad=ag end end end if ad==10 then ad=0 end
|
||||||
end end return false end function updateGridActive()for aa,Q in pairs(f)do if g[
|
return ad end local ad ad=function(ae,af,ag)local ah=v:GetChildren()for ai=1,#ah
|
||||||
Q]then local R,S=nil,g[Q]:FindFirstChild'GearReference'if S then R=S.Value end
|
do if ah[ai]:IsA'Frame'and string.find(ah[ai].Name,'Slot')then if af>=ah[ai].
|
||||||
if(not R)or inLoadout(R)then g[Q].Active=false else g[Q].Active=true end end end
|
AbsolutePosition.x and af<=(ah[ai].AbsolutePosition.x+ah[ai].AbsoluteSize.x)then
|
||||||
end function centerGear(aa)local Q,R={},nil for S=1,#aa do if aa[S]:IsA'Frame'
|
if ag>=ah[ai].AbsolutePosition.y and ag<=(ah[ai].AbsolutePosition.y+ah[ai].
|
||||||
and#aa[S]:GetChildren()>0 then if aa[S].Name=='Slot0'then R=aa[S]else table.
|
AbsoluteSize.y)then local Z=tonumber(string.sub(ah[ai].Name,5))W(Z,ae)return
|
||||||
insert(Q,aa[S])end end end if R then table.insert(Q,R)end local S=(1-(#Q*0.1))/2
|
true end end end end return false end local ae ae=function(af)if not m then t.
|
||||||
for T=1,#Q do Q[T]:TweenPosition(UDim2.new(S+((T-1)*0.1),0,0,0),Enum.
|
Visible=false t.GearImage.Image=af.Image t.GearStats.GearName.Text=af.
|
||||||
EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end function
|
GearReference.Value.Name end end local af af=function(ag)if ag:FindFirstChild(
|
||||||
tabClickHandler(aa)if aa==d then backpackOpenHandler(aa)else
|
not ag.Active)then ag.UnequipContextMenu.Visible=true m=true end end local ag ag
|
||||||
backpackCloseHandler(aa)end end function backpackOpenHandler(aa)if aa and aa~=d
|
=function()for ah,ai in pairs(j)do if not ai:FindFirstChild'RobloxBuildTool'then
|
||||||
then e.Gear.Visible=false return end e.Gear.Visible=true updateGridActive()
|
if not k[ai]then local Z=x:clone()Z.Parent=w.ScrollingFrame Z.Visible=true Z.
|
||||||
resizeGrid()resize()B:Invoke()end function backpackCloseHandler(aa)if aa and aa
|
Image=ai.TextureId if Z.Image==''then Z.GearText.Text=ai.Name end Z.
|
||||||
~=d then e.Gear.Visible=false return end e.Gear.Visible=false resizeGrid()
|
GearReference.Value=ai Z.Draggable=true k[ai]=Z if not d()then local _=ab()_.
|
||||||
resize()B:Invoke()end function loadoutCheck(aa,Q)if not aa:IsA'ImageButton'then
|
Visible=false _.Parent=Z end local _ Z.DragBegin:connect(function(aj)b(Z,
|
||||||
return end for R,S in pairs(f)do if g[S]then if aa:FindFirstChild'GearReference'
|
'Background')Z['Background'].ZIndex=10 Z.ZIndex=10 _=aj end)Z.DragStopped:
|
||||||
and g[S]:FindFirstChild'GearReference'then if g[S].GearReference.Value==aa.
|
connect(function(aj,ak)b(Z,'Background')Z['Background'].ZIndex=1 Z.ZIndex=2 if _
|
||||||
GearReference.Value then g[S].Active=Q break end end end end end function
|
~=Z.Position then if not ad(Z,aj,ak)then Z:TweenPosition(_,Enum.EasingDirection.
|
||||||
clearPreview()p.GearImage.Image=''p.GearStats.GearName.Text=''end function
|
Out,Enum.EasingStyle.Quad,0.5,true)Z.Draggable=false return delay(0.5,function()
|
||||||
unequipGear(aa)aa.Parent=o updateGridActive()end function highlight(aa)aa.
|
Z.Draggable=true end)else Z.Position=_ end end end)local aj=tick()n[Z]=Z.
|
||||||
TextColor3=Color3.new(0,0,0)aa.BackgroundColor3=Color3.new(0.8,0.8,0.8)end
|
MouseEnter:connect(function()return ae(Z)end)o[Z]=Z.MouseButton1Click:connect(
|
||||||
function clearHighlight(aa)aa.TextColor3=Color3.new(1,1,1)aa.BackgroundColor3=
|
function()local ak=tick()if Z.Active and(ak-aj)<0.5 then local al=ac()if al then
|
||||||
Color3.new(0,0,0)end function swapGearSlot(aa,Q)if not u.Value then u.Slot.Value
|
Z.ZIndex=1 W(al,Z)end else af(Z)end aj=ak end)end end end return J()end local ah
|
||||||
=aa u.GearButton.Value=Q u.Value=true updateGridActive()end end local aa=
|
ah=function()local ai=0.75*(function()if t.AbsoluteSize.Y>t.AbsoluteSize.X then
|
||||||
function(aa,Q)if type(aa.Action)~='number'then return end local R=aa.Action if R
|
return t.AbsoluteSize.X else return t.AbsoluteSize.Y end end)()b(t,'GearImage')t
|
||||||
==1 then unequipGear(Q.Parent.GearReference.Value)local S=Q.Parent local T,U,W=S
|
.GearImage.Size=UDim2.new(0,ai,0,ai)t.GearImage.Position=UDim2.new(0,t.
|
||||||
.GearReference.Value,r:GetChildren(),-1 for X=1,#U do if U[X]:IsA'Frame'then
|
AbsoluteSize.X/2-ai/2,0.75,-ai)return ag()end local ai ai=function(aj)if not aj:
|
||||||
local Y=U[X]:GetChildren()if Y[1]and Y[1].GearReference.Value==T then W=Y[1].
|
IsA'Tool'and not aj:IsA'HopperBin'then return end if aj:FindFirstChild
|
||||||
SlotNumber.Text break end end end swapGearSlot(W,nil)end end function
|
'RobloxBuildTool'then return end for ak,al in pairs(j)do if al==aj then return
|
||||||
setupCharacterConnections()if n then n:disconnect()end n=game.Players.
|
end end table.insert(j,aj)local Z=aj.Changed:connect(function(Z)if Z=='Name'and
|
||||||
LocalPlayer.Backpack.ChildAdded:connect(function(Q)addToGrid(Q)end)local Q=game.
|
k[aj]and k[aj].Image==''then k[aj].GearText.Text=aj.Name end end)local am=aj.
|
||||||
Players.LocalPlayer.Backpack:GetChildren()for R=1,#Q do addToGrid(Q[R])end if l
|
AncestryChanged:connect(function(_,am)local an for ao,ap in pairs(j)do if ap==aj
|
||||||
then l:disconnect()end l=game.Players.LocalPlayer.Character.ChildAdded:connect(
|
then an=ap break end end c(e,'Character')b(e,'Backpack')if aj.Parent~=e.Backpack
|
||||||
function(R)addToGrid(R)updateGridActive()end)if m then m:disconnect()end m=game.
|
and aj.Parent~=e.Character then do local aq=ancestryCon if aq~=nil then aq:
|
||||||
Players.LocalPlayer.Character.ChildRemoved:connect(function(R)updateGridActive()
|
disconnect()end end if Z~=nil then Z:disconnect()end for aq,ar in pairs(j)do if
|
||||||
end)wait()centerGear(r:GetChildren())end function removeCharacterConnections()if
|
ar==an then do local as=n[k[ar]]if as~=nil then as:disconnect()end end do local
|
||||||
l then l:disconnect()end if m then m:disconnect()end if n then n:disconnect()end
|
as=o[k[ar]]if as~=nil then as:disconnect()end end k[ar].Parent=nil k[ar]=nil
|
||||||
end function trim(Q)return(Q:gsub('^%s*(.-)%s*$','%1'))end function filterGear(Q
|
break end end Q(j,an)ag()else ag()end return V()end)return ag()end local aj aj=
|
||||||
)local R={}for S,T in pairs(f)do if g[T]then local U=string.lower(g[T].
|
function(ak)for al,am in pairs(k)do am.Parent=nil end if ak then for an,ao in
|
||||||
GearReference.Value.Name)U=trim(U)for W=1,#Q do if string.match(U,Q[W])then
|
pairs(ak)do ao.Parent=w.ScrollingFrame end end return J()end local ak ak=
|
||||||
table.insert(R,g[T])break end end end end return R end function
|
function()for al,am in pairs(k)do am.Parent=w.ScrollingFrame end return J()end
|
||||||
splitByWhitespace(Q)if type(Q)~='string'then return nil end local R={}for S in
|
local al al=function(am)local an,ao={},nil for ap=1,#am do if am[ap]:IsA'Frame'
|
||||||
string.gmatch(Q,'[^%s]+')do if string.len(S)>0 then table.insert(R,S)end end
|
and#am[ap]:GetChildren()>0 then if am[ap].Name=='Slot0'then ao=am[ap]else table.
|
||||||
return R end function showSearchGear(Q)if not e.Gear.Visible then return end
|
insert(an,am[ap])end end end if ao then table.insert(an,ao)end local ap=(1-(#an*
|
||||||
local R,S=splitByWhitespace(Q),nil if R and(#R>0)then S=R else S=nil end if R==
|
0.1))/2 for aq=1,#an do an[aq]:TweenPosition(UDim2.new(ap+((aq-1)*0.1),0,0,0),
|
||||||
nil then showEntireGrid()return end local T=filterGear(S)showPartialGrid(T)end
|
Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end local am am=
|
||||||
function nukeBackpack()while#g>0 do table.remove(g)end g={}while#f>0 do table.
|
function(an)if an and an~=h then i.Gear.Visible=false return end i.Gear.Visible=
|
||||||
remove(f)end f={}local Q=s.ScrollingFrame:GetChildren()for R=1,#Q do Q[R]:
|
true V()ag()ah()return F:Invoke()end local an an=function(ao)if ao and ao~=h
|
||||||
remove()end end function getGearContextMenu()local Q=Instance.new'Frame'Q.Active
|
then i.Gear.Visible=false return end i.Gear.Visible=false ag()ah()return F:
|
||||||
=true Q.Name='UnequipContextMenu'Q.Size=UDim2.new(0,115,0,70)Q.Position=UDim2.
|
Invoke()end local ao ao=function(ap)if ap==h then return am(ap)else return an(ap
|
||||||
new(0,-16,0,-16)Q.BackgroundTransparency=1 Q.Visible=false local R=Instance.new
|
)end end local ap ap=function(aq,ar)if not aq:IsA'ImageButton'then return end
|
||||||
'TextButton'R.Name='UnequipContextMenuButton'R.Text=''R.Style=Enum.ButtonStyle.
|
for as,Z in pairs(j)do if k[Z]then if aq:FindFirstChild(k[Z]:FindFirstChild
|
||||||
RobloxButtonDefault R.ZIndex=8 R.Size=UDim2.new(1,0,1,-20)R.Visible=true R.
|
'GearReference')then if k[Z].GearReference.Value==aq.GearReference.Value then k[
|
||||||
Parent=Q local S,T,U=12,{},{'Remove Hotkey'}for W=1,#U do local X={}X.Type=
|
Z].Active=ar break end end end end end local aq aq=function()if r~=nil then r:
|
||||||
'Button'X.Text=U[W]X.Action=W X.DoIt=aa table.insert(T,X)end for W,X in ipairs(T
|
disconnect()end r=game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(
|
||||||
)do local Y=X if Y.Type=='Button'then local Z=Instance.new'TextButton'Z.Name=
|
ar)return ai(ar)end)local ar=game.Players.LocalPlayer.Backpack:GetChildren()for
|
||||||
'UnequipContextButton'..W Z.BackgroundColor3=Color3.new(0,0,0)Z.BorderSizePixel=
|
as=1,#ar do ai(ar[as])end if p~=nil then p:disconnect()end p=game.Players.
|
||||||
0 Z.TextXAlignment=Enum.TextXAlignment.Left Z.Text=' '..X.Text Z.Font=Enum.Font.
|
LocalPlayer.Character.ChildAdded:connect(function(as)ai(as)return V()end)if q~=
|
||||||
Arial Z.FontSize=Enum.FontSize.Size14 Z.Size=UDim2.new(1,8,0,S)Z.Position=UDim2.
|
nil then q:disconnect()end q=game.Players.LocalPlayer.Character.ChildRemoved:
|
||||||
new(0,0,0,S*W)Z.TextColor3=Color3.new(1,1,1)Z.ZIndex=9 Z.Parent=R if not
|
connect(function(as)return V()end)wait()return al(v:GetChildren())end local ar
|
||||||
IsTouchDevice()then Z.MouseButton1Click:connect(function()if Z.Active and not Q.
|
ar=function()if p~=nil then p:disconnect()end if q~=nil then q:disconnect()end
|
||||||
Parent.Active then pcall(function()Y.DoIt(Y,Q)end)i=false Q.Visible=false
|
if r~=nil then return r:disconnect()end return nil end local as as=function(Z)
|
||||||
clearHighlight(Z)clearPreview()end end)Z.MouseEnter:connect(function()if Z.
|
return Z:gsub('^%s*(.-)%s*$','%1')end local Z Z=function(at)local au={}for av,aw
|
||||||
Active and Q.Parent.Active then highlight(Z)end end)Z.MouseLeave:connect(
|
in pairs(j)do if k[aw]then local ax=string.lower(k[aw].GearReference.Value.Name)
|
||||||
function()if Z.Active and Q.Parent.Active then clearHighlight(Z)end end)end X.
|
ax=as(ax)for ay=1,#at do if string.match(ax,at[ay])then table.insert(au,k[aw])
|
||||||
Button=Z X.Element=Z elseif Y.Type=='Label'then local Z=Instance.new'Frame'Z.
|
break end end end end return au end local at at=function(au)if type(au)~=
|
||||||
Name='ContextLabel'..W Z.BackgroundTransparency=1 Z.Size=UDim2.new(1,8,0,S)local
|
'string'then return end local av={}for aw in string.gmatch(au,'[^%s]+')do if
|
||||||
_=Instance.new'TextLabel'_.Name='Text1'_.BackgroundTransparency=1 _.
|
string.len(aw)>0 then table.insert(av,aw)end end return av end local au au=
|
||||||
BackgroundColor3=Color3.new(1,1,1)_.BorderSizePixel=0 _.TextXAlignment=Enum.
|
function(av)if not i.Gear.Visible then return end local aw,ax=at(av),nil if aw
|
||||||
TextXAlignment.Left _.Font=Enum.Font.ArialBold _.FontSize=Enum.FontSize.Size14 _
|
and(#aw>0)then ax=aw else ax=nil end if not(aw~=nil)then ak()return end local ay
|
||||||
.Position=UDim2.new(0,0,0,0)_.Size=UDim2.new(0.5,0,1,0)_.TextColor3=Color3.new(1
|
=Z(ax)return aj(ay)end local av av=function()while#k>0 do table.remove(k)end k={
|
||||||
,1,1)_.ZIndex=9 _.Parent=Z Y.Label1=_ if Y.GetText2 then _=Instance.new
|
}while#j>0 do table.remove(j)end j={}local aw=w.ScrollingFrame:GetChildren()for
|
||||||
'TextLabel'_.Name='Text2'_.BackgroundTransparency=1 _.BackgroundColor3=Color3.
|
ax=1,#aw do aw[ax]:remove()end end local aw aw=function(ax,ay)if ax==Enum.
|
||||||
new(1,1,1)_.BorderSizePixel=0 _.TextXAlignment=Enum.TextXAlignment.Right _.Font=
|
CoreGuiType.Backpack or ax==Enum.CoreGuiType.All then if not ay then i.Gear.
|
||||||
Enum.Font.Arial _.FontSize=Enum.FontSize.Size14 _.Position=UDim2.new(0.5,0,0,0)_
|
Visible=false end end end local ax=e.Backpack:GetChildren()for ay=1,#ax do ai(ax
|
||||||
.Size=UDim2.new(0.5,0,1,0)_.TextColor3=Color3.new(1,1,1)_.ZIndex=9 _.Parent=Z Y.
|
[ay])end D.Event:connect(function(ay)if l then return end l=true wait()ah()ag()l
|
||||||
Label2=_ end Z.Parent=R Y.Label=Z Y.Element=Z end end Q.ZIndex=4 Q.MouseLeave:
|
=false end)v.ChildAdded:connect(function(ay)return ap(ay,false)end)v.
|
||||||
connect(function()i=false Q.Visible=false clearPreview()end)robloxLock(Q)return
|
ChildRemoved:connect(function(ay)return ap(ay,true)end)v.DescendantAdded:
|
||||||
Q end function coreGuiChanged(Q,R)if Q==Enum.CoreGuiType.Backpack or Q==Enum.
|
connect(function(ay)if not i.Visible and(ay:IsA'ImageButton'or ay:IsA
|
||||||
CoreGuiType.All then if not R then e.Gear.Visible=false end end end local Q=a.
|
'TextButton')then return al(v:GetChildren())end end)v.DescendantRemoving:
|
||||||
Backpack:GetChildren()for R=1,#Q do addToGrid(Q[R])end z.Event:connect(function(
|
connect(function(ay)if not i.Visible and(ay:IsA'ImageButton'or ay:IsA
|
||||||
R)if h then return end h=true wait()resize()resizeGrid()h=false end)r.ChildAdded
|
'TextButton')then wait()return al(v:GetChildren())end end)w.MouseEnter:connect(
|
||||||
:connect(function(R)loadoutCheck(R,false)end)r.ChildRemoved:connect(function(R)
|
function()return S()end)w.MouseLeave:connect(function()return S()end)e.
|
||||||
loadoutCheck(R,true)end)r.DescendantAdded:connect(function(R)if not e.Visible
|
CharacterRemoving:connect(function()ar()return av()end)e.CharacterAdded:connect(
|
||||||
and(R:IsA'ImageButton'or R:IsA'TextButton')then centerGear(r:GetChildren())end
|
function()return aq()end)e.ChildAdded:connect(function(ay)if ay:IsA'Backpack'
|
||||||
end)r.DescendantRemoving:connect(function(R)if not e.Visible and(R:IsA
|
then s=ay if r~=nil then r:disconnect()end r=game.Players.LocalPlayer.Backpack.
|
||||||
'ImageButton'or R:IsA'TextButton')then wait()centerGear(r:GetChildren())end end)
|
ChildAdded:connect(function(az)return ai(az)end)end end)y.Changed:connect(
|
||||||
s.MouseEnter:connect(function()clearPreview()end)s.MouseLeave:connect(function()
|
function()if not y.Value then return V()end end)local ay=v:GetChildren()for az=1
|
||||||
clearPreview()end)a.CharacterRemoving:connect(function()
|
,#ay do if ay[az]:IsA'Frame'and string.find(ay[az].Name,'Slot')then ay[az].
|
||||||
removeCharacterConnections()nukeBackpack()end)a.CharacterAdded:connect(function(
|
ChildRemoved:connect(function()return V()end)ay[az].ChildAdded:connect(function(
|
||||||
)setupCharacterConnections()end)a.ChildAdded:connect(function(R)if R:IsA
|
)return V()end)end end pcall(function()aw(Enum.CoreGuiType.Backpack,Game.
|
||||||
'Backpack'then o=R if n then n:disconnect()end n=game.Players.LocalPlayer.
|
StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))return Game.StarterGui.
|
||||||
Backpack.ChildAdded:connect(function(S)addToGrid(S)end)end end)u.Changed:
|
CoreGuiChangedSignal:connect(aw)end)ah()ag()ay=v:GetChildren()for az=1,#ay do
|
||||||
connect(function()if not u.Value then updateGridActive()end end)local R=r:
|
ap(ay[az],false)end if not i.Visible then al(v:GetChildren())end if not(p~=nil)
|
||||||
GetChildren()for S=1,#R do if R[S]:IsA'Frame'and string.find(R[S].Name,'Slot')
|
and game.Players.LocalPlayer['Character']then aq()end if not r then r=game.
|
||||||
then R[S].ChildRemoved:connect(function()updateGridActive()end)R[S].ChildAdded:
|
Players.LocalPlayer.Backpack.ChildAdded:connect(function(az)return ai(az)end)end
|
||||||
connect(function()updateGridActive()end)end end pcall(function()coreGuiChanged(
|
A.Event:connect(am)B.Event:connect(an)C.Event:connect(ao)E.Event:connect(au)
|
||||||
Enum.CoreGuiType.Backpack,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.
|
return O()
|
||||||
Backpack))Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)end)
|
|
||||||
resize()resizeGrid()local S=r:GetChildren()for T=1,#S do loadoutCheck(S[T],false
|
|
||||||
)end if not e.Visible then centerGear(r:GetChildren())end if l==nil and game.
|
|
||||||
Players.LocalPlayer['Character']then setupCharacterConnections()end if not n
|
|
||||||
then n=game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(T)
|
|
||||||
addToGrid(T)end)end w.Event:connect(backpackOpenHandler)x.Event:connect(
|
|
||||||
backpackCloseHandler)y.Event:connect(tabClickHandler)A.Event:connect(
|
|
||||||
showSearchGear)K()
|
|
||||||
|
|
@ -1,97 +1,86 @@
|
||||||
if game.CoreGui.Version<7 then return end local function waitForChild(a,b)while
|
if game.CoreGui.Version<7 then return end local a a=function(b,c)while not b:
|
||||||
not a:FindFirstChild(b)do a.ChildAdded:wait()end return a:FindFirstChild(b)end
|
FindFirstChild(c)do b.ChildAdded:wait()end return b:FindFirstChild(c)end local b
|
||||||
local function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end
|
b=function(c,d)while not c[d]do c.Changed:wait()end end a(game,'Players')if#game
|
||||||
waitForChild(game,'Players')if#game.Players:GetChildren()<1 then game.Players.
|
.Players:GetChildren()<1 then game.Players.ChildAdded:wait()end b(game.Players,
|
||||||
ChildAdded:wait()end waitForProperty(game.Players,'LocalPlayer')local a=script.
|
'LocalPlayer')local c=script.Parent a(c,'Gear')local d=script.Parent.Parent
|
||||||
Parent waitForChild(a,'Gear')local b=script.Parent.Parent assert(b:IsA
|
assert(d:IsA'ScreenGui')a(c,'Tabs')a(c.Tabs,'CloseButton')local e=c.Tabs.
|
||||||
'ScreenGui')waitForChild(a,'Tabs')waitForChild(a.Tabs,'CloseButton')local c=a.
|
CloseButton a(c.Tabs,'InventoryButton')local f,g=c.Tabs.InventoryButton,nil if
|
||||||
Tabs.CloseButton waitForChild(a.Tabs,'InventoryButton')local d,e=a.Tabs.
|
game.CoreGui.Version>=8 then a(c.Tabs,'WardrobeButton')g=c.Tabs.WardrobeButton
|
||||||
InventoryButton,nil if game.CoreGui.Version>=8 then waitForChild(a.Tabs,
|
end a(c.Parent,'ControlFrame')local h,i,j=a(c.Parent.ControlFrame,
|
||||||
'WardrobeButton')e=a.Tabs.WardrobeButton end waitForChild(a.Parent,
|
'BackpackButton'),'gear',a(c,'SearchFrame')a(c.SearchFrame,'SearchBoxFrame')
|
||||||
'ControlFrame')local f,g,h=waitForChild(a.Parent.ControlFrame,'BackpackButton'),
|
local k,l,m,n=a(c.SearchFrame.SearchBoxFrame,'SearchBox'),a(c.SearchFrame,
|
||||||
'gear',waitForChild(a,'SearchFrame')waitForChild(a.SearchFrame,'SearchBoxFrame')
|
'SearchButton'),a(c.SearchFrame,'ResetButton'),a(Game.CoreGui,'RobloxGui')local
|
||||||
local i,j,k,l=waitForChild(a.SearchFrame.SearchBoxFrame,'SearchBox'),
|
o=a(n,'CurrentLoadout')local p,q,r,s,t,u,v,w,x,y,z,A=a(o,'Background'),true,true
|
||||||
waitForChild(a.SearchFrame,'SearchButton'),waitForChild(a.SearchFrame,
|
,false,true,false,nil,0.25,'Search...','~','`',UDim2.new(0,600,0,400)if n.
|
||||||
'ResetButton'),waitForChild(Game.CoreGui,'RobloxGui')local m=waitForChild(l,
|
AbsoluteSize.Y<=320 then A=UDim2.new(0,200,0,140)end local B B=function(C)
|
||||||
'CurrentLoadout')local n,o,p,q,r,s,t,u,v,w,x,y=waitForChild(m,'Background'),true
|
assert(C,'eventName is nil')assert(tostring(C),'eventName is not a string')local
|
||||||
,true,false,true,false,nil,0.25,'Search...','~','`',UDim2.new(0,600,0,400)if l.
|
D=Instance.new'BindableEvent'D.Name=tostring(C)D.Parent=script return D end
|
||||||
AbsoluteSize.Y<=320 then y=UDim2.new(0,200,0,140)end function createPublicEvent(
|
local C C=function(D,E)assert(D,'funcName is nil')assert(tostring(D),
|
||||||
z)assert(z,'eventName is nil')assert(tostring(z),'eventName is not a string')
|
'funcName is not a string')assert(E,'invokeFunc is nil')assert(type(E)==
|
||||||
local A=Instance.new'BindableEvent'A.Name=tostring(z)A.Parent=script return A
|
'function',"invokeFunc should be of type 'function'")local F=Instance.new
|
||||||
end function createPublicFunction(z,A)assert(z,'funcName is nil')assert(
|
'BindableFunction'F.Name=tostring(D)F.OnInvoke=E F.Parent=script return F end
|
||||||
tostring(z),'funcName is not a string')assert(A,'invokeFunc is nil')assert(type(
|
local D,E,F,G,H,I=B'ResizeEvent',B'BackpackOpenEvent',B'BackpackCloseEvent',B
|
||||||
A)=='function',"invokeFunc should be of type 'function'")local B=Instance.new
|
'TabClickedEvent',B'SearchRequestedEvent',nil I=function()m.Visible=false k.Text
|
||||||
'BindableFunction'B.Name=tostring(z)B.OnInvoke=A B.Parent=script return B end
|
=x end local J J=function()I()return H:Fire()end local K K=function()c.Visible=
|
||||||
local z,A,B,C,D=createPublicEvent'ResizeEvent',createPublicEvent
|
false t=false end local L L=function()if v then v:disconnect()end b(game.Players
|
||||||
'BackpackOpenEvent',createPublicEvent'BackpackCloseEvent',createPublicEvent
|
.LocalPlayer,'Character')a(game.Players.LocalPlayer.Character,'Humanoid')v=game.
|
||||||
'TabClickedEvent',createPublicEvent'SearchRequestedEvent'function
|
Players.LocalPlayer.Character.Humanoid.Died:connect(K)end local M M=function()s=
|
||||||
deactivateBackpack()a.Visible=false r=false end function
|
false r=false h.Selected=false J()F:Fire(i)c.Tabs.Visible=false j.Visible=false
|
||||||
initHumanoidDiedConnections()if t then t:disconnect()end waitForProperty(game.
|
c:TweenSizeAndPosition(UDim2.new(0,A.X.Offset,0,0),UDim2.new(0.5,-A.X.Offset/2,1
|
||||||
Players.LocalPlayer,'Character')waitForChild(game.Players.LocalPlayer.Character,
|
,-85),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,w,true,function()game.
|
||||||
'Humanoid')t=game.Players.LocalPlayer.Character.Humanoid.Died:connect(
|
GuiService:RemoveCenterDialog(c)c.Visible=false h.Selected=false end)return
|
||||||
deactivateBackpack)end function activateBackpack()initHumanoidDiedConnections()r
|
delay(w,function()game.GuiService:RemoveCenterDialog(c)c.Visible=false h.
|
||||||
=true a.Visible=q if q then toggleBackpack()end end local E=function()q=false p=
|
Selected=false r=true q=true end)end local N N=function()game.GuiService:
|
||||||
false f.Selected=false resetSearch()B:Fire(g)a.Tabs.Visible=false h.Visible=
|
AddCenterDialog(c,Enum.CenterDialogType.PlayerInitiatedDialog,function()c.
|
||||||
false a:TweenSizeAndPosition(UDim2.new(0,y.X.Offset,0,0),UDim2.new(0.5,-y.X.
|
Visible=true h.Selected=true end,function()c.Visible=false h.Selected=false end)
|
||||||
Offset/2,1,-85),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,u,true,function()
|
c.Visible=true h.Selected=true c:TweenSizeAndPosition(A,UDim2.new(0.5,-A.X.
|
||||||
game.GuiService:RemoveCenterDialog(a)a.Visible=false f.Selected=false end)delay(
|
Offset/2,1,-A.Y.Offset-88),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,w,true
|
||||||
u,function()game.GuiService:RemoveCenterDialog(a)a.Visible=false f.Selected=
|
)return delay(w,function()c.Tabs.Visible=false j.Visible=true E:Fire(i)q=true r=
|
||||||
false p=true o=true end)end function showBackpack()game.GuiService:
|
true h.Image='http://www.roblox.com/asset/?id=97644093'h.Position=UDim2.new(0.5,
|
||||||
AddCenterDialog(a,Enum.CenterDialogType.PlayerInitiatedDialog,function()a.
|
-60,1,-A.Y.Offset-103)end)end local O O=function()if not game.Players.
|
||||||
Visible=true f.Selected=true end,function()a.Visible=false f.Selected=false end)
|
LocalPlayer then return end if not game.Players.LocalPlayer['Character']then
|
||||||
a.Visible=true f.Selected=true a:TweenSizeAndPosition(y,UDim2.new(0.5,-y.X.
|
return end if not q then return end if not r then return end r=false q=false s=
|
||||||
Offset/2,1,-y.Y.Offset-88),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,u,true
|
not s if s then p.Image='http://www.roblox.com/asset/?id=97623721'p.Position=
|
||||||
)delay(u,function()a.Tabs.Visible=false h.Visible=true A:Fire(g)o=true p=true f.
|
UDim2.new(-3E-2,0,-0.17,0)p.Size=UDim2.new(1.05,0,1.25,0)p.ZIndex=2 p.Visible=
|
||||||
Image='http://www.roblox.com/asset/?id=97644093'f.Position=UDim2.new(0.5,-60,1,-
|
true return N()else h.Position=UDim2.new(0.5,-60,1,-44)p.Visible=false h.
|
||||||
y.Y.Offset-103)end)end function toggleBackpack()if not game.Players.LocalPlayer
|
Selected=false h.Image='http://www.roblox.com/asset/?id=97617958'p.Image=
|
||||||
then return end if not game.Players.LocalPlayer['Character']then return end if
|
'http://www.roblox.com/asset/?id=96536002'p.Position=UDim2.new(-0.1,0,-0.1,0)p.
|
||||||
not o then return end if not p then return end p=false o=false q=not q if q then
|
Size=UDim2.new(1.2,0,1.2,0)M()local P=o:GetChildren()for Q=1,#P do if P[Q]and P[
|
||||||
n.Image='http://www.roblox.com/asset/?id=97623721'n.Position=UDim2.new(-3E-2,0,-
|
Q]:IsA'Frame'then local R=P[Q]if#R:GetChildren()>0 then h.Position=UDim2.new(0.5
|
||||||
0.17,0)n.Size=UDim2.new(1.05,0,1.25,0)n.ZIndex=2 n.Visible=true showBackpack()
|
,-60,1,-108)h.Visible=true p.Visible=true if R:GetChildren()[1]:IsA'ImageButton'
|
||||||
else f.Position=UDim2.new(0.5,-60,1,-44)n.Visible=false f.Selected=false f.Image
|
then local S=R:GetChildren()[1]S.Active=true S.Draggable=false end end end end
|
||||||
='http://www.roblox.com/asset/?id=97617958'n.Image=
|
end end local P P=function()L()t=true c.Visible=s if s then return O()end end
|
||||||
'http://www.roblox.com/asset/?id=96536002'n.Position=UDim2.new(-0.1,0,-0.1,0)n.
|
local Q Q=function()if s then return O()end end local R R=function(S)assert(S)
|
||||||
Size=UDim2.new(1.2,0,1.2,0)E()local F=m:GetChildren()for G=1,#F do if F[G]and F[
|
assert(S:IsA'TextButton')S.BackgroundColor3=Color3.new(1,1,1)S.TextColor3=Color3
|
||||||
G]:IsA'Frame'then local H=F[G]if#H:GetChildren()>0 then f.Position=UDim2.new(0.5
|
.new(0,0,0)S.Selected=true S.ZIndex=3 return S end local S S=function(T)assert(T
|
||||||
,-60,1,-108)f.Visible=true n.Visible=true if H:GetChildren()[1]:IsA'ImageButton'
|
)assert(T:IsA'TextButton')T.BackgroundColor3=Color3.new(0,0,0)T.TextColor3=
|
||||||
then local I=H:GetChildren()[1]I.Active=true I.Draggable=false end end end end
|
Color3.new(1,1,1)T.Selected=false T.ZIndex=1 return T end local T T=function(U)
|
||||||
end end function closeBackpack()if q then toggleBackpack()end end function
|
assert(U)if U=='gear'then R(f)return S(g)elseif U=='wardrobe'then R(g)return S(f
|
||||||
setSelected(F)assert(F)assert(F:IsA'TextButton')F.BackgroundColor3=Color3.new(1,
|
)end end local U U=function(V)assert(V)assert(V:IsA'TextButton')if V.Selected
|
||||||
1,1)F.TextColor3=Color3.new(0,0,0)F.Selected=true F.ZIndex=3 end function
|
then return end V.BackgroundColor3=Color3.new(0,0,0)end local V V=function(W)
|
||||||
setUnselected(F)assert(F)assert(F:IsA'TextButton')F.BackgroundColor3=Color3.new(
|
assert(W)assert(W:IsA'TextButton')if W.Selected then return end W.
|
||||||
0,0,0)F.TextColor3=Color3.new(1,1,1)F.Selected=false F.ZIndex=1 end function
|
BackgroundColor3=Color3.new(0.15294117647058825,0.15294117647058825,
|
||||||
updateTabGui(F)assert(F)if F=='gear'then setSelected(d)setUnselected(e)elseif F
|
0.15294117647058825)end local W W=function(X)assert(X)X=string.lower(X)i=X T(X)G
|
||||||
=='wardrobe'then setSelected(e)setUnselected(d)end end function mouseLeaveTab(F)
|
:Fire(X)return J()end local X X=function(Y)return Y:gsub('^%s*(.-)%s*$','%1')end
|
||||||
assert(F)assert(F:IsA'TextButton')if F.Selected then return end F.
|
local Y Y=function()local Z=k.Text if Z==''then J()return end Z=X(Z)m.Visible=
|
||||||
BackgroundColor3=Color3.new(0,0,0)end function mouseOverTab(F)assert(F)assert(F:
|
true return H:Fire(Z)end local Z Z=function()r=true end local _ _=function(aa,ab
|
||||||
IsA'TextButton')if F.Selected then return end F.BackgroundColor3=Color3.new(
|
)if aa==Enum.CoreGuiType.Backpack or aa==Enum.CoreGuiType.All then t=ab u=not ab
|
||||||
0.15294117647058825,0.15294117647058825,0.15294117647058825)end function
|
do local ac=game:GetService'GuiService'if u then pcall(function()ac:RemoveKey(y)
|
||||||
newTabClicked(F)assert(F)F=string.lower(F)g=F updateTabGui(F)C:Fire(F)
|
return ac:RemoveKey(z)end)else ac:AddKey(y)ac:AddKey(z)end end J()j.Visible=ab
|
||||||
resetSearch()end function trim(F)return(F:gsub('^%s*(.-)%s*$','%1'))end function
|
and s o.Visible=ab c.Visible=ab h.Visible=ab end end C('CloseBackpack',M)C(
|
||||||
resetSearchBoxGui()k.Visible=false i.Text=v end function doSearch()local F=i.
|
'BackpackReady',Z)pcall(function()_(Enum.CoreGuiType.Backpack,Game.StarterGui:
|
||||||
Text if F==''then resetSearch()return end F=trim(F)k.Visible=true D:Fire(F)end
|
GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))return Game.StarterGui.
|
||||||
function resetSearch()resetSearchBoxGui()D:Fire()end local F=function()p=true
|
CoreGuiChangedSignal:connect(_)end)f.MouseButton1Click:connect(function()return
|
||||||
end function coreGuiChanged(G,H)if G==Enum.CoreGuiType.Backpack or G==Enum.
|
W'gear'end)f.MouseEnter:connect(function()return V(f)end)f.MouseLeave:connect(
|
||||||
CoreGuiType.All then r=H s=not H if s then pcall(function()game:GetService
|
function()return U(f)end)if game.CoreGui.Version>=8 then g.MouseButton1Click:
|
||||||
'GuiService':RemoveKey(w)game:GetService'GuiService':RemoveKey(x)end)else game:
|
connect(function()return W'wardrobe'end)g.MouseEnter:connect(function()return V(
|
||||||
GetService'GuiService':AddKey(w)game:GetService'GuiService':AddKey(x)end
|
g)end)g.MouseLeave:connect(function()return U(g)end)end e.MouseButton1Click:
|
||||||
resetSearch()h.Visible=H and q m.Visible=H a.Visible=H f.Visible=H end end
|
connect(Q)d.Changed:connect(function(aa)if aa=='AbsoluteSize'then return D:Fire(
|
||||||
createPublicFunction('CloseBackpack',E)createPublicFunction('BackpackReady',F)
|
d.AbsoluteSize)end end)do local aa=game:GetService'GuiService'aa:AddKey(y)aa:
|
||||||
pcall(function()coreGuiChanged(Enum.CoreGuiType.Backpack,Game.StarterGui:
|
AddKey(z)aa.KeyPressed:connect(function(ab)if not t or u then return end if ab==
|
||||||
GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))Game.StarterGui.
|
y or ab==z then return O()end end)end h.MouseButton1Click:connect(function()if
|
||||||
CoreGuiChangedSignal:connect(coreGuiChanged)end)d.MouseButton1Click:connect(
|
not t or u then return end return O()end)if game.Players.LocalPlayer['Character'
|
||||||
function()newTabClicked'gear'end)d.MouseEnter:connect(function()mouseOverTab(d)
|
]then P()end game.Players.LocalPlayer.CharacterAdded:connect(P)k.FocusLost:
|
||||||
end)d.MouseLeave:connect(function()mouseLeaveTab(d)end)if game.CoreGui.Version>=
|
connect(function(aa)if aa or k.Text~=''then return Y()elseif k.Text==''then
|
||||||
8 then e.MouseButton1Click:connect(function()newTabClicked'wardrobe'end)e.
|
return J()end end)l.MouseButton1Click:connect(Y)m.MouseButton1Click:connect(J)if
|
||||||
MouseEnter:connect(function()mouseOverTab(e)end)e.MouseLeave:connect(function()
|
j and n.AbsoluteSize.Y<=320 then j.RobloxLocked=false return j:Destroy()end
|
||||||
mouseLeaveTab(e)end)end c.MouseButton1Click:connect(closeBackpack)b.Changed:
|
|
||||||
connect(function(G)if G=='AbsoluteSize'then z:Fire(b.AbsoluteSize)end end)game:
|
|
||||||
GetService'GuiService':AddKey(w)game:GetService'GuiService':AddKey(x)game:
|
|
||||||
GetService'GuiService'.KeyPressed:connect(function(G)if not r or s then return
|
|
||||||
end if G==w or G==x then toggleBackpack()end end)f.MouseButton1Click:connect(
|
|
||||||
function()if not r or s then return end toggleBackpack()end)if game.Players.
|
|
||||||
LocalPlayer['Character']then activateBackpack()end game.Players.LocalPlayer.
|
|
||||||
CharacterAdded:connect(activateBackpack)i.FocusLost:connect(function(G)if G or i
|
|
||||||
.Text~=''then doSearch()elseif i.Text==''then resetSearch()end end)j.
|
|
||||||
MouseButton1Click:connect(doSearch)k.MouseButton1Click:connect(resetSearch)if h
|
|
||||||
and l.AbsoluteSize.Y<=320 then h.RobloxLocked=false h:Destroy()end
|
|
||||||
|
|
@ -1,377 +1,361 @@
|
||||||
local a=false local function WaitForChild(b,c)while b:FindFirstChild(c)==nil do
|
local a,b=false,nil b=function(c,d)while not(c:FindFirstChild(d)~=nil)do c.
|
||||||
b.ChildAdded:wait(0.03)end return b[c]end local function typedef(b)return b end
|
ChildAdded:wait(0.03)end return c[d]end local c c=function()local d=Game:
|
||||||
local function IsPhone()local b=Game:GetService'CoreGui'local c=WaitForChild(b,
|
GetService'CoreGui'local e=b(d,'RobloxGui')if e.AbsoluteSize.Y<600 then return
|
||||||
'RobloxGui')if c.AbsoluteSize.Y<600 then return true end return false end
|
true end return false end local d d=function(e)return e:gsub('^%s*(.-)%s*$','%1'
|
||||||
local function StringTrim(b)return(b:gsub('^%s*(.-)%s*$','%1'))end while Game.
|
)end while not(Game.Players.LocalPlayer~=nil)do wait(0.03)end local e=Game.
|
||||||
Players.LocalPlayer==nil do wait(0.03)end local b=Game.Players.LocalPlayer while
|
Players.LocalPlayer while not(e.Character~=nil)do wait(0.03)end local f,g=Game.
|
||||||
b.Character==nil do wait(0.03)end local c=LoadLibrary'RbxUtility'local d,e,f,g,h
|
Workspace.CurrentCamera,nil g=function(h,i,j)if not(j~=nil)then j=i i=nil end
|
||||||
,i=typedef(c),Game.Workspace.CurrentCamera,Game:GetService'CoreGui',Game:
|
local k=Instance.new(h)if i then k.Name=i end local l for m,n in pairs(j)do if
|
||||||
GetService'Players',Game:GetService'GuiService',nil do i={}local j={}local k,l={
|
type(m)=='string'then if m=='Parent'then l=n else k[m]=n end elseif type(m)==
|
||||||
__call=function(k,l)return k[l]or k[tonumber(l)]end,__index={GetEnumItems=
|
'number'and type(n)=='userdata'then n.Parent=k end end k.Parent=l return k end
|
||||||
function(k)local l={}for m,n in pairs(k)do if type(m)=='number'then l[#l+1]=n
|
local h,i,j,k,l,m=Game:GetService'CoreGui',Game:GetService'Players',Game:
|
||||||
end end table.sort(l,function(o,p)return o.Value<p.Value end)return l end},
|
GetService'GuiService',{},{},nil m=function(n)return function(o)local p={[l]=n}
|
||||||
__tostring=function(k)return'Enum.'..k[j]end},{__call=function(k,l)return l==k
|
for q,r in pairs(o)do local s=setmetatable({Name=r,Value=q,Enum=p,[l]=n},{__call
|
||||||
or l==k.Name or l==k.Value end,__tostring=function(k)return'Enum.'..k[j]..'.'..k
|
=function(s,t)return t==s or t==s.Name or t==s.Value end,__tostring=function(s)
|
||||||
.Name end}function CreateEnum(m)return function(n)local o={[j]=m}for p,q in
|
return'Enum.'..tostring(s[l])..'.'..tostring(s.Name)end})p[q]=s p[r]=s p[s]=s
|
||||||
pairs(n)do local r=setmetatable({Name=q,Value=p,Enum=o,[j]=m},l)o[p]=r o[q]=r o[
|
end k[n]=p return setmetatable(p,{__call=function(s,t)return s[t]or s[tonumber(t
|
||||||
r]=r end i[m]=o return setmetatable(o,k)end end end local j,k={Mouse=b:GetMouse(
|
)]end,__index={GetEnumItems=function(s)o={}for t,u in pairs(s)do if type(t)==
|
||||||
),Speed=0,Simulating=false,Configuration={DefaultSpeed=1},UserIsScrolling=false}
|
'number'then o[#o+1]=u end end table.sort(o,function(v,w)return v.Value<w.Value
|
||||||
,{ChatColors={BrickColor.new'Bright red',BrickColor.new'Bright blue',BrickColor.
|
end)return o end},__tostring=function(s)return'Enum.'..tostring(s[l])end})end
|
||||||
new'Earth green',BrickColor.new'Bright violet',BrickColor.new'Bright orange',
|
end local n,o,p={Mouse=e:GetMouse(),Speed=0,Simulating=false,Configuration={
|
||||||
BrickColor.new'Bright yellow',BrickColor.new'Light reddish violet',BrickColor.
|
DefaultSpeed=1},UserIsScrolling=false},{ChatColors={BrickColor.new'Bright red',
|
||||||
new'Brick yellow'},Gui=nil,Frame=nil,RenderFrame=nil,TapToChatLabel=nil,
|
BrickColor.new'Bright blue',BrickColor.new'Earth green',BrickColor.new
|
||||||
ClickToChatButton=nil,ScrollingLock=false,EventListener=nil,MessageQueue={},
|
'Bright violet',BrickColor.new'Bright orange',BrickColor.new'Bright yellow',
|
||||||
Configuration={FontSize=Enum.FontSize.Size12,NumFontSize=12,HistoryLength=20,
|
BrickColor.new'Light reddish violet',BrickColor.new'Brick yellow'},Gui=nil,Frame
|
||||||
Size=UDim2.new(0.38,0,0.2,0),MessageColor=Color3.new(1,1,1),AdminMessageColor=
|
=nil,RenderFrame=nil,TapToChatLabel=nil,ClickToChatButton=nil,ScrollingLock=
|
||||||
Color3.new(1,0.8431372549019608,0),XScale=0.025,LifeTime=45,Position=UDim2.new(0
|
false,EventListener=nil,MessageQueue={},Configuration={FontSize=Enum.FontSize.
|
||||||
,2,0.05,0),DefaultTweenSpeed=0.15},SlotPositions_List={},CachedSpaceStrings_List
|
Size12,NumFontSize=12,HistoryLength=20,Size=UDim2.new(0.38,0,0.2,0),MessageColor
|
||||||
={},MouseOnFrame=false,GotFocus=false,Messages_List={},MessageThread=nil,
|
=Color3.new(1,1,1),AdminMessageColor=Color3.new(1,0.8431372549019608,0),XScale=
|
||||||
Admins_List={'taskmanager','Heliodex','tako'},SafeChat_List={[
|
0.025,LifeTime=45,Position=UDim2.new(0,2,0.05,0),DefaultTweenSpeed=0.15},
|
||||||
'Use the Chat menu to talk to me.']={'/sc 0',true},['I can only see menu chats.'
|
SlotPositions_List={},CachedSpaceStrings_List={},MouseOnFrame=false,GotFocus=
|
||||||
]={'/sc 1',true},['Hello']={['Hi']={'/sc 2_0',true,['Hi there!']=true,[
|
false,Messages_List={},MessageThread=nil,Admins_List={'taskmanager','Heliodex',
|
||||||
'Hi everyone']=true},['Howdy']={'/sc 2_1',true,['Howdy partner!']=true},[
|
'tako'},SafeChat_List={['Use the Chat menu to talk to me.']={'/sc0',true},[
|
||||||
'Greetings']={'/sc 2_2',true,['Greetings everyone']=true,[
|
'I can only see menu chats.']={'/sc1',true},Hello={Hi={'/sc2_0',true,[
|
||||||
'Greetings Robloxians!']=true,['Seasons greetings!']=true},['Welcome']={
|
'Hi there!']=true,['Hi everyone']=true},Howdy={'/sc2_1',true,['Howdy partner!']=
|
||||||
'/sc 2_3',true,['Welcome to my place']=true,['Welcome to my barbeque']=true,[
|
true},Greetings={'/sc2_2',true,['Greetings everyone']=true,[
|
||||||
'Welcome to our base']=true},['Hey there!']={'/sc 2_4',true},["What's up?"]={
|
'Greetings Robloxians!']=true,['Seasons greetings!']=true},Welcome={'/sc2_3',
|
||||||
'/sc 2_5',true,['How are you doing?']=true,["How's it going?"]=true,[
|
true,['Welcome to my place']=true,['Welcome to my barbeque']=true,[
|
||||||
"What's new?"]=true},['Good day']={'/sc 2_6',true,['Good morning']=true,[
|
'Welcome to our base']=true},['Hey there!']={'/sc2_4',true},["What's up?"]={
|
||||||
'Good evening']=true,['Good afternoon']=true,['Good night']=true},['Silly']={
|
'/sc2_5',true,['How are you doing?']=true,["How's it going?"]=true,[
|
||||||
'/sc 2_7',true,['Waaaaaaaz up?!']=true,['Hullo!']=true,[
|
"What's new?"]=true},['Good day']={'/sc2_6',true,['Good morning']=true,[
|
||||||
|
'Good evening']=true,['Good afternoon']=true,['Good night']=true},Silly={
|
||||||
|
'/sc2_7',true,['Waaaaaaaz up?!']=true,['Hullo!']=true,[
|
||||||
'Behold greatness, mortals!']=true,['Pardon me, is this Sparta?']=true,[
|
'Behold greatness, mortals!']=true,['Pardon me, is this Sparta?']=true,[
|
||||||
'THIS IS SPARTAAAA!']=true},['Happy Holidays!']={'/sc 2_8',true,[
|
'THIS IS SPARTAAAA!']=true},['Happy Holidays!']={'/sc2_8',true,[
|
||||||
'Happy New Year!']=true,["Happy Valentine's Day!"]=true,[
|
'Happy New Year!']=true,["Happy Valentine's Day!"]=true,[
|
||||||
'Beware the Ides of March!']=true,["Happy St. Patrick's Day!"]=true,[
|
'Beware the Ides of March!']=true,["Happy St. Patrick's Day!"]=true,[
|
||||||
'Happy Easter!']=true,['Happy Earth Day!']=true,['Happy 4th of July!']=true,[
|
'Happy Easter!']=true,['Happy Earth Day!']=true,['Happy 4th of July!']=true,[
|
||||||
'Happy Thanksgiving!']=true,['Happy Halloween!']=true,['Happy Hanukkah!']=true,[
|
'Happy Thanksgiving!']=true,['Happy Halloween!']=true,['Happy Hanukkah!']=true,[
|
||||||
'Merry Christmas!']=true,['Happy May Day!']=true,['Happy Towel Day!']=true,[
|
'Merry Christmas!']=true,['Happy May Day!']=true,['Happy Towel Day!']=true,[
|
||||||
'Happy Mercury Day!']=true,['Happy LOL Day!']=true},[1]='/sc 2'},['Goodbye']={[
|
'Happy Mercury Day!']=true,['Happy LOL Day!']=true},'/sc2'},Goodbye={[
|
||||||
'Good Night']={'/sc 3_0',true,['Sweet dreams']=true,['Go to sleep!']=true,[
|
'Good Night']={'/sc3_0',true,['Sweet dreams']=true,['Go to sleep!']=true,[
|
||||||
'Lights out!']=true,['Bedtime']=true,['Going to bed now']=true},['Later']={
|
'Lights out!']=true,Bedtime=true,['Going to bed now']=true},Later={'/sc3_1',true
|
||||||
'/sc 3_1',true,['See ya later']=true,['Later gator!']=true,['See you tomorrow']=
|
,['See ya later']=true,['Later gator!']=true,['See you tomorrow']=true},Bye={
|
||||||
true},['Bye']={'/sc 3_2',true,['Hasta la bye bye!']=true},["I'll be right back"]
|
'/sc3_2',true,['Hasta la bye bye!']=true},["I'll be right back"]={'/sc3_3',true}
|
||||||
={'/sc 3_3',true},['I have to go']={'/sc 3_4',true},['Farewell']={'/sc 3_5',true
|
,['I have to go']={'/sc3_4',true},Farewell={'/sc3_5',true,['Take care']=true,[
|
||||||
,['Take care']=true,['Have a nice day']=true,['Goodluck!']=true,[
|
'Have a nice day']=true,['Goodluck!']=true,['Ta-ta for now!']=true},Peace={
|
||||||
'Ta-ta for now!']=true},['Peace']={'/sc 3_6',true,['Peace out!']=true,[
|
'/sc3_6',true,['Peace out!']=true,['Peace dudes!']=true,['Rest in pieces!']=true
|
||||||
'Peace dudes!']=true,['Rest in pieces!']=true},['Silly']={'/sc 3_7',true,[
|
},Silly={'/sc3_7',true,['To the batcave!']=true,['Over and out!']=true,[
|
||||||
'To the batcave!']=true,['Over and out!']=true,['Happy trails!']=true,[
|
'Happy trails!']=true,["I've got to book it!"]=true,['Tootles!']=true,[
|
||||||
"I've got to book it!"]=true,['Tootles!']=true,['Smell you later!']=true,['GG!']
|
'Smell you later!']=true,['GG!']=true,['My house is on fire! gtg.']=true},'/sc3'
|
||||||
=true,['My house is on fire! gtg.']=true},[1]='/sc 3'},['Friend']={[
|
},Friend={['Wanna be friends?']={'/sc4_0',true},['Follow me']={'/sc4_1',true,[
|
||||||
'Wanna be friends?']={'/sc 4_0',true},['Follow me']={'/sc 4_1',true,[
|
|
||||||
'Come to my place!']=true,['Come to my base!']=true,['Follow me, team!']=true,[
|
'Come to my place!']=true,['Come to my base!']=true,['Follow me, team!']=true,[
|
||||||
'Follow me']=true},['Your place is cool']={'/sc 4_2',true,['Your place is fun']=
|
'Follow me']=true},['Your place is cool']={'/sc4_2',true,['Your place is fun']=
|
||||||
true,['Your place is awesome']=true,['Your place looks good']=true,[
|
true,['Your place is awesome']=true,['Your place looks good']=true,[
|
||||||
'This place is awesome!']=true},['Thank you']={'/sc 4_3',true,[
|
'This place is awesome!']=true},['Thank you']={'/sc4_3',true,[
|
||||||
'Thanks for playing']=true,['Thanks for visiting']=true,['Thanks for everything'
|
'Thanks for playing']=true,['Thanks for visiting']=true,['Thanks for everything'
|
||||||
]=true,['No, thank you']=true,['Thanx']=true},['No problem']={'/sc 4_4',true,[
|
]=true,['No, thank you']=true,Thanx=true},['No problem']={'/sc4_4',true,[
|
||||||
"Don't worry"]=true,["That's ok"]=true,['np']=true},['You are ...']={'/sc 4_5',
|
"Don't worry"]=true,["That's ok"]=true,np=true},['You are ...']={'/sc4_5',true,[
|
||||||
true,['You are great!']=true,['You are good!']=true,['You are cool!']=true,[
|
'You are great!']=true,['You are good!']=true,['You are cool!']=true,[
|
||||||
'You are funny!']=true,['You are silly!']=true,['You are awesome!']=true,[
|
'You are funny!']=true,['You are silly!']=true,['You are awesome!']=true,[
|
||||||
"You are doing something I don't like, please stop"]=true},['I like ...']={
|
"You are doing something I don't like, please stop"]=true},['I like ...']={
|
||||||
'/sc 4_6',true,['I like your name']=true,['I like your shirt']=true,[
|
'/sc4_6',true,['I like your name']=true,['I like your shirt']=true,[
|
||||||
'I like your place']=true,['I like your style']=true,['I like you']=true,[
|
'I like your place']=true,['I like your style']=true,['I like you']=true,[
|
||||||
'I like items']=true,['I like money']=true},['Sorry']={'/sc 4_7',true,['My bad!'
|
'I like items']=true,['I like money']=true},Sorry={'/sc4_7',true,['My bad!']=
|
||||||
]=true,["I'm sorry"]=true,['Whoops!']=true,['Please forgive me.']=true,[
|
true,["I'm sorry"]=true,['Whoops!']=true,['Please forgive me.']=true,[
|
||||||
'I forgive you.']=true,["I didn't mean to do that."]=true,[
|
'I forgive you.']=true,["I didn't mean to do that."]=true,[
|
||||||
"Sorry, I'll stop now."]=true},[1]='/sc 4'},['Questions']={['Who?']={'/sc 5_0',
|
"Sorry, I'll stop now."]=true},'/sc4'},Questions={['Who?']={'/sc5_0',true,[
|
||||||
true,['Who wants to be my friend?']=true,['Who wants to be on my team?']=true,[
|
'Who wants to be my friend?']=true,['Who wants to be on my team?']=true,[
|
||||||
'Who made this brilliant game?']=true},['What?']={'/sc 5_1',true,[
|
'Who made this brilliant game?']=true},['What?']={'/sc5_1',true,[
|
||||||
'What is your favorite animal?']=true,['What is your favorite game?']=true,[
|
'What is your favorite animal?']=true,['What is your favorite game?']=true,[
|
||||||
'What is your favorite movie?']=true,['What is your favorite TV show?']=true,[
|
'What is your favorite movie?']=true,['What is your favorite TV show?']=true,[
|
||||||
'What is your favorite music?']=true,['What are your hobbies?']=true,['LOLWUT?']
|
'What is your favorite music?']=true,['What are your hobbies?']=true,['LOLWUT?']
|
||||||
=true},['When?']={'/sc 5_2',true,['When are you online?']=true,[
|
=true},['When?']={'/sc5_2',true,['When are you online?']=true,[
|
||||||
'When is the new version coming out?']=true,['When can we play again?']=true,[
|
'When is the new version coming out?']=true,['When can we play again?']=true,[
|
||||||
'When will your place be done?']=true},['Where?']={'/sc 5_3',true,[
|
'When will your place be done?']=true},['Where?']={'/sc5_3',true,[
|
||||||
'Where do you want to go?']=true,['Where are you going?']=true,['Where am I?!']=
|
'Where do you want to go?']=true,['Where are you going?']=true,['Where am I?!']=
|
||||||
true,['Where did you go?']=true},['How?']={'/sc 5_4',true,['How are you today?']
|
true,['Where did you go?']=true},['How?']={'/sc5_4',true,['How are you today?']=
|
||||||
=true,['How did you make this cool place?']=true,['LOLHOW?']=true},['Can I...']=
|
true,['How did you make this cool place?']=true,['LOLHOW?']=true},['Can I...']={
|
||||||
{'/sc 5_5',true,['Can I have a tour?']=true,['Can I be on your team?']=true,[
|
'/sc5_5',true,['Can I have a tour?']=true,['Can I be on your team?']=true,[
|
||||||
'Can I be your friend?']=true,['Can I try something?']=true,[
|
'Can I be your friend?']=true,['Can I try something?']=true,[
|
||||||
'Can I have that please?']=true,['Can I have that back please?']=true,[
|
'Can I have that please?']=true,['Can I have that back please?']=true,[
|
||||||
'Can I have borrow your hat?']=true,['Can I have borrow your gear?']=true},[1]=
|
'Can I have borrow your hat?']=true,['Can I have borrow your gear?']=true},
|
||||||
'/sc 5'},['Answers']={['You need help?']={'/sc 6_0',true,[
|
'/sc5'},Answers={['You need help?']={'/sc6_0',true,['Check out the news section'
|
||||||
'Check out the news section']=true,['Check out the help section']=true,[
|
]=true,['Check out the help section']=true,['Read the wiki!']=true,[
|
||||||
'Read the wiki!']=true,['All the answers are in the wiki!']=true,[
|
'All the answers are in the wiki!']=true,['I will help you with this.']=true},[
|
||||||
'I will help you with this.']=true},['Some people ...']={'/sc 6_1',true,['Me']=
|
'Some people ...']={'/sc6_1',true,Me=true,['Not me']=true,You=true,['All of us']
|
||||||
true,['Not me']=true,['You']=true,['All of us']=true,['Everyone but you']=true,[
|
=true,['Everyone but you']=true,['Builderman!']=true,['Telamon!']=true,[
|
||||||
'Builderman!']=true,['Telamon!']=true,['My team']=true,['My group']=true,['Mom']
|
'My team']=true,['My group']=true,Mom=true,Dad=true,Sister=true,Brother=true,
|
||||||
=true,['Dad']=true,['Sister']=true,['Brother']=true,['Cousin']=true,[
|
Cousin=true,Grandparent=true,Friend=true},['Time ...']={'/sc6_2',true,[
|
||||||
'Grandparent']=true,['Friend']=true},['Time ...']={'/sc 6_2',true,[
|
'In the morning']=true,['In the afternoon']=true,['At night']=true,Tomorrow=true
|
||||||
'In the morning']=true,['In the afternoon']=true,['At night']=true,['Tomorrow']=
|
,['This week']=true,['This month']=true,Sometime=true,Sometimes=true,[
|
||||||
true,['This week']=true,['This month']=true,['Sometime']=true,['Sometimes']=true
|
'Whenever you want']=true,Never=true,['After this']=true,['In 10 minutes']=true,
|
||||||
,['Whenever you want']=true,['Never']=true,['After this']=true,['In 10 minutes']
|
['In a couple hours']=true,['In a couple days']=true},Animals={'/sc6_3',true,
|
||||||
=true,['In a couple hours']=true,['In a couple days']=true},['Animals']={
|
Cats={Lion=true,Tiger=true,Leopard=true,Cheetah=true},Dogs={Wolves=true,Beagle=
|
||||||
'/sc 6_3',true,['Cats']={['Lion']=true,['Tiger']=true,['Leopard']=true,[
|
true,Collie=true,Dalmatian=true,Poodle=true,Spaniel=true,Shepherd=true,Terrier=
|
||||||
'Cheetah']=true},['Dogs']={['Wolves']=true,['Beagle']=true,['Collie']=true,[
|
true,Retriever=true},Horses={Ponies=true,Stallions=true,Pwnyz=true},Reptiles={
|
||||||
'Dalmatian']=true,['Poodle']=true,['Spaniel']=true,['Shepherd']=true,['Terrier']
|
Dinosaurs=true,Lizards=true,Snakes=true,['Turtles!']=true},Hamster=true,Monkey=
|
||||||
=true,['Retriever']=true},['Horses']={['Ponies']=true,['Stallions']=true,[
|
true,Bears=true,Fish={Goldfish=true,Sharks=true,['Sea Bass']=true,Halibut=true,[
|
||||||
'Pwnyz']=true},['Reptiles']={['Dinosaurs']=true,['Lizards']=true,['Snakes']=true
|
'Tropical Fish']=true},Birds={Eagles=true,Penguins=true,Parakeets=true,Owls=true
|
||||||
,['Turtles!']=true},['Hamster']=true,['Monkey']=true,['Bears']=true,['Fish']={[
|
,Hawks=true,Pidgeons=true},Elephants=true,['Mythical Beasts']={Dragons=true,
|
||||||
'Goldfish']=true,['Sharks']=true,['Sea Bass']=true,['Halibut']=true,[
|
Unicorns=true,['Sea Serpents']=true,Sphinx=true,Cyclops=true,Minotaurs=true,
|
||||||
'Tropical Fish']=true},['Birds']={['Eagles']=true,['Penguins']=true,['Parakeets'
|
Goblins=true,['Honest Politicians']=true,Ghosts=true,['Scylla and Charybdis']=
|
||||||
]=true,['Owls']=true,['Hawks']=true,['Pidgeons']=true},['Elephants']=true,[
|
true}},Games={'/sc6_4',true,Action=true,Puzzle=true,Strategy=true,Racing=true,
|
||||||
'Mythical Beasts']={['Dragons']=true,['Unicorns']=true,['Sea Serpents']=true,[
|
RPG=true,['Obstacle Course']=true,Tycoon=true,Roblox={BrickBattle=true,[
|
||||||
'Sphinx']=true,['Cyclops']=true,['Minotaurs']=true,['Goblins']=true,[
|
'Community Building']=true,['Roblox Minigames']=true,['Contest Place']=true},[
|
||||||
'Honest Politicians']=true,['Ghosts']=true,['Scylla and Charybdis']=true}},[
|
'Board games']={Chess=true,Checkers=true,['Settlers of Catan']=true,[
|
||||||
'Games']={'/sc 6_4',true,['Action']=true,['Puzzle']=true,['Strategy']=true,[
|
'Tigris and Euphrates']=true,['El Grande']=true,Stratego=true,Carcassonne=true}}
|
||||||
'Racing']=true,['RPG']=true,['Obstacle Course']=true,['Tycoon']=true,['Roblox']=
|
,Sports={'/sc6_5',true,Hockey=true,Soccer=true,Football=true,Baseball=true,
|
||||||
{['BrickBattle']=true,['Community Building']=true,['Roblox Minigames']=true,[
|
Basketball=true,Volleyball=true,Tennis=true,['Sports team practice']=true,
|
||||||
'Contest Place']=true},['Board games']={['Chess']=true,['Checkers']=true,[
|
Watersports={Surfing=true,Swimming=true,['Water Polo']=true},['Winter sports']={
|
||||||
'Settlers of Catan']=true,['Tigris and Euphrates']=true,['El Grande']=true,[
|
Skiing=true,Snowboarding=true,Sledding=true,Skating=true},Adventure={[
|
||||||
'Stratego']=true,['Carcassonne']=true}},['Sports']={'/sc 6_5',true,['Hockey']=
|
'Rock climbing']=true,Hiking=true,Fishing=true,['Horseback riding']=true},Wacky=
|
||||||
true,['Soccer']=true,['Football']=true,['Baseball']=true,['Basketball']=true,[
|
{Foosball=true,Calvinball=true,Croquet=true,Cricket=true,Dodgeball=true,Squash=
|
||||||
'Volleyball']=true,['Tennis']=true,['Sports team practice']=true,['Watersports']
|
true,Trampoline=true}},['Movies/TV']={'/sc6_6',true,['Science Fiction']=true,
|
||||||
={['Surfing']=true,['Swimming']=true,['Water Polo']=true},['Winter sports']={[
|
Animated={Anime=true},Comedy=true,Romantic=true,Action=true,Fantasy=true},Music=
|
||||||
'Skiing']=true,['Snowboarding']=true,['Sledding']=true,['Skating']=true},[
|
{'/sc6_7',true,Country=true,Jazz=true,Rap=true,['Hip-hop']=true,Techno=true,
|
||||||
'Adventure']={['Rock climbing']=true,['Hiking']=true,['Fishing']=true,[
|
Classical=true,Pop=true,Rock=true},Hobbies={'/sc6_8',true,Computers={[
|
||||||
'Horseback riding']=true},['Wacky']={['Foosball']=true,['Calvinball']=true,[
|
'Building computers']=true,Videogames=true,Coding=true,Hacking=true},[
|
||||||
'Croquet']=true,['Cricket']=true,['Dodgeball']=true,['Squash']=true,[
|
'The Internet']={['lol. teh internets!']=true,['Watching vids']=true},Dance=true
|
||||||
'Trampoline']=true}},['Movies/TV']={'/sc 6_6',true,['Science Fiction']=true,[
|
,Gymnastics=true,['Listening to music']=true,['Arts and crafts']=true,[
|
||||||
'Animated']={['Anime']=true},['Comedy']=true,['Romantic']=true,['Action']=true,[
|
'Martial Arts']={Karate=true,Judo=true,['Taikwon Do']=true,Wushu=true,[
|
||||||
'Fantasy']=true},['Music']={'/sc 6_7',true,['Country']=true,['Jazz']=true,['Rap'
|
|
||||||
]=true,['Hip-hop']=true,['Techno']=true,['Classical']=true,['Pop']=true,['Rock']
|
|
||||||
=true},['Hobbies']={'/sc 6_8',true,['Computers']={['Building computers']=true,[
|
|
||||||
'Videogames']=true,['Coding']=true,['Hacking']=true},['The Internet']={[
|
|
||||||
'lol. teh internets!']=true,['Watching vids']=true},['Dance']=true,['Gymnastics'
|
|
||||||
]=true,['Listening to music']=true,['Arts and crafts']=true,['Martial Arts']={[
|
|
||||||
'Karate']=true,['Judo']=true,['Taikwon Do']=true,['Wushu']=true,[
|
|
||||||
'Street fighting']=true},['Music lessons']={['Playing in my band']=true,[
|
'Street fighting']=true},['Music lessons']={['Playing in my band']=true,[
|
||||||
'Playing piano']=true,['Playing guitar']=true,['Playing violin']=true,[
|
'Playing piano']=true,['Playing guitar']=true,['Playing violin']=true,[
|
||||||
'Playing drums']=true,['Playing a weird instrument']=true}},['Location']={
|
'Playing drums']=true,['Playing a weird instrument']=true}},Location={'/sc6_9',
|
||||||
'/sc 6_9',true,['USA']={['West']={['Alaska']=true,['Arizona']=true,['California'
|
true,USA={West={Alaska=true,Arizona=true,California=true,Colorado=true,Hawaii=
|
||||||
]=true,['Colorado']=true,['Hawaii']=true,['Idaho']=true,['Montana']=true,[
|
true,Idaho=true,Montana=true,Nevada=true,['New Mexico']=true,Oregon=true,Utah=
|
||||||
'Nevada']=true,['New Mexico']=true,['Oregon']=true,['Utah']=true,['Washington']=
|
true,Washington=true,Wyoming=true},South={Alabama=true,Arkansas=true,Florida=
|
||||||
true,['Wyoming']=true},['South']={['Alabama']=true,['Arkansas']=true,['Florida']
|
true,Georgia=true,Kentucky=true,Louisiana=true,Mississippi=true,[
|
||||||
=true,['Georgia']=true,['Kentucky']=true,['Louisiana']=true,['Mississippi']=true
|
'North Carolina']=true,Oklahoma=true,['South Carolina']=true,Tennessee=true,
|
||||||
,['North Carolina']=true,['Oklahoma']=true,['South Carolina']=true,['Tennessee']
|
Texas=true,Virginia=true,['West Virginia']=true},Northeast={Connecticut=true,
|
||||||
=true,['Texas']=true,['Virginia']=true,['West Virginia']=true},['Northeast']={[
|
Delaware=true,Maine=true,Maryland=true,Massachusetts=true,['New Hampshire']=true
|
||||||
'Connecticut']=true,['Delaware']=true,['Maine']=true,['Maryland']=true,[
|
,['New Jersey']=true,['New York']=true,Pennsylvania=true,['Rhode Island']=true,
|
||||||
'Massachusetts']=true,['New Hampshire']=true,['New Jersey']=true,['New York']=
|
Vermont=true},Midwest={Illinois=true,Indiana=true,Iowa=true,Kansas=true,Michigan
|
||||||
true,['Pennsylvania']=true,['Rhode Island']=true,['Vermont']=true},['Midwest']={
|
=true,Minnesota=true,Missouri=true,Nebraska=true,['North Dakota']=true,Ohio=true
|
||||||
['Illinois']=true,['Indiana']=true,['Iowa']=true,['Kansas']=true,['Michigan']=
|
,['South Dakota']=true,Wisconsin=true}},Canada={Alberta=true,['British Columbia'
|
||||||
true,['Minnesota']=true,['Missouri']=true,['Nebraska']=true,['North Dakota']=
|
]=true,Manitoba=true,['New Brunswick']=true,Newfoundland=true,[
|
||||||
true,['Ohio']=true,['South Dakota']=true,['Wisconsin']=true}},['Canada']={[
|
'Northwest Territories']=true,['Nova Scotia']=true,Nunavut=true,Ontario=true,[
|
||||||
'Alberta']=true,['British Columbia']=true,['Manitoba']=true,['New Brunswick']=
|
'Prince Edward Island']=true,Quebec=true,Saskatchewan=true,Yukon=true},Mexico=
|
||||||
true,['Newfoundland']=true,['Northwest Territories']=true,['Nova Scotia']=true,[
|
true,['Central America']=true,Europe={France=true,Germany=true,Spain=true,Italy=
|
||||||
'Nunavut']=true,['Ontario']=true,['Prince Edward Island']=true,['Quebec']=true,[
|
true,Poland=true,Switzerland=true,Greece=true,Romania=true,Netherlands=true,[
|
||||||
'Saskatchewan']=true,['Yukon']=true},['Mexico']=true,['Central America']=true,[
|
'Great Britain']={England=true,Scotland=true,Wales=true,['Northern Ireland']=
|
||||||
'Europe']={['France']=true,['Germany']=true,['Spain']=true,['Italy']=true,[
|
true}},Asia={China=true,India=true,Japan=true,Korea=true,Russia=true,Vietnam=
|
||||||
'Poland']=true,['Switzerland']=true,['Greece']=true,['Romania']=true,[
|
true},['South America']={Argentina=true,Brazil=true},Africa={Eygpt=true,
|
||||||
'Netherlands']=true,['Great Britain']={['England']=true,['Scotland']=true,[
|
Swaziland=true},Australia=true,['Middle East']=true,Antarctica=true,[
|
||||||
'Wales']=true,['Northern Ireland']=true}},['Asia']={['China']=true,['India']=
|
'New Zealand']=true},Age={'/sc6_10',true,Rugrat=true,Kid=true,Tween=true,Teen=
|
||||||
true,['Japan']=true,['Korea']=true,['Russia']=true,['Vietnam']=true},[
|
true,Twenties=true,Old=true,Ancient=true,Mesozoic=true,[
|
||||||
'South America']={['Argentina']=true,['Brazil']=true},['Africa']={['Eygpt']=true
|
"I don't want to say my age. Don't ask."]=true},Mood={'/sc6_11',true,Good=true,[
|
||||||
,['Swaziland']=true},['Australia']=true,['Middle East']=true,['Antarctica']=true
|
'Great!']=true,['Not bad']=true,Sad=true,Hyper=true,Chill=true,Happy=true,[
|
||||||
,['New Zealand']=true},['Age']={'/sc 6_10',true,['Rugrat']=true,['Kid']=true,[
|
'Kind of mad']=true},Boy={'/sc6_12',true},Girl={'/sc6_13',true},[
|
||||||
'Tween']=true,['Teen']=true,['Twenties']=true,['Old']=true,['Ancient']=true,[
|
"I don't want to say boy or girl. Don't ask."]={'/sc6_14',true},'/sc6'},Game={[
|
||||||
'Mesozoic']=true,["I don't want to say my age. Don't ask."]=true},['Mood']={
|
"Let's build"]={'/sc7_0',true},["Let's battle"]={'/sc7_1',true},['Nice one!']={
|
||||||
'/sc 6_11',true,['Good']=true,['Great!']=true,['Not bad']=true,['Sad']=true,[
|
'/sc7_2',true},['So far so good']={'/sc7_3',true},['Lucky shot!']={'/sc7_4',true
|
||||||
'Hyper']=true,['Chill']=true,['Happy']=true,['Kind of mad']=true},['Boy']={
|
},['Oh man!']={'/sc7_5',true},['I challenge you to a fight!']={'/sc7_6',true},[
|
||||||
'/sc 6_12',true},['Girl']={'/sc 6_13',true},[
|
'Help me with this']={'/sc7_7',true},["Let's go to your game"]={'/sc7_8',true},[
|
||||||
"I don't want to say boy or girl. Don't ask."]={'/sc 6_14',true},[1]='/sc 6'},[
|
'Can you show me how do to that?']={'/sc7_9',true},['Backflip!']={'/sc7_10',true
|
||||||
'Game']={["Let's build"]={'/sc 7_0',true},["Let's battle"]={'/sc 7_1',true},[
|
},['Frontflip!']={'/sc7_11',true},['Dance!']={'/sc7_12',true},[
|
||||||
'Nice one!']={'/sc 7_2',true},['So far so good']={'/sc 7_3',true},['Lucky shot!'
|
"I'm on your side!"]={'/sc7_13',true},['Game Commands']={'/sc7_14',true,regen=
|
||||||
]={'/sc 7_4',true},['Oh man!']={'/sc 7_5',true},['I challenge you to a fight!']=
|
true,reset=true,go=true,fix=true,respawn=true},'/sc7'},Silly={['Muahahahaha!']=
|
||||||
{'/sc 7_6',true},['Help me with this']={'/sc 7_7',true},["Let's go to your game"
|
true,['all your base are belong to me!']=true,['GET OFF MAH LAWN']=true,[
|
||||||
]={'/sc 7_8',true},['Can you show me how do to that?']={'/sc 7_9',true},[
|
'TEH EPIK DUCK IS COMING!!!']=true,ROFL=true,['1337']={true,['i r teh pwnz0r!']=
|
||||||
'Backflip!']={'/sc 7_10',true},['Frontflip!']={'/sc 7_11',true},['Dance!']={
|
true,['w00t!']=true,['z0mg h4x!']=true,['ub3rR0xXorzage!']=true}},Yes={[
|
||||||
'/sc 7_12',true},["I'm on your side!"]={'/sc 7_13',true},['Game Commands']={
|
'Absolutely!']=true,['Rock on!']=true,['Totally!']=true,['Juice!']=true,['Yay!']
|
||||||
'/sc 7_14',true,['regen']=true,['reset']=true,['go']=true,['fix']=true,[
|
=true,Yesh=true},No={['Ummm. No.']=true,['...']=true,['Stop!']=true,['Go away!']
|
||||||
'respawn']=true},[1]='/sc 7'},['Silly']={['Muahahahaha!']=true,[
|
=true,["Don't do that"]=true,['Stop breaking the rules']=true,["I don't want to"
|
||||||
'all your base are belong to me!']=true,['GET OFF MAH LAWN']=true,[
|
]=true},Ok={['Well... ok']=true,Sure=true},Uncertain={Maybe=true,["I don't know"
|
||||||
'TEH EPIK DUCK IS COMING!!!']=true,['ROFL']=true,['1337']={true,[
|
]=true,idk=true,["I can't decide"]=true,['Hmm...']=true},[':-)']={[':-(']=true,[
|
||||||
'i r teh pwnz0r!']=true,['w00t!']=true,['z0mg h4x!']=true,['ub3rR0xXorzage!']=
|
':D']=true,[':-O']=true,lol=true,['=D']=true,['D=']=true,XD=true,[';D']=true,[
|
||||||
true}},['Yes']={['Absolutely!']=true,['Rock on!']=true,['Totally!']=true,[
|
';)']=true,O_O=true,['=)']=true,['@_@']=true,['>_<']=true,T_T=true,['^_^']
|
||||||
'Juice!']=true,['Yay!']=true,['Yesh']=true},['No']={['Ummm. No.']=true,['...']=
|
=true,['<(0_0<) <(0_0)> (>0_0)> KIRBY DANCE']=true,[")';"]=true,[':3']=true},
|
||||||
true,['Stop!']=true,['Go away!']=true,["Don't do that"]=true,[
|
Ratings={['Rate it!']=true,['I give it a 1 out of 10']=true,[
|
||||||
'Stop breaking the rules']=true,["I don't want to"]=true},['Ok']={['Well... ok']
|
|
||||||
=true,['Sure']=true},['Uncertain']={['Maybe']=true,["I don't know"]=true,['idk']
|
|
||||||
=true,["I can't decide"]=true,['Hmm...']=true},[':-)']={[':-(']=true,[':D']=true
|
|
||||||
,[':-O']=true,['lol']=true,['=D']=true,['D=']=true,['XD']=true,[';D']=true,[';)'
|
|
||||||
]=true,['O_O']=true,['=)']=true,['@_@']=true,['>_<']=true,['T_T']=true,[
|
|
||||||
'^_^']=true,['<(0_0<) <(0_0)> (>0_0)> KIRBY DANCE']=true,[")';"]=true,[':3']=
|
|
||||||
true},['Ratings']={['Rate it!']=true,['I give it a 1 out of 10']=true,[
|
|
||||||
'I give it a 2 out of 10']=true,['I give it a 3 out of 10']=true,[
|
'I give it a 2 out of 10']=true,['I give it a 3 out of 10']=true,[
|
||||||
'I give it a 4 out of 10']=true,['I give it a 5 out of 10']=true,[
|
'I give it a 4 out of 10']=true,['I give it a 5 out of 10']=true,[
|
||||||
'I give it a 6 out of 10']=true,['I give it a 7 out of 10']=true,[
|
'I give it a 6 out of 10']=true,['I give it a 7 out of 10']=true,[
|
||||||
'I give it a 8 out of 10']=true,['I give it a 9 out of 10']=true,[
|
'I give it a 8 out of 10']=true,['I give it a 9 out of 10']=true,[
|
||||||
'I give it a 10 out of 10!']=true}},CreateEnum'SafeChat'{'Level1','Level2',
|
'I give it a 10 out of 10!']=true}},m'SafeChat'{'Level1','Level2','Level3'},
|
||||||
'Level3'},SafeChatTree={},TempSpaceLabel=nil}local function GetNameValue(l)local
|
SafeChatTree={},TempSpaceLabel=nil},nil p=function(q)local r=0 for s=1,#q do
|
||||||
m=0 for n=1,#l do local o,p=string.byte(string.sub(l,n,n)),#l-n+1 if#l%2==1 then
|
local t,u=string.byte(string.sub(q,s,s)),#q-s+1 if#q%2==1 then u=u-1 end if u%4
|
||||||
p=p-1 end if p%4>=2 then o=-o end m=m+o end return m%8 end function k:
|
>=2 then t=-t end r=r+t end return r%8 end o.ComputeChatColor=function(q,r)
|
||||||
ComputeChatColor(l)return self.ChatColors[GetNameValue(l)+1].Color end function
|
return q.ChatColors[p(r)+1].Color end o.EnableScrolling=function(q,r)q.
|
||||||
k:EnableScrolling(l)self.MouseOnFrame=false if self.RenderFrame then self.
|
MouseOnFrame=false if q.RenderFrame then q.RenderFrame.MouseEnter:connect(
|
||||||
RenderFrame.MouseEnter:connect(function()local m=b.Character local n,o=
|
function()local s=e.Character local t,u=b(s,'Torso'),b(s,'Head')if r then q.
|
||||||
WaitForChild(m,'Torso'),WaitForChild(m,'Head')if l then self.MouseOnFrame=true e
|
MouseOnFrame=true f.CameraType='Scriptable'return Spawn(function()local v=f.
|
||||||
.CameraType='Scriptable'Spawn(function()local p=e.CoordinateFrame.p-n.Position
|
CoordinateFrame.p-t.Position while o.MouseOnFrame do f.CoordinateFrame=CFrame.
|
||||||
while k.MouseOnFrame do e.CoordinateFrame=CFrame.new(n.Position+p,o.Position)
|
new(t.Position+v,u.Position)wait(0.015)end end)end end)return q.RenderFrame.
|
||||||
wait(0.015)end end)end end)self.RenderFrame.MouseLeave:connect(function()e.
|
MouseLeave:connect(function()f.CameraType='Custom'q.MouseOnFrame=false end)end
|
||||||
CameraType='Custom'self.MouseOnFrame=false end)end end function k:IsTouchDevice(
|
end o.IsTouchDevice=function(q)local r=false pcall(function()r=Game:GetService
|
||||||
)local l=false pcall(function()l=Game:GetService'UserInputService'.TouchEnabled
|
'UserInputService'.TouchEnabled end)return r end o.UpdateQueue=function(q,r,s)
|
||||||
end)return l end function k:UpdateQueue(l,m)for n=#self.MessageQueue,1,-1 do if
|
for t=#q.MessageQueue,1,-1 do if q.MessageQueue[t]then for u,v in pairs(q.
|
||||||
self.MessageQueue[n]then for o,p in pairs(self.MessageQueue[n])do if p and type(
|
MessageQueue[t])do if v and type(v)~='table'and type(v)~='number'then if v:IsA
|
||||||
p)~='table'and type(p)~='number'then if p:IsA'TextLabel'or p:IsA'TextButton'then
|
'TextLabel'or v:IsA'TextButton'then if s then v.Position=v.Position-UDim2.new(0,
|
||||||
if m then p.Position=p.Position-UDim2.new(0,0,m,0)else if l==self.MessageQueue[n
|
0,s,0)else if r==q.MessageQueue[t]then v.Position=UDim2.new(q.Configuration.
|
||||||
]then p.Position=UDim2.new(self.Configuration.XScale,0,p.Position.Y.Scale-l[
|
XScale,0,v.Position.Y.Scale-r['Message'].Size.Y.Scale,0)Spawn(function()wait(
|
||||||
'Message'].Size.Y.Scale,0)Spawn(function()wait(0.05)while p.TextTransparency>=0
|
0.05)while v.TextTransparency>=0 do v.TextTransparency=v.TextTransparency-0.2
|
||||||
do p.TextTransparency=p.TextTransparency-0.2 wait(0.03)end if p==l['Message']
|
wait(0.03)end if v==r['Message']then v.TextStrokeTransparency=0.8 else v.
|
||||||
then p.TextStrokeTransparency=0.8 else p.TextStrokeTransparency=1 end end)else p
|
TextStrokeTransparency=1 end end)else v.Position=UDim2.new(q.Configuration.
|
||||||
.Position=UDim2.new(self.Configuration.XScale,0,p.Position.Y.Scale-l['Message'].
|
XScale,0,v.Position.Y.Scale-r['Message'].Size.Y.Scale,0)end if v.Position.Y.
|
||||||
Size.Y.Scale,0)end if p.Position.Y.Scale<-1E-2 then p.Visible=false p:Destroy()
|
Scale<-1E-2 then v.Visible=false v:Destroy()end end end end end end end end o.
|
||||||
end end end end end end end end function k:CreateScrollBar()end function k:
|
CreateScrollBar=function(q)end o.CheckIfInBounds=function(q,r)if#o.MessageQueue<
|
||||||
CheckIfInBounds(l)if#k.MessageQueue<3 then return true end if l>0 and k.
|
3 then return true end if r>0 and o.MessageQueue[1]and o.MessageQueue[1][
|
||||||
MessageQueue[1]and k.MessageQueue[1]['Player']and k.MessageQueue[1]['Player'].
|
'Player']and o.MessageQueue[1]['Player'].Position.Y.Scale==0 then return true
|
||||||
Position.Y.Scale==0 then return true elseif l<0 and k.MessageQueue[1]and k.
|
elseif r<0 and o.MessageQueue[1]and o.MessageQueue[1]['Player']and o.
|
||||||
MessageQueue[1]['Player']and k.MessageQueue[1]['Player'].Position.Y.Scale<0 then
|
MessageQueue[1]['Player'].Position.Y.Scale<0 then return true else return false
|
||||||
return true else return false end return false end function k:ComputeSpaceString
|
end end o.ComputeSpaceString=function(q,r)local s=' 'if not q.TempSpaceLabel
|
||||||
(l)local m=' 'if not self.TempSpaceLabel then self.TempSpaceLabel=d.Create
|
then q.TempSpaceLabel=g('TextButton','SpaceButton',{Size=UDim2.new(0,r.
|
||||||
'TextButton'{Size=UDim2.new(0,l.AbsoluteSize.X,0,l.AbsoluteSize.Y),FontSize=self
|
AbsoluteSize.X,0,r.AbsoluteSize.Y),FontSize=q.Configuration.FontSize,Parent=q.
|
||||||
.Configuration.FontSize,Parent=self.RenderFrame,BackgroundTransparency=1,Text=m,
|
RenderFrame,BackgroundTransparency=1,Text=s})else q.TempSpaceLabel.Text=s end
|
||||||
Name='SpaceButton'}else self.TempSpaceLabel.Text=m end while self.TempSpaceLabel
|
while q.TempSpaceLabel.TextBounds.X<r.TextBounds.X do s=s..' 'q.TempSpaceLabel.
|
||||||
.TextBounds.X<l.TextBounds.X do m=m..' 'self.TempSpaceLabel.Text=m end m=m..' '
|
Text=s end s=s..' 'q.CachedSpaceStrings_List[r.Text]=s q.TempSpaceLabel.Text=''
|
||||||
self.CachedSpaceStrings_List[l.Text]=m self.TempSpaceLabel.Text=''return m end
|
return s end o.UpdateChat=function(q,r,s)local t={Player=r,Message=s}if
|
||||||
function k:UpdateChat(l,m)local n={['Player']=l,['Message']=m}if coroutine.
|
coroutine.status(o.MessageThread)=='dead'then table.insert(o.Messages_List,t)o.
|
||||||
status(k.MessageThread)=='dead'then table.insert(k.Messages_List,n)k.
|
MessageThread=coroutine.create(function()for u=1,#o.Messages_List do local v=o.
|
||||||
MessageThread=coroutine.create(function()for o=1,#k.Messages_List do local p=k.
|
Messages_List[u]o:CreateMessage(v['Player'],v['Message'])end o.Messages_List={}
|
||||||
Messages_List[o]k:CreateMessage(p['Player'],p['Message'])end k.Messages_List={}
|
end)return coroutine.resume(o.MessageThread)else return table.insert(o.
|
||||||
end)coroutine.resume(k.MessageThread)else table.insert(k.Messages_List,n)end end
|
Messages_List,t)end end o.CreateMessage=function(q,r,s)local t if not r then t=
|
||||||
function k:RecalculateSpacing()end function k:CreateMessage(l,m)local n if not l
|
''else t=r.Name end s=d(s)local u,v if#q.MessageQueue>q.Configuration.
|
||||||
then n=''else n=l.Name end m=StringTrim(m)local o,p if#self.MessageQueue>self.
|
HistoryLength then q.MessageQueue[#q.MessageQueue]=nil end u=g('TextLabel',t,{
|
||||||
Configuration.HistoryLength then self.MessageQueue[#self.MessageQueue]=nil end o
|
Text=t..':',FontSize=o.Configuration.FontSize,TextXAlignment=Enum.TextXAlignment
|
||||||
=d.Create'TextLabel'{Name=n,Text=n..':',FontSize=k.Configuration.FontSize,
|
.Left,TextYAlignment=Enum.TextYAlignment.Top,Parent=q.RenderFrame,TextWrapped=
|
||||||
TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top,
|
false,Size=UDim2.new(1,0,0.1,0),BackgroundTransparency=1,TextTransparency=1,
|
||||||
Parent=self.RenderFrame,TextWrapped=false,Size=UDim2.new(1,0,0.1,0),
|
Position=UDim2.new(0,0,1,0),BorderSizePixel=0,TextStrokeColor3=Color3.new(0.5,
|
||||||
BackgroundTransparency=1,TextTransparency=1,Position=UDim2.new(0,0,1,0),
|
0.5,0.5),TextStrokeTransparency=0.75})if r.Neutral then u.TextColor3=o:
|
||||||
BorderSizePixel=0,TextStrokeColor3=Color3.new(0.5,0.5,0.5),
|
ComputeChatColor(t)else u.TextColor3=r.TeamColor.Color end local w if not q.
|
||||||
TextStrokeTransparency=0.75}if l.Neutral then o.TextColor3=k:ComputeChatColor(n)
|
CachedSpaceStrings_List[t]then w=o:ComputeSpaceString(u)else w=q.
|
||||||
else o.TextColor3=l.TeamColor.Color end local q if not self.
|
CachedSpaceStrings_List[t]end v=g('TextLabel',tostring(t)..' - message',{Size=
|
||||||
CachedSpaceStrings_List[n]then q=k:ComputeSpaceString(o)else q=self.
|
UDim2.new(1,0,0.5,0),TextColor3=o.Configuration.MessageColor,FontSize=o.
|
||||||
CachedSpaceStrings_List[n]end p=d.Create'TextLabel'{Name=n..' - message',Size=
|
|
||||||
UDim2.new(1,0,0.5,0),TextColor3=k.Configuration.MessageColor,FontSize=k.
|
|
||||||
Configuration.FontSize,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=
|
Configuration.FontSize,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=
|
||||||
Enum.TextYAlignment.Top,Text='',Parent=self.RenderFrame,TextWrapped=true,
|
Enum.TextYAlignment.Top,Text='',Parent=q.RenderFrame,TextWrapped=true,
|
||||||
BackgroundTransparency=1,TextTransparency=1,Position=UDim2.new(0,0,1,0),
|
BackgroundTransparency=1,TextTransparency=1,Position=UDim2.new(0,0,1,0),
|
||||||
BorderSizePixel=0,TextStrokeColor3=Color3.new(0,0,0)}p.Text=q..m if not n then o
|
BorderSizePixel=0,TextStrokeColor3=Color3.new(0,0,0)})v.Text=w..s if not t then
|
||||||
.Text=''p.TextColor3=Color3.new(0,0.4,1)end for r,s in pairs(self.Admins_List)do
|
u.Text=''v.TextColor3=Color3.new(0,0.4,1)end for x,y in pairs(q.Admins_List)do
|
||||||
if string.lower(s)==string.lower(n)then p.TextColor3=self.Configuration.
|
if string.lower(y)==string.lower(t)then v.TextColor3=q.Configuration.
|
||||||
AdminMessageColor end end o.Visible=true p.Visible=true local t=p.TextBounds.Y p
|
AdminMessageColor end end u.Visible=true v.Visible=true local z=v.TextBounds.Y v
|
||||||
.Size=UDim2.new(1,0,t/self.RenderFrame.AbsoluteSize.Y,0)o.Size=p.Size local u={}
|
.Size=UDim2.new(1,0,z/q.RenderFrame.AbsoluteSize.Y,0)u.Size=v.Size local A={}A[
|
||||||
u['Player']=o u['Message']=p u['SpawnTime']=tick()table.insert(self.MessageQueue
|
'Player']=u A['Message']=v A['SpawnTime']=tick()table.insert(q.MessageQueue,1,A)
|
||||||
,1,u)k:UpdateQueue(u)end function k:ScreenSizeChanged()wait()while self.Frame.
|
return o:UpdateQueue(A)end o.ScreenSizeChanged=function(q)wait()while q.Frame.
|
||||||
AbsoluteSize.Y>120 do self.Frame.Size=self.Frame.Size-UDim2.new(0,0,0.005,0)end
|
AbsoluteSize.Y>120 do q.Frame.Size=q.Frame.Size-UDim2.new(0,0,0.005,0)end end o.
|
||||||
k:RecalculateSpacing()end function k:FindButtonTree(l,m)local n={}m=m or self.
|
FindButtonTree=function(q,r,s)local t={}s=s or q.SafeChatTree for u,v in pairs(s
|
||||||
SafeChatTree for o,p in pairs(m)do if o==l then n=m[o]elseif type(m[o])=='table'
|
)do if u==r then t=s[u]elseif type(s[u])=='table'then t=o:FindButtonTree(r,s[u])
|
||||||
then n=k:FindButtonTree(l,m[o])end end return n end function k:
|
end end return t end o.ToggleSafeChatMenu=function(q,r)local s=o:FindButtonTree(
|
||||||
ToggleSafeChatMenu(l)local m=k:FindButtonTree(l,self.SafeChatTree)if m then for
|
r,q.SafeChatTree)if s then for t,u in pairs(s)do if t:IsA'TextButton'or t:IsA
|
||||||
n,o in pairs(m)do if n:IsA'TextButton'or n:IsA'ImageButton'then n.Visible=not n.
|
'ImageButton'then t.Visible=not t.Visible end end return true end return false
|
||||||
Visible end end return true end return false end function k:
|
end o.CreateSafeChatOptions=function(q,r,s)local t,u={},0 t[s]={}t[s][1]=r[1]s=s
|
||||||
CreateSafeChatOptions(l,m)local n,o={},0 n[m]={}n[m][1]=l[1]m=m or self.
|
or q.SafeChatButton for v,w in pairs(r)do if type(v)=='string'then local x=g(
|
||||||
SafeChatButton for p,q in pairs(l)do if type(p)=='string'then local r=d.Create
|
'TextButton',v,{Text=v,Size=UDim2.new(0,100,0,20),TextXAlignment=Enum.
|
||||||
'TextButton'{Name=p,Text=p,Size=UDim2.new(0,100,0,20),TextXAlignment=Enum.
|
|
||||||
TextXAlignment.Center,TextColor3=Color3.new(0.2,0.1,0.1),BackgroundTransparency=
|
TextXAlignment.Center,TextColor3=Color3.new(0.2,0.1,0.1),BackgroundTransparency=
|
||||||
0.5,BackgroundColor3=Color3.new(1,1,1),Parent=self.SafeChatFrame,Visible=false,
|
0.5,BackgroundColor3=Color3.new(1,1,1),Parent=q.SafeChatFrame,Visible=false,
|
||||||
Position=UDim2.new(0,m.Position.X.Scale+105,0,m.Position.Y.Scale-((o-3)*100))}o=
|
Position=UDim2.new(0,s.Position.X.Scale+105,0,s.Position.Y.Scale-(u-3)*100)})u=u
|
||||||
o+1 if type(l[p])=='table'then n[m][r]=k:CreateSafeChatOptions(l[p],r)end r.
|
+1 if type(r[v])=='table'then t[s][x]=o:CreateSafeChatOptions(r[v],x)end x.
|
||||||
MouseEnter:connect(function()k:ToggleSafeChatMenu(r)end)r.MouseLeave:connect(
|
MouseEnter:connect(function()return o:ToggleSafeChatMenu(x)end)x.MouseLeave:
|
||||||
function()k:ToggleSafeChatMenu(r)end)r.MouseButton1Click:connect(function()local
|
connect(function()return o:ToggleSafeChatMenu(x)end)x.MouseButton1Click:connect(
|
||||||
s=k:FindButtonTree(r)pcall(function()g:Chat(s[1])end)end)end end return n end
|
function()local y=o:FindButtonTree(x)return pcall(function()return i:Chat(y[1])
|
||||||
function k:CreateSafeChatGui()self.SafeChatFrame=d.Create'Frame'{Name=
|
end)end)end end return t end o.CreateSafeChatGui=function(q)q.SafeChatFrame=g(
|
||||||
'SafeChatFrame',Size=UDim2.new(1,0,1,0),Parent=self.Gui,BackgroundTransparency=1
|
'Frame','SafeChatFrame',{Size=UDim2.new(1,0,1,0),Parent=q.Gui,
|
||||||
,d.Create'ImageButton'{Name='SafeChatButton',Size=UDim2.new(0,44,0,31),Position=
|
BackgroundTransparency=1,g('ImageButton','SafeChatButton',{Size=UDim2.new(0,44,0
|
||||||
UDim2.new(0,1,0.35,0),BackgroundTransparency=1,Image=
|
,31),Position=UDim2.new(0,1,0.35,0),BackgroundTransparency=1,Image=
|
||||||
'http://www.roblox.com/asset/?id=97080365'}}self.SafeChatButton=self.
|
'http://www.roblox.com/asset/?id=97080365'})})q.SafeChatButton=q.SafeChatFrame.
|
||||||
SafeChatFrame.SafeChatButton self.SafeChatTree[self.SafeChatButton]=k:
|
SafeChatButton q.SafeChatTree[q.SafeChatButton]=o:CreateSafeChatOptions(q.
|
||||||
CreateSafeChatOptions(self.SafeChat_List,self.SafeChatButton)self.SafeChatButton
|
SafeChat_List,q.SafeChatButton)return q.SafeChatButton.MouseButton1Click:
|
||||||
.MouseButton1Click:connect(function()k:ToggleSafeChatMenu(self.SafeChatButton)
|
connect(function()return o:ToggleSafeChatMenu(q.SafeChatButton)end)end o.
|
||||||
end)end function k:FocusOnChatBar()if self.ClickToChatButton then self.
|
FocusOnChatBar=function(q)if q.ClickToChatButton then q.ClickToChatButton.
|
||||||
ClickToChatButton.Visible=false end self.GotFocus=true if self.Frame[
|
Visible=false end q.GotFocus=true if q.Frame['Background']then q.Frame.
|
||||||
'Background']then self.Frame.Background.Visible=false end self.ChatBar:
|
Background.Visible=false end return q.ChatBar:CaptureFocus()end o.
|
||||||
CaptureFocus()end function k:CreateTouchButton()self.ChatTouchFrame=d.Create
|
CreateTouchButton=function(q)q.ChatTouchFrame=g('Frame','ChatTouchFrame',{Size=
|
||||||
'Frame'{Name='ChatTouchFrame',Size=UDim2.new(0,128,0,32),Position=UDim2.new(0,88
|
UDim2.new(0,128,0,32),Position=UDim2.new(0,88,0,0),BackgroundTransparency=1,
|
||||||
,0,0),BackgroundTransparency=1,Parent=self.Gui,d.Create'ImageButton'{Name=
|
Parent=q.Gui,g('ImageButton','ChatLabel',{Size=UDim2.new(0,74,0,28),Position=
|
||||||
'ChatLabel',Size=UDim2.new(0,74,0,28),Position=UDim2.new(0,0,0,0),
|
UDim2.new(0,0,0,0),BackgroundTransparency=1,ZIndex=2}),g('ImageLabel',
|
||||||
BackgroundTransparency=1,ZIndex=2},d.Create'ImageLabel'{Name='Background',Size=
|
'Background',{Size=UDim2.new(1,0,1,0),Position=UDim2.new(0,0,0,0),
|
||||||
UDim2.new(1,0,1,0),Position=UDim2.new(0,0,0,0),BackgroundTransparency=1,Image=
|
BackgroundTransparency=1,Image='http://www.roblox.com/asset/?id=97078724'})})q.
|
||||||
'http://www.roblox.com/asset/?id=97078724'}}self.TapToChatLabel=self.
|
TapToChatLabel=q.ChatTouchFrame.ChatLabel q.TouchLabelBackground=q.
|
||||||
ChatTouchFrame.ChatLabel self.TouchLabelBackground=self.ChatTouchFrame.
|
ChatTouchFrame.Background q.ChatBar=g('TextBox','ChatBar',{Size=UDim2.new(1,0,
|
||||||
Background self.ChatBar=d.Create'TextBox'{Name='ChatBar',Size=UDim2.new(1,0,0.2,
|
0.2,0),Position=UDim2.new(0,0,0.8,800),Text='',ZIndex=1,BackgroundTransparency=1
|
||||||
0),Position=UDim2.new(0,0,0.8,800),Text='',ZIndex=1,BackgroundTransparency=1,
|
,Parent=q.Frame,TextXAlignment=Enum.TextXAlignment.Left,TextColor3=Color3.new(1,
|
||||||
Parent=self.Frame,TextXAlignment=Enum.TextXAlignment.Left,TextColor3=Color3.new(
|
1,1),ClearTextOnFocus=false})return q.TapToChatLabel.MouseButton1Click:connect(
|
||||||
1,1,1),ClearTextOnFocus=false}self.TapToChatLabel.MouseButton1Click:connect(
|
function()q.TapToChatLabel.Visible=false q.ChatBar:CaptureFocus()q.GotFocus=true
|
||||||
function()self.TapToChatLabel.Visible=false self.ChatBar:CaptureFocus()self.
|
if q.TouchLabelBackground then q.TouchLabelBackground.Visible=false end end)end
|
||||||
GotFocus=true if self.TouchLabelBackground then self.TouchLabelBackground.
|
o.CreateChatBar=function(q)local r,s r,s=pcall(function()return j.UseLuaChat end
|
||||||
Visible=false end end)end function k:CreateChatBar()local l,m=pcall(function()
|
)if a or(r and s)then q.ClickToChatButton=g('TextButton','ClickToChat',{Size=
|
||||||
return h.UseLuaChat end)if a or(l and m)then self.ClickToChatButton=d.Create
|
UDim2.new(1,0,0,20),BackgroundTransparency=1,ZIndex=2,Parent=q.Gui,Text=
|
||||||
'TextButton'{Name='ClickToChat',Size=UDim2.new(1,0,0,20),BackgroundTransparency=
|
'To chat click here or press "/" key',TextColor3=Color3.new(1,1,0.9),Position=
|
||||||
1,ZIndex=2,Parent=self.Gui,Text='To chat click here or press "/" key',TextColor3
|
UDim2.new(0,0,1,0),TextXAlignment=Enum.TextXAlignment.Left,FontSize=Enum.
|
||||||
=Color3.new(1,1,0.9),Position=UDim2.new(0,0,1,0),TextXAlignment=Enum.
|
FontSize.Size12})q.ChatBar=g('TextBox','ChatBar',{Size=UDim2.new(1,0,0,20),
|
||||||
TextXAlignment.Left,FontSize=Enum.FontSize.Size12}self.ChatBar=d.Create'TextBox'
|
Position=UDim2.new(0,0,1,0),Text='',ZIndex=1,BackgroundColor3=Color3.new(0,0,0),
|
||||||
{Name='ChatBar',Size=UDim2.new(1,0,0,20),Position=UDim2.new(0,0,1,0),Text='',
|
BackgroundTransparency=0.25,Parent=q.Gui,TextXAlignment=Enum.TextXAlignment.Left
|
||||||
ZIndex=1,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.25,Parent=
|
,TextColor3=Color3.new(1,1,1),FontSize=Enum.FontSize.Size12,ClearTextOnFocus=
|
||||||
self.Gui,TextXAlignment=Enum.TextXAlignment.Left,TextColor3=Color3.new(1,1,1),
|
false})local t,u t,u=pcall(function()return j:SetGlobalGuiInset(0,0,0,20)end)if
|
||||||
FontSize=Enum.FontSize.Size12,ClearTextOnFocus=false}local n,o=pcall(function()h
|
not t then j:SetGlobalSizeOffsetPixel(0,-20)end j:AddSpecialKey(Enum.SpecialKey.
|
||||||
:SetGlobalGuiInset(0,0,0,20)end)if not n then h:SetGlobalSizeOffsetPixel(0,-20)
|
ChatHotkey)j.SpecialKeyPressed:connect(function(v)if v==Enum.SpecialKey.
|
||||||
end h:AddSpecialKey(Enum.SpecialKey.ChatHotkey)h.SpecialKeyPressed:connect(
|
ChatHotkey then return o:FocusOnChatBar()end end)return q.ClickToChatButton.
|
||||||
function(p)if p==Enum.SpecialKey.ChatHotkey then k:FocusOnChatBar()end end)self.
|
MouseButton1Click:connect(function()return o:FocusOnChatBar()end)end end o.
|
||||||
ClickToChatButton.MouseButton1Click:connect(function()k:FocusOnChatBar()end)end
|
CreateGui=function(q)q.Gui=b(h,'RobloxGui')q.Frame=g('Frame','ChatFrame',{Size=
|
||||||
end function k:CreateGui()self.Gui=WaitForChild(f,'RobloxGui')self.Frame=d.
|
UDim2.new(0,500,0,120),Position=UDim2.new(0,0,0,5),BackgroundTransparency=1,
|
||||||
Create'Frame'{Name='ChatFrame',Size=UDim2.new(0,500,0,120),Position=UDim2.new(0,
|
ZIndex=0,Parent=q.Gui,Active=false,g('ImageLabel','Background',{Image=
|
||||||
0,0,5),BackgroundTransparency=1,ZIndex=0,Parent=self.Gui,Active=false,d.Create
|
'http://www.roblox.com/asset/?id=97120937',Size=UDim2.new(1.3,0,1.64,0),Position
|
||||||
'ImageLabel'{Name='Background',Image='http://www.roblox.com/asset/?id=97120937',
|
=UDim2.new(0,0,0,0),BackgroundTransparency=1,ZIndex=0,Visible=false}),g('Frame',
|
||||||
Size=UDim2.new(1.3,0,1.64,0),Position=UDim2.new(0,0,0,0),BackgroundTransparency=
|
'Border',{Size=UDim2.new(1,0,0,1),Position=UDim2.new(0,0,0.8,0),
|
||||||
1,ZIndex=0,Visible=false},d.Create'Frame'{Name='Border',Size=UDim2.new(1,0,0,1),
|
BackgroundTransparency=0,BackgroundColor3=Color3.new(0.9254901960784314,
|
||||||
Position=UDim2.new(0,0,0.8,0),BackgroundTransparency=0,BackgroundColor3=Color3.
|
0.9254901960784314,0.9254901960784314),BorderSizePixel=0,Visible=false}),g(
|
||||||
new(0.9254901960784314,0.9254901960784314,0.9254901960784314),BorderSizePixel=0,
|
'Frame','ChatRenderFrame',{Size=UDim2.new(1.02,0,1.01,0),Position=UDim2.new(0,0,
|
||||||
Visible=false},d.Create'Frame'{Name='ChatRenderFrame',Size=UDim2.new(1.02,0,1.01
|
0,0),BackgroundTransparency=1,ZIndex=0,Active=false})})Spawn(function()wait(0.5)
|
||||||
,0),Position=UDim2.new(0,0,0,0),BackgroundTransparency=1,ZIndex=0,Active=false}}
|
if c()then q.Frame.Size=UDim2.new(0,280,0,120)end end)q.RenderFrame=q.Frame.
|
||||||
Spawn(function()wait(0.5)if IsPhone()then self.Frame.Size=UDim2.new(0,280,0,120)
|
ChatRenderFrame if o:IsTouchDevice()then q.Frame.Position=q.Configuration.
|
||||||
end end)self.RenderFrame=self.Frame.ChatRenderFrame if k:IsTouchDevice()then
|
Position q.RenderFrame.Size=UDim2.new(1,0,1,0)elseif q.Frame.AbsoluteSize.Y>120
|
||||||
self.Frame.Position=self.Configuration.Position self.RenderFrame.Size=UDim2.new(
|
then o:ScreenSizeChanged()q.Gui.Changed:connect(function(r)if r=='AbsoluteSize'
|
||||||
1,0,1,0)elseif self.Frame.AbsoluteSize.Y>120 then k:ScreenSizeChanged()self.Gui.
|
then return o:ScreenSizeChanged()end end)end if a or e.ChatMode==Enum.ChatMode.
|
||||||
Changed:connect(function(l)if l=='AbsoluteSize'then k:ScreenSizeChanged()end end
|
TextAndMenu then if o:IsTouchDevice()then o:CreateTouchButton()else o:
|
||||||
)end if a or b.ChatMode==Enum.ChatMode.TextAndMenu then if k:IsTouchDevice()then
|
CreateChatBar()end if q.ChatBar then return q.ChatBar.FocusLost:connect(function
|
||||||
k:CreateTouchButton()else k:CreateChatBar()end if self.ChatBar then self.ChatBar
|
(r)o.GotFocus=false if o:IsTouchDevice()then q.ChatBar.Visible=false q.
|
||||||
.FocusLost:connect(function(l)k.GotFocus=false if k:IsTouchDevice()then self.
|
TapToChatLabel.Visible=true if q.TouchLabelBackground then q.
|
||||||
ChatBar.Visible=false self.TapToChatLabel.Visible=true if self.
|
TouchLabelBackground.Visible=true end end if r and q.ChatBar.Text~=''then local
|
||||||
TouchLabelBackground then self.TouchLabelBackground.Visible=true end end if l
|
s=q.ChatBar.Text if string.sub(q.ChatBar.Text,1,1)=='%'then s='(TEAM) '..
|
||||||
and self.ChatBar.Text~=''then local m=self.ChatBar.Text if string.sub(self.
|
tostring(string.sub(s,2,#s))pcall(function()return i:TeamChat(s)end)else pcall(
|
||||||
ChatBar.Text,1,1)=='%'then m='(TEAM) '..string.sub(m,2,#m)pcall(function()g:
|
function()return i:Chat(s)end)end if q.ClickToChatButton then q.
|
||||||
TeamChat(m)end)else pcall(function()g:Chat(m)end)end if self.ClickToChatButton
|
ClickToChatButton.Visible=true end q.ChatBar.Text=''end return Spawn(function()
|
||||||
then self.ClickToChatButton.Visible=true end self.ChatBar.Text=''end Spawn(
|
wait(5)if not o.GotFocus then o.Frame.Background.Visible=false end end)end)end
|
||||||
function()wait(5)if not k.GotFocus then k.Frame.Background.Visible=false end end
|
end end n.OnMouseScroll=function(q)Spawn(function()while n.Speed~=0 do if n.
|
||||||
)end)end end end function j:OnMouseScroll()Spawn(function()while j.Speed~=0 do
|
Speed>1 then while n.Speed>0 do n.Speed=n.Speed-1 wait(0.25)end elseif n.Speed<0
|
||||||
if j.Speed>1 then while j.Speed>0 do j.Speed=j.Speed-1 wait(0.25)end elseif j.
|
then while n.Speed<0 do n.Speed=n.Speed+1 wait(0.25)end end wait(0.03)end end)if
|
||||||
Speed<0 then while j.Speed<0 do j.Speed=j.Speed+1 wait(0.25)end end wait(0.03)
|
o:CheckIfInBounds(n.Speed)then return end return o:ScrollQueue()end n.ApplySpeed
|
||||||
end end)if k:CheckIfInBounds(j.Speed)then return end k:ScrollQueue()end function
|
=function(q,r)n.Speed=n.Speed+r if not q.Simulating then return n:OnMouseScroll(
|
||||||
j:ApplySpeed(l)j.Speed=j.Speed+l if not self.Simulating then j:OnMouseScroll()
|
)end end n.Initialize=function(q)q.Mouse.WheelBackward:connect(function()return
|
||||||
end end function j:Initialize()self.Mouse.WheelBackward:connect(function()j:
|
n:ApplySpeed(q.Configuration.DefaultSpeed)end)return q.Mouse.WheelForward:
|
||||||
ApplySpeed(self.Configuration.DefaultSpeed)end)self.Mouse.WheelForward:connect(
|
connect(function()return n:ApplySpeed(q.Configuration.DefaultSpeed)end)end o.
|
||||||
function()j:ApplySpeed(self.Configuration.DefaultSpeed)end)end function k:
|
FindMessageInSafeChat=function(q,r,s)local t=false for u,v in pairs(s)do if u==r
|
||||||
FindMessageInSafeChat(l,m)local n=false for o,p in pairs(m)do if o==l then
|
then return true end if type(s[u])=='table'then t=o:FindMessageInSafeChat(r,s[u]
|
||||||
return true end if type(m[o])=='table'then n=k:FindMessageInSafeChat(l,m[o])if n
|
)if t then return true end end end return t end o.PlayerChatted=function(q,...)
|
||||||
then return true end end end return n end function k:PlayerChatted(...)local l,m
|
local r,s,t={...},nil,nil if r[2]then s=r[2]end if r[3]then t=r[3]if string.sub(
|
||||||
,n={...},nil,nil if l[2]then m=l[2]end if l[3]then n=l[3]if string.sub(n,1,1)==
|
t,1,1)=='%'then t='(TEAM) '..tostring(string.sub(t,2,#t))end end if i.
|
||||||
'%'then n='(TEAM) '..string.sub(n,2,#n)end end if g.ClassicChat then if not(
|
ClassicChat then if not(string.sub(t,1,3)=='/e 'or string.sub(t,1,7)=='/emote ')
|
||||||
string.sub(n,1,3)=='/e 'or string.sub(n,1,7)=='/emote ')and(a or b.ChatMode==
|
and(a or e.ChatMode==Enum.ChatMode.TextAndMenu)or(e.ChatMode==Enum.ChatMode.Menu
|
||||||
Enum.ChatMode.TextAndMenu)or(b.ChatMode==Enum.ChatMode.Menu and string.sub(n,1,3
|
and string.sub(t,1,3)=='/sc')or o:FindMessageInSafeChat(t,q.SafeChat_List)then
|
||||||
)=='/sc')or(k:FindMessageInSafeChat(n,self.SafeChat_List))then k:UpdateChat(m,n)
|
return o:UpdateChat(s,t)end end end o.CullThread=function(q)while true do if#q.
|
||||||
end end end function k:CullThread()while true do if#self.MessageQueue>0 then for
|
MessageQueue>0 then for r,s in pairs(q.MessageQueue)do if s['SpawnTime']and s[
|
||||||
l,m in pairs(self.MessageQueue)do if m['SpawnTime']and m['Player']and m[
|
'Player']and s['Message']and tick()-s['SpawnTime']>q.Configuration.LifeTime then
|
||||||
'Message']and tick()-m['SpawnTime']>self.Configuration.LifeTime then m['Player']
|
s['Player'].Visible=false s['Message'].Visible=false end end end wait(5)end end
|
||||||
.Visible=false m['Message'].Visible=false end end end wait(5)end end function k:
|
o.LockAllFields=function(q,r)local s=r:GetChildren()for t=1,#s do s[t].
|
||||||
LockAllFields(l)local m=l:GetChildren()for n=1,#m do m[n].RobloxLocked=true if#m
|
RobloxLocked=true if#s[t]:GetChildren()>0 then o:LockAllFields(s[t])end end end
|
||||||
[n]:GetChildren()>0 then k:LockAllFields(m[n])end end end function k:
|
o.CoreGuiChanged=function(q,r,s)if r==Enum.CoreGuiType.Chat or r==Enum.
|
||||||
CoreGuiChanged(l,m)if l==Enum.CoreGuiType.Chat or l==Enum.CoreGuiType.All then
|
CoreGuiType.All then if q.Frame then q.Frame.Visible=s end if not o:
|
||||||
if self.Frame then self.Frame.Visible=m end if not k:IsTouchDevice()and self.
|
IsTouchDevice()and q.ChatBar then q.ChatBar.Visible=s return j:
|
||||||
ChatBar then self.ChatBar.Visible=m if m then h:SetGlobalGuiInset(0,0,0,20)else
|
SetGlobalGuiInset(0,0,0,(function()if s then return 20 else return 0 end end)())
|
||||||
h:SetGlobalGuiInset(0,0,0,0)end end end end function k:Initialize()k:CreateGui()
|
end end end o.Initialize=function(q)o:CreateGui()pcall(function()o:
|
||||||
pcall(function()k:CoreGuiChanged(Enum.CoreGuiType.Chat,Game.StarterGui:
|
CoreGuiChanged(Enum.CoreGuiType.Chat,Game.StarterGui:GetCoreGuiEnabled(Enum.
|
||||||
GetCoreGuiEnabled(Enum.CoreGuiType.Chat))Game.StarterGui.CoreGuiChangedSignal:
|
CoreGuiType.Chat))return Game.StarterGui.CoreGuiChangedSignal:connect(function(r
|
||||||
connect(function(l,m)k:CoreGuiChanged(l,m)end)end)self.EventListener=g.
|
,s)return o:CoreGuiChanged(r,s)end)end)q.EventListener=i.PlayerChatted:connect(
|
||||||
PlayerChatted:connect(function(...)k:PlayerChatted(...)end)self.MessageThread=
|
function(...)return o:PlayerChatted(...)end)q.MessageThread=coroutine.create(
|
||||||
coroutine.create(function()end)coroutine.resume(self.MessageThread)j:Initialize(
|
function()end)coroutine.resume(q.MessageThread)n:Initialize()i.ChildAdded:
|
||||||
)g.ChildAdded:connect(function()k.EventListener:disconnect()self.EventListener=g
|
connect(function()o.EventListener:disconnect()q.EventListener=i.PlayerChatted:
|
||||||
.PlayerChatted:connect(function(...)k:PlayerChatted(...)end)end)Spawn(function()
|
connect(function(...)return o:PlayerChatted(...)end)end)Spawn(function()return o
|
||||||
k:CullThread()end)self.Frame.RobloxLocked=true k:LockAllFields(self.Frame)self.
|
:CullThread()end)q.Frame.RobloxLocked=true o:LockAllFields(q.Frame)return q.
|
||||||
Frame.DescendantAdded:connect(function(l)k:LockAllFields(l)end)end k:Initialize(
|
Frame.DescendantAdded:connect(function(r)return o:LockAllFields(r)end)end return
|
||||||
)
|
o:Initialize()
|
||||||
|
|
@ -1,995 +0,0 @@
|
||||||
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
|
|
||||||
while not Game do
|
|
||||||
wait(0.1)
|
|
||||||
end
|
|
||||||
while not game:GetService("MarketplaceService") do
|
|
||||||
wait(0.1)
|
|
||||||
end
|
|
||||||
while not game:FindFirstChild("CoreGui") do
|
|
||||||
wait(0.1)
|
|
||||||
end
|
|
||||||
while not game.CoreGui:FindFirstChild("RobloxGui") do
|
|
||||||
wait(0.1)
|
|
||||||
end
|
|
||||||
local RbxUtility
|
|
||||||
local baseUrl = game:GetService("ContentProvider").BaseUrl:lower()
|
|
||||||
local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable
|
|
||||||
local checkingPlayerFunds = false
|
|
||||||
local openBCUpSellWindowConnection
|
|
||||||
local purchasingConsumable = false
|
|
||||||
local enableBrowserWindowClosedEvent = true
|
|
||||||
local openBuyCurrencyWindowConnection
|
|
||||||
local currentlyPrompting = false
|
|
||||||
local purchaseDialog
|
|
||||||
local tweenTime = 0.3
|
|
||||||
local showPosition = UDim2.new(0.5, -330, 0.5, -200)
|
|
||||||
local hidePosition = UDim2.new(0.5, -330, 1, 25)
|
|
||||||
local isSmallScreen
|
|
||||||
local spinning = false
|
|
||||||
local spinnerIcons
|
|
||||||
local smallScreenThreshold = 450
|
|
||||||
local assetUrls = { }
|
|
||||||
local assetUrl
|
|
||||||
assetUrl = function(str)
|
|
||||||
return "http://www.roblox.com/Asset/?id=" .. tostring(str)
|
|
||||||
end
|
|
||||||
local errorImageUrl = assetUrl("42557901")
|
|
||||||
table.insert(assetUrls, errorImageUrl)
|
|
||||||
local buyImageUrl = assetUrl("104651457")
|
|
||||||
table.insert(assetUrls, buyImageUrl)
|
|
||||||
local buyImageDownUrl = assetUrl("104651515")
|
|
||||||
table.insert(assetUrls, buyImageDownUrl)
|
|
||||||
local buyImageDisabledUrl = assetUrl("104651532")
|
|
||||||
table.insert(assetUrls, buyImageDisabledUrl)
|
|
||||||
local cancelButtonImageUrl = assetUrl("104651592")
|
|
||||||
table.insert(assetUrls, cancelButtonImageUrl)
|
|
||||||
local cancelButtonDownUrl = assetUrl("104651639")
|
|
||||||
table.insert(assetUrls, cancelButtonDownUrl)
|
|
||||||
local okButtonUrl = assetUrl("104651665")
|
|
||||||
table.insert(assetUrls, okButtonUrl)
|
|
||||||
local okButtonPressedrl = assetUrl("104651707")
|
|
||||||
table.insert(assetUrls, okButtonPressedrl)
|
|
||||||
local freeButtonImageUrl = assetUrl("104651733")
|
|
||||||
table.insert(assetUrls, freeButtonImageUrl)
|
|
||||||
local freeButtonImageDownUrl = assetUrl("104651761")
|
|
||||||
table.insert(assetUrls, freeButtonImageDownUrl)
|
|
||||||
local tixIcon = assetUrl("102481431")
|
|
||||||
table.insert(assetUrls, tixIcon)
|
|
||||||
local robuxIcon = assetUrl("102481419")
|
|
||||||
table.insert(assetUrls, robuxIcon)
|
|
||||||
local buyHeaderText = "Buy"
|
|
||||||
local takeHeaderText = "Take"
|
|
||||||
local buyFailedHeaderText = "An Error Occurred"
|
|
||||||
local errorPurchasesDisabledText = "in-game purchases are disabled"
|
|
||||||
local errorPurchasesUnknownText = "Roblox is performing maintenance"
|
|
||||||
local purchaseSucceededText = "Your purchase of itemName succeeded!"
|
|
||||||
local purchaseFailedText = "Your purchase of itemName failed because errorReason. Your account has not been charged. Please try again soon."
|
|
||||||
local productPurchaseText = "Would you like to buy 'itemName' for currencyType currencyAmount?"
|
|
||||||
local freeItemPurchaseText = "Would you like to take the assetType 'itemName' for FREE?"
|
|
||||||
local freeItemBalanceText = "Your balance of Robux or Tix will not be affected by this transaction."
|
|
||||||
local getSecureApiBaseUrl
|
|
||||||
getSecureApiBaseUrl = function()
|
|
||||||
local secureApiUrl = string.gsub(baseUrl, "http", "https")
|
|
||||||
secureApiUrl = string.gsub(secureApiUrl, "www", "api")
|
|
||||||
return secureApiUrl
|
|
||||||
end
|
|
||||||
local getRbxUtility
|
|
||||||
getRbxUtility = function()
|
|
||||||
if not RbxUtility then
|
|
||||||
RbxUtility = LoadLibrary("RbxUtility")
|
|
||||||
end
|
|
||||||
return RbxUtility
|
|
||||||
end
|
|
||||||
local preloadAssets
|
|
||||||
preloadAssets = function()
|
|
||||||
for i = 1, #assetUrls do
|
|
||||||
game:GetService("ContentProvider"):Preload(assetUrls[i])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local removeCurrentPurchaseInfo
|
|
||||||
removeCurrentPurchaseInfo = function()
|
|
||||||
currentAssetId = nil
|
|
||||||
currentCurrencyType = nil
|
|
||||||
currentCurrencyAmount = nil
|
|
||||||
currentEquipOnPurchase = nil
|
|
||||||
currentProductId = nil
|
|
||||||
currentProductInfo = nil
|
|
||||||
currentServerResponseTable = nil
|
|
||||||
checkingPlayerFunds = false
|
|
||||||
end
|
|
||||||
local hidePurchasing
|
|
||||||
hidePurchasing = function()
|
|
||||||
purchaseDialog.PurchasingFrame.Visible = false
|
|
||||||
spinning = false
|
|
||||||
end
|
|
||||||
local closePurchasePrompt
|
|
||||||
closePurchasePrompt = function()
|
|
||||||
return purchaseDialog:TweenPosition(hidePosition, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true, function()
|
|
||||||
game.GuiService:RemoveCenterDialog(purchaseDialog)
|
|
||||||
hidePurchasing()
|
|
||||||
purchaseDialog.Visible = false
|
|
||||||
currentlyPrompting = false
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
local setButtonsVisible
|
|
||||||
setButtonsVisible = function(...)
|
|
||||||
local args = {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
local argCount = select("#", ...)
|
|
||||||
local bodyFrameChildren = purchaseDialog.BodyFrame:GetChildren()
|
|
||||||
for i = 1, #bodyFrameChildren do
|
|
||||||
if bodyFrameChildren[i]:IsA("GuiButton") then
|
|
||||||
bodyFrameChildren[i].Visible = false
|
|
||||||
for j = 1, argCount do
|
|
||||||
if bodyFrameChildren[i] == args[j] then
|
|
||||||
bodyFrameChildren[i].Visible = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local signalPromptEnded
|
|
||||||
signalPromptEnded = function(isSuccess)
|
|
||||||
closePurchasePrompt()
|
|
||||||
if purchasingConsumable then
|
|
||||||
game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished(game.Players.LocalPlayer.userId, currentProductId, isSuccess)
|
|
||||||
else
|
|
||||||
game:GetService("MarketplaceService"):SignalPromptPurchaseFinished(game.Players.LocalPlayer, currentAssetId, isSuccess)
|
|
||||||
end
|
|
||||||
return removeCurrentPurchaseInfo()
|
|
||||||
end
|
|
||||||
local userPurchaseActionsEnded
|
|
||||||
userPurchaseActionsEnded = function(isSuccess)
|
|
||||||
checkingPlayerFunds = false
|
|
||||||
if isSuccess then
|
|
||||||
local newPurchasedSucceededText = string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"]))
|
|
||||||
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText
|
|
||||||
setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton)
|
|
||||||
return hidePurchasing()
|
|
||||||
else
|
|
||||||
return signalPromptEnded(isSuccess)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local isFreeItem
|
|
||||||
isFreeItem = function()
|
|
||||||
return currentProductInfo and currentProductInfo["IsForSale"] == true and currentProductInfo["IsPublicDomain"] == true
|
|
||||||
end
|
|
||||||
local setHeaderText
|
|
||||||
setHeaderText = function(text)
|
|
||||||
purchaseDialog.TitleLabel.Text = text
|
|
||||||
purchaseDialog.TitleBackdrop.Text = text
|
|
||||||
end
|
|
||||||
local assetTypeToString
|
|
||||||
assetTypeToString = function(assetType)
|
|
||||||
if 1 == assetType then
|
|
||||||
return "Image"
|
|
||||||
elseif 2 == assetType then
|
|
||||||
return "T-Shirt"
|
|
||||||
elseif 3 == assetType then
|
|
||||||
return "Audio"
|
|
||||||
elseif 4 == assetType then
|
|
||||||
return "Mesh"
|
|
||||||
elseif 5 == assetType then
|
|
||||||
return "Lua"
|
|
||||||
elseif 6 == assetType then
|
|
||||||
return "HTML"
|
|
||||||
elseif 7 == assetType then
|
|
||||||
return "Text"
|
|
||||||
elseif 8 == assetType then
|
|
||||||
return "Hat"
|
|
||||||
elseif 9 == assetType then
|
|
||||||
return "Place"
|
|
||||||
elseif 10 == assetType then
|
|
||||||
return "Model"
|
|
||||||
elseif 11 == assetType then
|
|
||||||
return "Shirt"
|
|
||||||
elseif 12 == assetType then
|
|
||||||
return "Pants"
|
|
||||||
elseif 13 == assetType then
|
|
||||||
return "Decal"
|
|
||||||
elseif 16 == assetType then
|
|
||||||
return "Avatar"
|
|
||||||
elseif 17 == assetType then
|
|
||||||
return "Head"
|
|
||||||
elseif 18 == assetType then
|
|
||||||
return "Face"
|
|
||||||
elseif 19 == assetType then
|
|
||||||
return "Gear"
|
|
||||||
elseif 21 == assetType then
|
|
||||||
return "Badge"
|
|
||||||
elseif 22 == assetType then
|
|
||||||
return "Group Emblem"
|
|
||||||
elseif 24 == assetType then
|
|
||||||
return "Animation"
|
|
||||||
elseif 25 == assetType then
|
|
||||||
return "Arms"
|
|
||||||
elseif 26 == assetType then
|
|
||||||
return "Legs"
|
|
||||||
elseif 27 == assetType then
|
|
||||||
return "Torso"
|
|
||||||
elseif 28 == assetType then
|
|
||||||
return "Right Arm"
|
|
||||||
elseif 29 == assetType then
|
|
||||||
return "Left Arm"
|
|
||||||
elseif 30 == assetType then
|
|
||||||
return "Left Leg"
|
|
||||||
elseif 31 == assetType then
|
|
||||||
return "Right Leg"
|
|
||||||
elseif 32 == assetType then
|
|
||||||
return "Package"
|
|
||||||
elseif 33 == assetType then
|
|
||||||
return "YouTube Video"
|
|
||||||
elseif 34 == assetType then
|
|
||||||
return "Game Pass"
|
|
||||||
elseif 0 == assetType then
|
|
||||||
return "Product"
|
|
||||||
else
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local currencyTypeToString
|
|
||||||
currencyTypeToString = function(currencyType)
|
|
||||||
if currencyType == Enum.CurrencyType.Tix then
|
|
||||||
return "Tix"
|
|
||||||
else
|
|
||||||
return "R$"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local updatePurchasePromptData
|
|
||||||
updatePurchasePromptData = function(_)
|
|
||||||
local newItemDescription = ""
|
|
||||||
if not currentProductId then
|
|
||||||
currentProductId = currentProductInfo["ProductId"]
|
|
||||||
end
|
|
||||||
if isFreeItem() then
|
|
||||||
newItemDescription = string.gsub(freeItemPurchaseText, "itemName", tostring(currentProductInfo["Name"]))
|
|
||||||
newItemDescription = string.gsub(newItemDescription, "assetType", tostring(assetTypeToString(currentProductInfo["AssetTypeId"])))
|
|
||||||
setHeaderText(takeHeaderText)
|
|
||||||
else
|
|
||||||
newItemDescription = string.gsub(productPurchaseText, "itemName", tostring(currentProductInfo["Name"]))
|
|
||||||
newItemDescription = string.gsub(newItemDescription, "currencyType", tostring(currencyTypeToString(currentCurrencyType)))
|
|
||||||
newItemDescription = string.gsub(newItemDescription, "currencyAmount", tostring(currentCurrencyAmount))
|
|
||||||
setHeaderText(buyHeaderText)
|
|
||||||
end
|
|
||||||
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newItemDescription
|
|
||||||
if purchasingConsumable then
|
|
||||||
purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl .. "thumbs/asset.ashx?assetid=" .. tostring(currentProductInfo["IconImageAssetId"]) .. "&x=100&y=100&format=png"
|
|
||||||
else
|
|
||||||
purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl .. "thumbs/asset.ashx?assetid=" .. tostring(currentAssetId) .. "&x=100&y=100&format=png"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local setCurrencyAmountAndType
|
|
||||||
setCurrencyAmountAndType = function(priceInRobux, priceInTix)
|
|
||||||
if currentCurrencyType == Enum.CurrencyType.Default or currentCurrencyType == Enum.CurrencyType.Robux then
|
|
||||||
if (priceInRobux ~= nil) and priceInRobux ~= 0 then
|
|
||||||
currentCurrencyAmount = priceInRobux
|
|
||||||
currentCurrencyType = Enum.CurrencyType.Robux
|
|
||||||
else
|
|
||||||
currentCurrencyAmount = priceInTix
|
|
||||||
currentCurrencyType = Enum.CurrencyType.Tix
|
|
||||||
end
|
|
||||||
elseif currentCurrencyType == Enum.CurrencyType.Tix then
|
|
||||||
if (priceInTix ~= nil) and priceInTix ~= 0 then
|
|
||||||
currentCurrencyAmount = priceInTix
|
|
||||||
currentCurrencyType = Enum.CurrencyType.Tix
|
|
||||||
else
|
|
||||||
currentCurrencyAmount = priceInRobux
|
|
||||||
currentCurrencyType = Enum.CurrencyType.Robux
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if not (currentCurrencyAmount ~= nil) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
local getPlayerBalance
|
|
||||||
getPlayerBalance = function()
|
|
||||||
local playerBalance
|
|
||||||
local success, errorCode
|
|
||||||
success, errorCode = pcall(function()
|
|
||||||
playerBalance = game:HttpGetAsync(tostring(getSecureApiBaseUrl()) .. "currency/balance")
|
|
||||||
end)
|
|
||||||
if not success then
|
|
||||||
print("Get player balance failed because", errorCode)
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
if playerBalance == "" then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
playerBalance = getRbxUtility().DecodeJSON(playerBalance)
|
|
||||||
return playerBalance
|
|
||||||
end
|
|
||||||
local membershipTypeToNumber
|
|
||||||
membershipTypeToNumber = function(membership)
|
|
||||||
if Enum.MembershipType.None == membership then
|
|
||||||
return 0
|
|
||||||
elseif Enum.MembershipType.BuildersClub == membership then
|
|
||||||
return 1
|
|
||||||
elseif Enum.MembershipType.TurboBuildersClub == membership then
|
|
||||||
return 2
|
|
||||||
elseif Enum.MembershipType.OutrageousBuildersClub == membership then
|
|
||||||
return 3
|
|
||||||
else
|
|
||||||
return -1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local openBuyCurrencyWindow
|
|
||||||
openBuyCurrencyWindow = function()
|
|
||||||
checkingPlayerFunds = true
|
|
||||||
return game:GetService("GuiService"):OpenBrowserWindow(tostring(baseUrl) .. "Upgrades/Robux.aspx")
|
|
||||||
end
|
|
||||||
local updateAfterBalanceText
|
|
||||||
updateAfterBalanceText = function(playerBalance, notRightBc)
|
|
||||||
if isFreeItem() then
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Text = freeItemBalanceText
|
|
||||||
return true, false
|
|
||||||
end
|
|
||||||
local keyWord
|
|
||||||
if currentCurrencyType == Enum.CurrencyType.Robux then
|
|
||||||
keyWord = "robux"
|
|
||||||
elseif currentCurrencyType == Enum.CurrencyType.Tix then
|
|
||||||
keyWord = "tickets"
|
|
||||||
end
|
|
||||||
if not keyWord then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local playerBalanceNumber = tonumber(playerBalance[keyWord])
|
|
||||||
if not playerBalanceNumber then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local afterBalanceNumber = playerBalanceNumber - currentCurrencyAmount
|
|
||||||
if not notRightBc then
|
|
||||||
if afterBalanceNumber < 0 and keyWord == "robux" then
|
|
||||||
if not (openBuyCurrencyWindowConnection ~= nil) then
|
|
||||||
openBuyCurrencyWindowConnection = purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(openBuyCurrencyWindow)
|
|
||||||
end
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " .. tostring(currencyTypeToString(currentCurrencyType)) .. " " .. tostring(-afterBalanceNumber) .. " more to buy this, click here to purchase more."
|
|
||||||
return true, true
|
|
||||||
elseif afterBalanceNumber < 0 and keyWord == "tickets" then
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " .. tostring(-afterBalanceNumber) .. " " .. tostring(currencyTypeToString(currentCurrencyType)) .. " more to buy this item."
|
|
||||||
return true, true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if openBuyCurrencyWindowConnection then
|
|
||||||
openBuyCurrencyWindowConnection:disconnect()
|
|
||||||
openBuyCurrencyWindowConnection = nil
|
|
||||||
end
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "Your balance after this transaction will be " .. tostring(currencyTypeToString(currentCurrencyType)) .. " " .. tostring(afterBalanceNumber) .. "."
|
|
||||||
return true, false
|
|
||||||
end
|
|
||||||
local canPurchaseItem
|
|
||||||
canPurchaseItem = function()
|
|
||||||
local playerOwnsAsset = false
|
|
||||||
local notRightBc = false
|
|
||||||
local descText
|
|
||||||
local success = false
|
|
||||||
if purchasingConsumable then
|
|
||||||
local currentProductInfoRaw
|
|
||||||
success = pcall(function()
|
|
||||||
currentProductInfoRaw = Game:HttpGetAsync(tostring(getSecureApiBaseUrl()) .. "marketplace/productDetails?productid=" .. tostring(currentProductId))
|
|
||||||
end)
|
|
||||||
if success then
|
|
||||||
currentProductInfo = getRbxUtility().DecodeJSON(currentProductInfoRaw)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
success = pcall(function()
|
|
||||||
currentProductInfo = game:GetService("MarketplaceService"):GetProductInfo(currentAssetId)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
if not (currentProductInfo ~= nil) or not success then
|
|
||||||
descText = "In-game sales are temporarily disabled. Please try again later."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
if not purchasingConsumable then
|
|
||||||
if not currentAssetId then
|
|
||||||
print("current asset id is nil, this should always have a value")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if currentAssetId <= 0 then
|
|
||||||
print("current asset id is negative, this should always be positive")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local success, errorCode
|
|
||||||
success, errorCode = pcall(function()
|
|
||||||
playerOwnsAsset = game:HttpGetAsync(getSecureApiBaseUrl() .. "ownership/hasAsset?userId=" .. tostring(game.Players.LocalPlayer.userId) .. "&assetId=" .. tostring(currentAssetId))
|
|
||||||
end)
|
|
||||||
if not success then
|
|
||||||
print("could not tell if player owns asset because", errorCode)
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if playerOwnsAsset == true or playerOwnsAsset == "true" then
|
|
||||||
descText = "You already own this item."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
end
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Visible = true
|
|
||||||
if type(currentProductInfo) ~= "table" then
|
|
||||||
currentProductInfo = getRbxUtility().DecodeJSON(currentProductInfo)
|
|
||||||
end
|
|
||||||
if not currentProductInfo then
|
|
||||||
descText = "Could not get product info. Please try again later."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
if currentProductInfo["IsForSale"] == false and currentProductInfo["IsPublicDomain"] == false then
|
|
||||||
descText = "This item is no longer for sale."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
if not setCurrencyAmountAndType(tonumber(currentProductInfo["PriceInRobux"]), tonumber(currentProductInfo["PriceInTickets"])) then
|
|
||||||
descText = "We could retrieve the price of the item correctly. Please try again later."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
local playerBalance = getPlayerBalance()
|
|
||||||
if not playerBalance then
|
|
||||||
descText = "Could not retrieve your balance. Please try again later."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
if tonumber(currentProductInfo["MinimumMembershipLevel"]) > membershipTypeToNumber(game.Players.LocalPlayer.MembershipType) then
|
|
||||||
notRightBc = true
|
|
||||||
end
|
|
||||||
local updatedBalance, insufficientFunds
|
|
||||||
updatedBalance, insufficientFunds = updateAfterBalanceText(playerBalance, notRightBc)
|
|
||||||
if notRightBc then
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Active = true
|
|
||||||
return true, insufficientFunds, notRightBc, false
|
|
||||||
end
|
|
||||||
if currentProductInfo["ContentRatingTypeId"] == 1 then
|
|
||||||
if game.Players.LocalPlayer:GetUnder13() then
|
|
||||||
descText = "Your account is under 13 so purchase of this item is not allowed."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if (currentProductInfo["IsLimited"] == true or currentProductInfo["IsLimitedUnique"] == true) and (currentProductInfo["Remaining"] == "" or currentProductInfo["Remaining"] == 0 or not (currentProductInfo["Remaining"] ~= nil)) then
|
|
||||||
descText = "All copies of this item have been sold out! Try buying from other users on the website."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
if not updatedBalance then
|
|
||||||
descText = "Could not update your balance. Please check back after some time."
|
|
||||||
return true, nil, nil, true, descText
|
|
||||||
end
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Active = true
|
|
||||||
return true, insufficientFunds
|
|
||||||
end
|
|
||||||
local doPlayerFundsCheck
|
|
||||||
doPlayerFundsCheck = function(checkIndefinitely)
|
|
||||||
if checkingPlayerFunds then
|
|
||||||
local canPurchase, insufficientFunds
|
|
||||||
canPurchase, insufficientFunds = canPurchaseItem()
|
|
||||||
if canPurchase and insufficientFunds then
|
|
||||||
local retries = 1000
|
|
||||||
while (retries > 0 or checkIndefinitely) and insufficientFunds and checkingPlayerFunds and canPurchase do
|
|
||||||
wait(1 / 10)
|
|
||||||
canPurchase, insufficientFunds = canPurchaseItem()
|
|
||||||
retries = retries - 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if canPurchase and not insufficientFunds then
|
|
||||||
return setButtonsVisible(purchaseDialog.BodyFrame.BuyButton, purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local openBCUpSellWindow
|
|
||||||
openBCUpSellWindow = function()
|
|
||||||
return Game:GetService("GuiService"):OpenBrowserWindow(tostring(baseUrl) .. "Upgrades/BuildersClubMemberships.aspx")
|
|
||||||
end
|
|
||||||
local doDeclinePurchase
|
|
||||||
doDeclinePurchase = function()
|
|
||||||
return userPurchaseActionsEnded(false)
|
|
||||||
end
|
|
||||||
local showPurchasePrompt
|
|
||||||
showPurchasePrompt = function()
|
|
||||||
local canPurchase, insufficientFunds, notRightBC, override, descText
|
|
||||||
canPurchase, insufficientFunds, notRightBC, override, descText = canPurchaseItem()
|
|
||||||
if canPurchase then
|
|
||||||
updatePurchasePromptData()
|
|
||||||
if override and descText then
|
|
||||||
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = descText
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Visible = false
|
|
||||||
end
|
|
||||||
game.GuiService:AddCenterDialog(purchaseDialog, Enum.CenterDialogType.ModalDialog, function()
|
|
||||||
purchaseDialog.Visible = true
|
|
||||||
if isFreeItem() then
|
|
||||||
setButtonsVisible(purchaseDialog.BodyFrame.FreeButton, purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton)
|
|
||||||
elseif notRightBC then
|
|
||||||
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade."
|
|
||||||
if not openBCUpSellWindowConnection then
|
|
||||||
openBCUpSellWindowConnection = purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(function()
|
|
||||||
if purchaseDialog.BodyFrame.AfterBalanceButton.Text == "You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade." then
|
|
||||||
return openBCUpSellWindow()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
setButtonsVisible(purchaseDialog.BodyFrame.BuyDisabledButton, purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton)
|
|
||||||
elseif insufficientFunds then
|
|
||||||
setButtonsVisible(purchaseDialog.BodyFrame.BuyDisabledButton, purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton)
|
|
||||||
elseif override then
|
|
||||||
setButtonsVisible(purchaseDialog.BodyFrame.BuyDisabledButton, purchaseDialog.BodyFrame.CancelButton)
|
|
||||||
else
|
|
||||||
setButtonsVisible(purchaseDialog.BodyFrame.BuyButton, purchaseDialog.BodyFrame.CancelButton)
|
|
||||||
end
|
|
||||||
purchaseDialog:TweenPosition(showPosition, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true)
|
|
||||||
if canPurchase and insufficientFunds and not enableBrowserWindowClosedEvent then
|
|
||||||
checkingPlayerFunds = true
|
|
||||||
return doPlayerFundsCheck(true)
|
|
||||||
end
|
|
||||||
end, function()
|
|
||||||
purchaseDialog.Visible = false
|
|
||||||
end)
|
|
||||||
return purchaseDialog
|
|
||||||
else
|
|
||||||
return doDeclinePurchase()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local getToolAssetID
|
|
||||||
getToolAssetID = function(assetID)
|
|
||||||
local newTool = game:GetService("InsertService"):LoadAsset(assetID)
|
|
||||||
if not newTool then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
if newTool:IsA("Tool") then
|
|
||||||
return newTool
|
|
||||||
end
|
|
||||||
local toolChildren = newTool:GetChildren()
|
|
||||||
for i = 1, #toolChildren do
|
|
||||||
if toolChildren[i]:IsA("Tool") then
|
|
||||||
return toolChildren[i]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
local purchaseFailed
|
|
||||||
purchaseFailed = function(inGamePurchasesDisabled)
|
|
||||||
local name = "Item"
|
|
||||||
if currentProductInfo then
|
|
||||||
name = currentProductInfo["Name"]
|
|
||||||
end
|
|
||||||
local newPurchasedFailedText = string.gsub(purchaseFailedText, "itemName", tostring(name))
|
|
||||||
if inGamePurchasesDisabled then
|
|
||||||
newPurchasedFailedText = string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesDisabledText))
|
|
||||||
else
|
|
||||||
newPurchasedFailedText = string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesUnknownText))
|
|
||||||
end
|
|
||||||
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedFailedText
|
|
||||||
purchaseDialog.BodyFrame.ItemPreview.Image = errorImageUrl
|
|
||||||
setButtonsVisible(purchaseDialog.BodyFrame.OkButton)
|
|
||||||
setHeaderText(buyFailedHeaderText)
|
|
||||||
return hidePurchasing()
|
|
||||||
end
|
|
||||||
local startSpinner
|
|
||||||
startSpinner = function()
|
|
||||||
spinning = true
|
|
||||||
return Spawn(function()
|
|
||||||
local spinPos = 0
|
|
||||||
while spinning do
|
|
||||||
local pos = 0
|
|
||||||
while pos < 8 do
|
|
||||||
spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset/?id=" .. (function()
|
|
||||||
if pos == spinPos or pos == (spinPos + 1) % 8 then
|
|
||||||
return "45880668"
|
|
||||||
else
|
|
||||||
return "45880710"
|
|
||||||
end
|
|
||||||
end)()
|
|
||||||
pos = pos + 1
|
|
||||||
end
|
|
||||||
spinPos = (spinPos + 1) % 8
|
|
||||||
wait(1 / 15)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
local showPurchasing
|
|
||||||
showPurchasing = function()
|
|
||||||
startSpinner()
|
|
||||||
purchaseDialog.PurchasingFrame.Visible = true
|
|
||||||
end
|
|
||||||
local currencyEnumToInt
|
|
||||||
currencyEnumToInt = function(currencyEnum)
|
|
||||||
if currencyEnum == Enum.CurrencyType.Robux or currencyEnum == Enum.CurrencyType.Default then
|
|
||||||
return 1
|
|
||||||
elseif currencyEnum == Enum.CurrencyType.Tix then
|
|
||||||
return 2
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local doAcceptPurchase
|
|
||||||
doAcceptPurchase = function(_)
|
|
||||||
showPurchasing()
|
|
||||||
local startTime = tick()
|
|
||||||
local response = "none"
|
|
||||||
local url
|
|
||||||
if purchasingConsumable then
|
|
||||||
url = getSecureApiBaseUrl() .. "marketplace/submitpurchase?productId=" .. tostring(currentProductId) .. "¤cyTypeId=" .. tostring(currencyEnumToInt(currentCurrencyType)) .. "&expectedUnitPrice=" .. tostring(currentCurrencyAmount) .. "&placeId=" .. tostring(Game.PlaceId)
|
|
||||||
else
|
|
||||||
url = getSecureApiBaseUrl() .. "marketplace/purchase?productId=" .. tostring(currentProductId) .. "¤cyTypeId=" .. tostring(currencyEnumToInt(currentCurrencyType)) .. "&purchasePrice=" .. tostring(currentCurrencyAmount) .. "&locationType=Game" .. "&locationId=" .. tostring(Game.PlaceId)
|
|
||||||
end
|
|
||||||
local success, reason
|
|
||||||
success, reason = pcall(function()
|
|
||||||
response = game:HttpPostAsync(url, "RobloxPurchaseRequest")
|
|
||||||
end)
|
|
||||||
print("doAcceptPurchase success from ypcall is ", success, "reason is", reason)
|
|
||||||
if (tick() - startTime) < 1 then
|
|
||||||
wait(1)
|
|
||||||
end
|
|
||||||
if response == "none" or not (response ~= nil) or response == "" then
|
|
||||||
print("did not get a proper response from web on purchase of", currentAssetId, currentProductId)
|
|
||||||
purchaseFailed()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
response = getRbxUtility().DecodeJSON(response)
|
|
||||||
if response then
|
|
||||||
if response["success"] == false then
|
|
||||||
if response["status"] ~= "AlreadyOwned" then
|
|
||||||
print("web return response of fail on purchase of", currentAssetId, currentProductId)
|
|
||||||
purchaseFailed(response["status"] == "EconomyDisabled")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
print("web return response of non parsable JSON on purchase of", currentAssetId)
|
|
||||||
purchaseFailed()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if currentEquipOnPurchase and success and currentAssetId and tonumber(currentProductInfo["AssetTypeId"]) == 19 then
|
|
||||||
local tool = getToolAssetID(tonumber(currentAssetId))
|
|
||||||
if tool then
|
|
||||||
tool.Parent = game.Players.LocalPlayer.Backpack
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if purchasingConsumable then
|
|
||||||
if not response["receipt"] then
|
|
||||||
print("tried to buy productId, but no receipt returned. productId was", currentProductId)
|
|
||||||
purchaseFailed()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
return Game:GetService("MarketplaceService"):SignalClientPurchaseSuccess(tostring(response["receipt"]), game.Players.LocalPlayer.userId, currentProductId)
|
|
||||||
else
|
|
||||||
return userPurchaseActionsEnded(success)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local createSpinner
|
|
||||||
createSpinner = function(size, position, parent)
|
|
||||||
local spinnerFrame = New("Frame", "Spinner", {
|
|
||||||
Size = size,
|
|
||||||
Position = position,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
ZIndex = 10,
|
|
||||||
Parent = parent
|
|
||||||
})
|
|
||||||
spinnerIcons = { }
|
|
||||||
local spinnerNum = 1
|
|
||||||
while spinnerNum <= 8 do
|
|
||||||
local spinnerImage = New("ImageLabel", "Spinner" .. tostring(spinnerNum), {
|
|
||||||
Size = UDim2.new(0, 16, 0, 16),
|
|
||||||
Position = UDim2.new(0.5 + 0.3 * math.cos(math.rad(45 * spinnerNum)), -8, 0.5 + 0.3 * math.sin(math.rad(45 * spinnerNum)), -8),
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
ZIndex = 10,
|
|
||||||
Image = "http://www.roblox.com/Asset/?id=45880710",
|
|
||||||
Parent = spinnerFrame
|
|
||||||
})
|
|
||||||
spinnerIcons[spinnerNum] = spinnerImage
|
|
||||||
spinnerNum = spinnerNum + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local createTextObject
|
|
||||||
createTextObject = function(name, text, type, size)
|
|
||||||
return New(type, name, {
|
|
||||||
Font = Enum.Font.ArialBold,
|
|
||||||
TextColor3 = Color3.new(217 / 255, 217 / 255, 217 / 255),
|
|
||||||
TextWrapped = true,
|
|
||||||
Text = text,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
BorderSizePixel = 0,
|
|
||||||
FontSize = size
|
|
||||||
})
|
|
||||||
end
|
|
||||||
local createImageButton
|
|
||||||
createImageButton = function(name)
|
|
||||||
return New("ImageButton", name, {
|
|
||||||
Size = UDim2.new(0, 153, 0, 46),
|
|
||||||
Name = name
|
|
||||||
})
|
|
||||||
end
|
|
||||||
local userPurchaseProductActionsEnded
|
|
||||||
userPurchaseProductActionsEnded = function(userIsClosingDialog)
|
|
||||||
checkingPlayerFunds = false
|
|
||||||
if userIsClosingDialog then
|
|
||||||
closePurchasePrompt()
|
|
||||||
if currentServerResponseTable then
|
|
||||||
local isPurchased = false
|
|
||||||
if (tostring(currentServerResponseTable["isValid"])):lower() == "true" then
|
|
||||||
isPurchased = true
|
|
||||||
end
|
|
||||||
Game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished(tonumber(currentServerResponseTable["playerId"]), tonumber(currentServerResponseTable["productId"]), isPurchased)
|
|
||||||
else
|
|
||||||
print("Something went wrong, no currentServerResponseTable")
|
|
||||||
end
|
|
||||||
return removeCurrentPurchaseInfo()
|
|
||||||
else
|
|
||||||
local newPurchasedSucceededText = string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"]))
|
|
||||||
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText
|
|
||||||
setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton)
|
|
||||||
return hidePurchasing()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local createPurchasePromptGui
|
|
||||||
createPurchasePromptGui = function()
|
|
||||||
purchaseDialog = New("Frame", "PurchaseFrame", {
|
|
||||||
Size = UDim2.new(0, 660, 0, 400),
|
|
||||||
Position = hidePosition,
|
|
||||||
Visible = false,
|
|
||||||
BackgroundColor3 = Color3.new(141 / 255, 141 / 255, 141 / 255),
|
|
||||||
BorderColor3 = Color3.new(204 / 255, 204 / 255, 204 / 255),
|
|
||||||
Parent = game.CoreGui.RobloxGui,
|
|
||||||
New("Frame", "BodyFrame", {
|
|
||||||
Size = UDim2.new(1, 0, 1, -60),
|
|
||||||
Position = UDim2.new(0, 0, 0, 60),
|
|
||||||
BackgroundColor3 = Color3.new(67 / 255, 67 / 255, 67 / 255),
|
|
||||||
BorderSizePixel = 0,
|
|
||||||
ZIndex = 8
|
|
||||||
})
|
|
||||||
})
|
|
||||||
local bodyFrame = purchaseDialog.BodyFrame
|
|
||||||
do
|
|
||||||
local _with_0 = createTextObject("TitleLabel", "Buy Item", "TextLabel", Enum.FontSize.Size48)
|
|
||||||
_with_0.ZIndex = 8
|
|
||||||
_with_0.Size = UDim2.new(1, 0, 0, 60)
|
|
||||||
do
|
|
||||||
local _with_1 = _with_0:Clone()
|
|
||||||
_with_1.Name = "TitleBackdrop"
|
|
||||||
_with_1.TextColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255)
|
|
||||||
_with_1.BackgroundTransparency = 0.0
|
|
||||||
_with_1.BackgroundColor3 = Color3.new(54 / 255, 96 / 255, 171 / 255)
|
|
||||||
_with_1.Position = UDim2.new(0, 0, 0, -2)
|
|
||||||
_with_1.ZIndex = 8
|
|
||||||
_with_1.Parent = purchaseDialog
|
|
||||||
end
|
|
||||||
_with_0.Parent = purchaseDialog
|
|
||||||
end
|
|
||||||
local distanceBetweenButtons = 90
|
|
||||||
do
|
|
||||||
local _with_0 = createImageButton("CancelButton")
|
|
||||||
_with_0.Position = UDim2.new(0.5, distanceBetweenButtons / 2, 1, -120)
|
|
||||||
_with_0.BackgroundTransparency = 1
|
|
||||||
_with_0.BorderSizePixel = 0
|
|
||||||
_with_0.Parent = bodyFrame
|
|
||||||
_with_0.Modal = true
|
|
||||||
_with_0.ZIndex = 8
|
|
||||||
_with_0.Image = cancelButtonImageUrl
|
|
||||||
_with_0.MouseButton1Down:connect(function()
|
|
||||||
_with_0.Image = cancelButtonDownUrl
|
|
||||||
end)
|
|
||||||
_with_0.MouseButton1Up:connect(function()
|
|
||||||
_with_0.Image = cancelButtonImageUrl
|
|
||||||
end)
|
|
||||||
_with_0.MouseLeave:connect(function()
|
|
||||||
_with_0.Image = cancelButtonImageUrl
|
|
||||||
end)
|
|
||||||
_with_0.MouseButton1Click:connect(doDeclinePurchase)
|
|
||||||
end
|
|
||||||
local buyButton = createImageButton("BuyButton")
|
|
||||||
buyButton.Position = UDim2.new(0.5, -153 - (distanceBetweenButtons / 2), 1, -120)
|
|
||||||
buyButton.BackgroundTransparency = 1
|
|
||||||
buyButton.BorderSizePixel = 0
|
|
||||||
buyButton.Image = buyImageUrl
|
|
||||||
buyButton.ZIndex = 8
|
|
||||||
buyButton.MouseButton1Down:connect(function()
|
|
||||||
buyButton.Image = buyImageDownUrl
|
|
||||||
end)
|
|
||||||
buyButton.MouseButton1Up:connect(function()
|
|
||||||
buyButton.Image = buyImageUrl
|
|
||||||
end)
|
|
||||||
buyButton.MouseLeave:connect(function()
|
|
||||||
buyButton.Image = buyImageUrl
|
|
||||||
end)
|
|
||||||
buyButton.Parent = bodyFrame
|
|
||||||
do
|
|
||||||
local _with_0 = buyButton:Clone()
|
|
||||||
_with_0.Name = "BuyDisabledButton"
|
|
||||||
_with_0.AutoButtonColor = false
|
|
||||||
_with_0.Visible = false
|
|
||||||
_with_0.Active = false
|
|
||||||
_with_0.Image = buyImageDisabledUrl
|
|
||||||
_with_0.ZIndex = 8
|
|
||||||
_with_0.Parent = bodyFrame
|
|
||||||
end
|
|
||||||
local freeButton = buyButton:Clone()
|
|
||||||
freeButton.BackgroundTransparency = 1
|
|
||||||
freeButton.Name = "FreeButton"
|
|
||||||
freeButton.Visible = false
|
|
||||||
freeButton.ZIndex = 8
|
|
||||||
freeButton.Image = freeButtonImageUrl
|
|
||||||
freeButton.MouseButton1Down:connect(function()
|
|
||||||
freeButton.Image = freeButtonImageDownUrl
|
|
||||||
end)
|
|
||||||
freeButton.MouseButton1Up:connect(function()
|
|
||||||
freeButton.Image = freeButtonImageUrl
|
|
||||||
end)
|
|
||||||
freeButton.MouseLeave:connect(function()
|
|
||||||
freeButton.Image = freeButtonImageUrl
|
|
||||||
end)
|
|
||||||
freeButton.Parent = bodyFrame
|
|
||||||
local okButton = buyButton:Clone()
|
|
||||||
okButton.Name = "OkButton"
|
|
||||||
okButton.BackgroundTransparency = 1
|
|
||||||
okButton.Visible = false
|
|
||||||
okButton.Position = UDim2.new(0.5, -okButton.Size.X.Offset / 2, 1, -120)
|
|
||||||
okButton.Modal = true
|
|
||||||
okButton.Image = okButtonUrl
|
|
||||||
okButton.ZIndex = 8
|
|
||||||
okButton.MouseButton1Down:connect(function()
|
|
||||||
okButton.Image = okButtonPressedrl
|
|
||||||
end)
|
|
||||||
okButton.MouseButton1Up:connect(function()
|
|
||||||
okButton.Image = okButtonUrl
|
|
||||||
end)
|
|
||||||
okButton.MouseLeave:connect(function()
|
|
||||||
okButton.Image = okButtonUrl
|
|
||||||
end)
|
|
||||||
okButton.Parent = bodyFrame
|
|
||||||
do
|
|
||||||
local _with_0 = okButton:Clone()
|
|
||||||
_with_0.ZIndex = 8
|
|
||||||
_with_0.Name = "OkPurchasedButton"
|
|
||||||
_with_0.MouseButton1Down:connect(function()
|
|
||||||
_with_0.Image = okButtonPressedrl
|
|
||||||
end)
|
|
||||||
_with_0.MouseButton1Up:connect(function()
|
|
||||||
_with_0.Image = okButtonUrl
|
|
||||||
end)
|
|
||||||
_with_0.MouseLeave:connect(function()
|
|
||||||
_with_0.Image = okButtonUrl
|
|
||||||
end)
|
|
||||||
_with_0.Parent = bodyFrame
|
|
||||||
_with_0.MouseButton1Click:connect(function()
|
|
||||||
if purchasingConsumable then
|
|
||||||
return userPurchaseProductActionsEnded(true)
|
|
||||||
else
|
|
||||||
return signalPromptEnded(true)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
okButton.MouseButton1Click:connect(function()
|
|
||||||
return userPurchaseActionsEnded(false)
|
|
||||||
end)
|
|
||||||
buyButton.MouseButton1Click:connect(function()
|
|
||||||
return doAcceptPurchase(Enum.CurrencyType.Robux)
|
|
||||||
end)
|
|
||||||
freeButton.MouseButton1Click:connect(function()
|
|
||||||
return doAcceptPurchase(false)
|
|
||||||
end)
|
|
||||||
local itemPreview = New("ImageLabel", "ItemPreview", {
|
|
||||||
BackgroundColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255),
|
|
||||||
BorderColor3 = Color3.new(141 / 255, 141 / 255, 141 / 255),
|
|
||||||
Position = UDim2.new(0, 30, 0, 20),
|
|
||||||
Size = UDim2.new(0, 180, 0, 180),
|
|
||||||
ZIndex = 9,
|
|
||||||
Parent = bodyFrame
|
|
||||||
})
|
|
||||||
do
|
|
||||||
local _with_0 = createTextObject("ItemDescription", "Would you like to buy the 'itemName' for currencyType currencyAmount?", "TextLabel", Enum.FontSize.Size24)
|
|
||||||
_with_0.Position = UDim2.new(1, 20, 0, 0)
|
|
||||||
_with_0.Size = UDim2.new(0, 410, 1, 0)
|
|
||||||
_with_0.ZIndex = 8
|
|
||||||
_with_0.Parent = itemPreview
|
|
||||||
end
|
|
||||||
do
|
|
||||||
local _with_0 = createTextObject("AfterBalanceButton", "Place holder text ip sum lorem dodo ashs", "TextButton", Enum.FontSize.Size24)
|
|
||||||
_with_0.AutoButtonColor = false
|
|
||||||
_with_0.TextColor3 = Color3.new(222 / 255, 59 / 255, 30 / 255)
|
|
||||||
_with_0.Position = UDim2.new(0, 5, 1, -55)
|
|
||||||
_with_0.Size = UDim2.new(1, -10, 0, 50)
|
|
||||||
_with_0.ZIndex = 8
|
|
||||||
_with_0.Parent = bodyFrame
|
|
||||||
end
|
|
||||||
local purchasingFrame = New("Frame", "PurchasingFrame", {
|
|
||||||
Size = UDim2.new(1, 0, 1, 0),
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.2,
|
|
||||||
BorderSizePixel = 0,
|
|
||||||
ZIndex = 9,
|
|
||||||
Visible = false,
|
|
||||||
Active = true,
|
|
||||||
Parent = purchaseDialog
|
|
||||||
})
|
|
||||||
local purchasingLabel = createTextObject("PurchasingLabel", "Purchasing...", "TextLabel", Enum.FontSize.Size48)
|
|
||||||
purchasingLabel.Size = UDim2.new(1, 0, 1, 0)
|
|
||||||
purchasingLabel.ZIndex = 10
|
|
||||||
purchasingLabel.Parent = purchasingFrame
|
|
||||||
return createSpinner(UDim2.new(0, 50, 0, 50), UDim2.new(0.5, -25, 0.5, 30), purchasingLabel)
|
|
||||||
end
|
|
||||||
local cutSizeInHalfRecursive
|
|
||||||
cutSizeInHalfRecursive = function(_) end
|
|
||||||
local doubleSizeRecursive
|
|
||||||
doubleSizeRecursive = function(_) end
|
|
||||||
local changeGuiToScreenSize
|
|
||||||
changeGuiToScreenSize = function(smallScreen)
|
|
||||||
if smallScreen then
|
|
||||||
return cutSizeInHalfRecursive(purchaseDialog)
|
|
||||||
else
|
|
||||||
return doubleSizeRecursive(purchaseDialog)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local doPurchasePrompt
|
|
||||||
doPurchasePrompt = function(player, assetId, equipIfPurchased, currencyType, productId)
|
|
||||||
if not purchaseDialog then
|
|
||||||
createPurchasePromptGui()
|
|
||||||
end
|
|
||||||
if player == game.Players.LocalPlayer then
|
|
||||||
if currentlyPrompting then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
currentlyPrompting = true
|
|
||||||
currentAssetId = assetId
|
|
||||||
currentProductId = productId
|
|
||||||
currentCurrencyType = currencyType
|
|
||||||
currentEquipOnPurchase = equipIfPurchased
|
|
||||||
purchasingConsumable = (currentProductId ~= nil)
|
|
||||||
return showPurchasePrompt()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local doProcessServerPurchaseResponse
|
|
||||||
doProcessServerPurchaseResponse = function(serverResponseTable)
|
|
||||||
if not serverResponseTable then
|
|
||||||
print("Server response table was nil, cancelling purchase")
|
|
||||||
purchaseFailed()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if serverResponseTable["playerId"] and tonumber(serverResponseTable["playerId"]) == game.Players.LocalPlayer.userId then
|
|
||||||
currentServerResponseTable = serverResponseTable
|
|
||||||
return userPurchaseProductActionsEnded(false)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
preloadAssets()
|
|
||||||
game:GetService("MarketplaceService").PromptProductPurchaseRequested:connect(function(player, productId, equipIfPurchased, currencyType)
|
|
||||||
return doPurchasePrompt(player, nil, equipIfPurchased, currencyType, productId)
|
|
||||||
end)
|
|
||||||
Game:GetService("MarketplaceService").PromptPurchaseRequested:connect(function(player, assetId, equipIfPurchased, currencyType)
|
|
||||||
return doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, nil)
|
|
||||||
end)
|
|
||||||
Game:GetService("MarketplaceService").ServerPurchaseVerification:connect(function(serverResponseTable)
|
|
||||||
return doProcessServerPurchaseResponse(serverResponseTable)
|
|
||||||
end)
|
|
||||||
if enableBrowserWindowClosedEvent then
|
|
||||||
Game:GetService("GuiService").BrowserWindowClosed:connect(function()
|
|
||||||
return doPlayerFundsCheck(false)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
Game.CoreGui.RobloxGui.Changed:connect(function()
|
|
||||||
local nowIsSmallScreen = game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
|
|
||||||
if nowIsSmallScreen and not isSmallScreen then
|
|
||||||
changeGuiToScreenSize(true)
|
|
||||||
elseif not nowIsSmallScreen and isSmallScreen then
|
|
||||||
changeGuiToScreenSize(false)
|
|
||||||
end
|
|
||||||
isSmallScreen = nowIsSmallScreen
|
|
||||||
end)
|
|
||||||
isSmallScreen = game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
|
|
||||||
if isSmallScreen then
|
|
||||||
return changeGuiToScreenSize(true)
|
|
||||||
end
|
|
||||||
|
|
@ -1,245 +0,0 @@
|
||||||
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,526 +0,0 @@
|
||||||
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()
|
|
||||||
|
|
@ -1,834 +0,0 @@
|
||||||
local Create = assert(LoadLibrary("RbxUtility")).Create
|
|
||||||
local gui = script.Parent:FindFirstChild("ControlFrame") or script.Parent
|
|
||||||
local Dev_Container = Create("Frame")({
|
|
||||||
Name = "DevConsoleContainer",
|
|
||||||
Parent = gui,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.9,
|
|
||||||
Position = UDim2.new(0, 100, 0, 10),
|
|
||||||
Size = UDim2.new(0.5, 20, 0.5, 20),
|
|
||||||
Visible = false
|
|
||||||
})
|
|
||||||
local ToggleConsole = Create("BindableFunction")({
|
|
||||||
Name = "ToggleDevConsole",
|
|
||||||
Parent = gui
|
|
||||||
})
|
|
||||||
local devConsoleInitialized = false
|
|
||||||
local initializeDeveloperConsole
|
|
||||||
initializeDeveloperConsole = function()
|
|
||||||
if devConsoleInitialized then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
devConsoleInitialized = true
|
|
||||||
local LOCAL_CONSOLE = 1
|
|
||||||
local SERVER_CONSOLE = 2
|
|
||||||
local MAX_LIST_SIZE = 1000
|
|
||||||
local minimumSize = Vector2.new(245, 180)
|
|
||||||
local currentConsole = LOCAL_CONSOLE
|
|
||||||
local localMessageList = { }
|
|
||||||
local serverMessageList = { }
|
|
||||||
local localOffset = 0
|
|
||||||
local serverOffset = 0
|
|
||||||
local errorToggleOn = true
|
|
||||||
local warningToggleOn = true
|
|
||||||
local infoToggleOn = true
|
|
||||||
local outputToggleOn = true
|
|
||||||
local wordWrapToggleOn = false
|
|
||||||
local textHolderSize = 0
|
|
||||||
local frameNumber = 0
|
|
||||||
local Dev_Body = Create("Frame")({
|
|
||||||
Name = "Body",
|
|
||||||
Parent = Dev_Container,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.5,
|
|
||||||
Position = UDim2.new(0, 0, 0, 21),
|
|
||||||
Size = UDim2.new(1, 0, 1, -25)
|
|
||||||
})
|
|
||||||
local Dev_OptionsHolder = Create("Frame")({
|
|
||||||
Name = "OptionsHolder",
|
|
||||||
Parent = Dev_Body,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 220, 0, 0),
|
|
||||||
Size = UDim2.new(1, -255, 0, 24),
|
|
||||||
ClipsDescendants = true
|
|
||||||
})
|
|
||||||
local Dev_OptionsBar = Create("Frame")({
|
|
||||||
Name = "OptionsBar",
|
|
||||||
Parent = Dev_OptionsHolder,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, -250, 0, 4),
|
|
||||||
Size = UDim2.new(0, 234, 0, 18)
|
|
||||||
})
|
|
||||||
local Dev_ErrorToggleFilter = Create("TextButton")({
|
|
||||||
Name = "ErrorToggleButton",
|
|
||||||
Parent = Dev_OptionsBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BorderColor3 = Color3.new(1, 0, 0),
|
|
||||||
Position = UDim2.new(0, 115, 0, 0),
|
|
||||||
Size = UDim2.new(0, 18, 0, 18),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "",
|
|
||||||
TextColor3 = Color3.new(1, 0, 0)
|
|
||||||
})
|
|
||||||
Create("Frame")({
|
|
||||||
Name = "CheckFrame",
|
|
||||||
Parent = Dev_ErrorToggleFilter,
|
|
||||||
BackgroundColor3 = Color3.new(1, 0, 0),
|
|
||||||
BorderColor3 = Color3.new(1, 0, 0),
|
|
||||||
Position = UDim2.new(0, 4, 0, 4),
|
|
||||||
Size = UDim2.new(0, 10, 0, 10)
|
|
||||||
})
|
|
||||||
local Dev_InfoToggleFilter = Create("TextButton")({
|
|
||||||
Name = "InfoToggleButton",
|
|
||||||
Parent = Dev_OptionsBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BorderColor3 = Color3.new(0.4, 0.5, 1.0),
|
|
||||||
Position = UDim2.new(0, 65, 0, 0),
|
|
||||||
Size = UDim2.new(0, 18, 0, 18),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "",
|
|
||||||
TextColor3 = Color3.new(0.4, 0.5, 1.0)
|
|
||||||
})
|
|
||||||
Create("Frame")({
|
|
||||||
Name = "CheckFrame",
|
|
||||||
Parent = Dev_InfoToggleFilter,
|
|
||||||
BackgroundColor3 = Color3.new(0.4, 0.5, 1.0),
|
|
||||||
BorderColor3 = Color3.new(0.4, 0.5, 1.0),
|
|
||||||
Position = UDim2.new(0, 4, 0, 4),
|
|
||||||
Size = UDim2.new(0, 10, 0, 10)
|
|
||||||
})
|
|
||||||
local Dev_OutputToggleFilter = Create("TextButton")({
|
|
||||||
Name = "OutputToggleButton",
|
|
||||||
Parent = Dev_OptionsBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BorderColor3 = Color3.new(1, 1, 1.0),
|
|
||||||
Position = UDim2.new(0, 40, 0, 0),
|
|
||||||
Size = UDim2.new(0, 18, 0, 18),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "",
|
|
||||||
TextColor3 = Color3.new(1, 1, 1.0)
|
|
||||||
})
|
|
||||||
Create("Frame")({
|
|
||||||
Name = "CheckFrame",
|
|
||||||
Parent = Dev_OutputToggleFilter,
|
|
||||||
BackgroundColor3 = Color3.new(1, 1, 1.0),
|
|
||||||
BorderColor3 = Color3.new(1, 1, 1.0),
|
|
||||||
Position = UDim2.new(0, 4, 0, 4),
|
|
||||||
Size = UDim2.new(0, 10, 0, 10)
|
|
||||||
})
|
|
||||||
local Dev_WarningToggleFilter = Create("TextButton")({
|
|
||||||
Name = "WarningToggleButton",
|
|
||||||
Parent = Dev_OptionsBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BorderColor3 = Color3.new(1, 0.6, 0.4),
|
|
||||||
Position = UDim2.new(0, 90, 0, 0),
|
|
||||||
Size = UDim2.new(0, 18, 0, 18),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "",
|
|
||||||
TextColor3 = Color3.new(1, 0.6, 0.4)
|
|
||||||
})
|
|
||||||
Create("Frame")({
|
|
||||||
Name = "CheckFrame",
|
|
||||||
Parent = Dev_WarningToggleFilter,
|
|
||||||
BackgroundColor3 = Color3.new(1, 0.6, 0.4),
|
|
||||||
BorderColor3 = Color3.new(1, 0.6, 0.4),
|
|
||||||
Position = UDim2.new(0, 4, 0, 4),
|
|
||||||
Size = UDim2.new(0, 10, 0, 10)
|
|
||||||
})
|
|
||||||
local Dev_WordWrapToggle = Create("TextButton")({
|
|
||||||
Name = "WordWrapToggleButton",
|
|
||||||
Parent = Dev_OptionsBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BorderColor3 = Color3.new(0.8, 0.8, 0.8),
|
|
||||||
Position = UDim2.new(0, 215, 0, 0),
|
|
||||||
Size = UDim2.new(0, 18, 0, 18),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "",
|
|
||||||
TextColor3 = Color3.new(0.8, 0.8, 0.8)
|
|
||||||
})
|
|
||||||
Create("Frame")({
|
|
||||||
Name = "CheckFrame",
|
|
||||||
Parent = Dev_WordWrapToggle,
|
|
||||||
BackgroundColor3 = Color3.new(0.8, 0.8, 0.8),
|
|
||||||
BorderColor3 = Color3.new(0.8, 0.8, 0.8),
|
|
||||||
Position = UDim2.new(0, 4, 0, 4),
|
|
||||||
Size = UDim2.new(0, 10, 0, 10),
|
|
||||||
Visible = false
|
|
||||||
})
|
|
||||||
Create("TextLabel")({
|
|
||||||
Name = "Filter",
|
|
||||||
Parent = Dev_OptionsBar,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(0, 40, 0, 18),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "Filter",
|
|
||||||
TextColor3 = Color3.new(1, 1, 1)
|
|
||||||
})
|
|
||||||
Create("TextLabel")({
|
|
||||||
Name = "WordWrap",
|
|
||||||
Parent = Dev_OptionsBar,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 150, 0, 0),
|
|
||||||
Size = UDim2.new(0, 50, 0, 18),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "Word Wrap",
|
|
||||||
TextColor3 = Color3.new(1, 1, 1)
|
|
||||||
})
|
|
||||||
local Dev_ScrollBar = Create("Frame")({
|
|
||||||
Name = "ScrollBar",
|
|
||||||
Parent = Dev_Body,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.9,
|
|
||||||
Position = UDim2.new(1, -20, 0, 26),
|
|
||||||
Size = UDim2.new(0, 20, 1, -50),
|
|
||||||
Visible = false
|
|
||||||
})
|
|
||||||
local Dev_ScrollArea = Create("Frame")({
|
|
||||||
Name = "ScrollArea",
|
|
||||||
Parent = Dev_ScrollBar,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 0, 0, 23),
|
|
||||||
Size = UDim2.new(1, 0, 1, -46)
|
|
||||||
})
|
|
||||||
local Dev_Handle = Create("ImageButton")({
|
|
||||||
Name = "Handle",
|
|
||||||
Parent = Dev_ScrollArea,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.5,
|
|
||||||
Position = UDim2.new(0, 0, 0.2, 0),
|
|
||||||
Size = UDim2.new(0, 20, 0, 40)
|
|
||||||
})
|
|
||||||
Create("ImageLabel")({
|
|
||||||
Name = "ImageLabel",
|
|
||||||
Parent = Dev_Handle,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 0, 0.5, -8),
|
|
||||||
Rotation = 180,
|
|
||||||
Size = UDim2.new(1, 0, 0, 16),
|
|
||||||
Image = "http://www.roblox.com/Asset?id=151205881"
|
|
||||||
})
|
|
||||||
local Dev_DownButton = Create("ImageButton")({
|
|
||||||
Name = "Down",
|
|
||||||
Parent = Dev_ScrollBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.5,
|
|
||||||
Position = UDim2.new(0, 0, 1, -20),
|
|
||||||
Size = UDim2.new(0, 20, 0, 20)
|
|
||||||
})
|
|
||||||
Create("ImageLabel")({
|
|
||||||
Name = "ImageLabel",
|
|
||||||
Parent = Dev_DownButton,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 3, 0, 3),
|
|
||||||
Size = UDim2.new(0, 14, 0, 14),
|
|
||||||
Rotation = 180,
|
|
||||||
Image = "http://www.roblox.com/Asset?id=151205813"
|
|
||||||
})
|
|
||||||
local Dev_UpButton = Create("ImageButton")({
|
|
||||||
Name = "Up",
|
|
||||||
Parent = Dev_ScrollBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.5,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(0, 20, 0, 20)
|
|
||||||
})
|
|
||||||
Create("ImageLabel")({
|
|
||||||
Name = "ImageLabel",
|
|
||||||
Parent = Dev_UpButton,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 3, 0, 3),
|
|
||||||
Size = UDim2.new(0, 14, 0, 14),
|
|
||||||
Image = "http://www.roblox.com/Asset?id=151205813"
|
|
||||||
})
|
|
||||||
local Dev_TextBox = Create("Frame")({
|
|
||||||
Name = "TextBox",
|
|
||||||
Parent = Dev_Body,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.6,
|
|
||||||
Position = UDim2.new(0, 2, 0, 26),
|
|
||||||
Size = UDim2.new(1, -4, 1, -28),
|
|
||||||
ClipsDescendants = true
|
|
||||||
})
|
|
||||||
local Dev_TextHolder = Create("Frame")({
|
|
||||||
Name = "TextHolder",
|
|
||||||
Parent = Dev_TextBox,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(1, 0, 1, 0)
|
|
||||||
})
|
|
||||||
local Dev_OptionsButton = Create("ImageButton")({
|
|
||||||
Name = "OptionsButton",
|
|
||||||
Parent = Dev_Body,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 200, 0, 2),
|
|
||||||
Size = UDim2.new(0, 20, 0, 20)
|
|
||||||
})
|
|
||||||
Create("ImageLabel")({
|
|
||||||
Name = "ImageLabel",
|
|
||||||
Parent = Dev_OptionsButton,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(1, 0, 1, 0),
|
|
||||||
Rotation = 0,
|
|
||||||
Image = "http://www.roblox.com/Asset?id=152093917"
|
|
||||||
})
|
|
||||||
local Dev_ResizeButton = Create("ImageButton")({
|
|
||||||
Name = "ResizeButton",
|
|
||||||
Parent = Dev_Body,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.5,
|
|
||||||
Position = UDim2.new(1, -20, 1, -20),
|
|
||||||
Size = UDim2.new(0, 20, 0, 20)
|
|
||||||
})
|
|
||||||
Create("ImageLabel")({
|
|
||||||
Name = "ImageLabel",
|
|
||||||
Parent = Dev_ResizeButton,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 6, 0, 6),
|
|
||||||
Size = UDim2.new(0.8, 0, 0.8, 0),
|
|
||||||
Rotation = 135,
|
|
||||||
Image = "http://www.roblox.com/Asset?id=151205813"
|
|
||||||
})
|
|
||||||
Create("TextButton")({
|
|
||||||
Name = "LocalConsole",
|
|
||||||
Parent = Dev_Body,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.6,
|
|
||||||
Position = UDim2.new(0, 7, 0, 5),
|
|
||||||
Size = UDim2.new(0, 90, 0, 20),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "Local Console",
|
|
||||||
TextColor3 = Color3.new(1, 1, 1),
|
|
||||||
TextYAlignment = Enum.TextYAlignment.Center
|
|
||||||
})
|
|
||||||
Create("TextButton")({
|
|
||||||
Name = "ServerConsole",
|
|
||||||
Parent = Dev_Body,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.8,
|
|
||||||
Position = UDim2.new(0, 102, 0, 5),
|
|
||||||
Size = UDim2.new(0, 90, 0, 17),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Text = "Server Console",
|
|
||||||
TextColor3 = Color3.new(1, 1, 1),
|
|
||||||
TextYAlignment = Enum.TextYAlignment.Center
|
|
||||||
})
|
|
||||||
local Dev_TitleBar = Create("Frame")({
|
|
||||||
Name = "TitleBar",
|
|
||||||
Parent = Dev_Container,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.5,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(1, 0, 0, 20)
|
|
||||||
})
|
|
||||||
local Dev_CloseButton = Create("ImageButton")({
|
|
||||||
Name = "CloseButton",
|
|
||||||
Parent = Dev_TitleBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.5,
|
|
||||||
Position = UDim2.new(1, -20, 0, 0),
|
|
||||||
Size = UDim2.new(0, 20, 0, 20)
|
|
||||||
})
|
|
||||||
Create("ImageLabel")({
|
|
||||||
Parent = Dev_CloseButton,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 3, 0, 3),
|
|
||||||
Size = UDim2.new(0, 14, 0, 14),
|
|
||||||
Image = "http://www.roblox.com/Asset?id=151205852"
|
|
||||||
})
|
|
||||||
Create("TextButton")({
|
|
||||||
Name = "TextButton",
|
|
||||||
Parent = Dev_TitleBar,
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BackgroundTransparency = 0.5,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(1, -23, 1, 0),
|
|
||||||
Text = ""
|
|
||||||
})
|
|
||||||
Create("TextLabel")({
|
|
||||||
Name = "TitleText",
|
|
||||||
Parent = Dev_TitleBar,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(0, 185, 0, 20),
|
|
||||||
Font = "SourceSansBold",
|
|
||||||
FontSize = Enum.FontSize.Size18,
|
|
||||||
TextColor3 = Color3.new(1, 1, 1),
|
|
||||||
Text = "Roblox Developer Console",
|
|
||||||
TextYAlignment = Enum.TextYAlignment.Top
|
|
||||||
})
|
|
||||||
local previousMousePos
|
|
||||||
local pPos
|
|
||||||
local previousMousePosResize
|
|
||||||
local pSize
|
|
||||||
local previousMousePosScroll
|
|
||||||
local pOffset
|
|
||||||
local scrollUpIsDown = false
|
|
||||||
local scrollDownIsDown = false
|
|
||||||
local clean
|
|
||||||
clean = function()
|
|
||||||
previousMousePos = nil
|
|
||||||
pPos = nil
|
|
||||||
previousMousePosResize = nil
|
|
||||||
pSize = nil
|
|
||||||
previousMousePosScroll = nil
|
|
||||||
pOffset = nil
|
|
||||||
scrollUpIsDown = false
|
|
||||||
scrollDownIsDown = false
|
|
||||||
end
|
|
||||||
local refreshConsolePosition
|
|
||||||
refreshConsolePosition = function(x, y)
|
|
||||||
if not previousMousePos then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local delta = Vector2.new(x, y - previousMousePos)
|
|
||||||
Dev_Container.Position = UDim2.new(0, pPos.X + delta.X, 0, pPos.Y + delta.Y)
|
|
||||||
end
|
|
||||||
Dev_TitleBar.TextButton.MouseButton1Down:connect(function(x, y)
|
|
||||||
previousMousePos = Vector2.new(x, y)
|
|
||||||
pPos = Dev_Container.AbsolutePosition
|
|
||||||
end)
|
|
||||||
Dev_TitleBar.TextButton.MouseButton1Up:connect(clean)
|
|
||||||
local refreshConsoleSize
|
|
||||||
refreshConsoleSize = function(x, y)
|
|
||||||
if not previousMousePosResize then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local delta = Vector2.new(x, y - previousMousePosResize)
|
|
||||||
Dev_Container.Size = UDim2.new(0, math.max(pSize.X + delta.X, minimumSize.X), 0, math.max(pSize.Y + delta.Y, minimumSize.Y))
|
|
||||||
end
|
|
||||||
Dev_Container.Body.ResizeButton.MouseButton1Down:connect(function(x, y)
|
|
||||||
previousMousePosResize = Vector2.new(x, y)
|
|
||||||
pSize = Dev_Container.AbsoluteSize
|
|
||||||
end)
|
|
||||||
Dev_Container.Body.ResizeButton.MouseButton1Up:connect(clean)
|
|
||||||
Dev_TitleBar.CloseButton.MouseButton1Down:connect(function()
|
|
||||||
Dev_Container.Visible = false
|
|
||||||
end)
|
|
||||||
Dev_Container.TitleBar.CloseButton.MouseButton1Up:connect(clean)
|
|
||||||
local optionsHidden = true
|
|
||||||
local animating = false
|
|
||||||
local startAnimation
|
|
||||||
startAnimation = function()
|
|
||||||
if animating then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
animating = true
|
|
||||||
repeat
|
|
||||||
frameNumber = frameNumber + (function()
|
|
||||||
if optionsHidden then
|
|
||||||
return -1
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
end)()
|
|
||||||
local x = frameNumber / 5
|
|
||||||
local smoothStep = x * x * (3 - (2 * x))
|
|
||||||
Dev_OptionsButton.ImageLabel.Rotation = smoothStep * 5 * 9
|
|
||||||
Dev_OptionsBar.Position = UDim2.new(0, (smoothStep * 5 * 50) - 250, 0, 4)
|
|
||||||
wait()
|
|
||||||
if (frameNumber <= 0 and optionsHidden) or (frameNumber >= 5 and not optionsHidden) then
|
|
||||||
animating = false
|
|
||||||
end
|
|
||||||
until not animating
|
|
||||||
end
|
|
||||||
Dev_OptionsButton.MouseButton1Down:connect(function()
|
|
||||||
optionsHidden = not optionsHidden
|
|
||||||
return startAnimation()
|
|
||||||
end)
|
|
||||||
local repositionList
|
|
||||||
repositionList = function()
|
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
|
||||||
localOffset = math.min(math.max(localOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y)
|
|
||||||
Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize)
|
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
|
||||||
serverOffset = math.min(math.max(serverOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y)
|
|
||||||
Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize)
|
|
||||||
end
|
|
||||||
local ratio = Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y
|
|
||||||
if ratio >= 1 then
|
|
||||||
Dev_Container.Body.ScrollBar.Visible = false
|
|
||||||
Dev_Container.Body.TextBox.Size = UDim2.new(1, -4, 1, -28)
|
|
||||||
if currentConsole == LOCAL_CONSOLE or currentConsole == SERVER_CONSOLE then
|
|
||||||
Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Dev_Container.Body.ScrollBar.Visible = true
|
|
||||||
Dev_Container.Body.TextBox.Size = UDim2.new(1, -25, 1, -28)
|
|
||||||
local backRatio = 1 - ratio
|
|
||||||
local offsetRatio
|
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
|
||||||
offsetRatio = localOffset / Dev_TextHolder.AbsoluteSize.Y
|
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
|
||||||
offsetRatio = serverOffset / Dev_TextHolder.AbsoluteSize.Y
|
|
||||||
end
|
|
||||||
local topRatio = math.max(0, backRatio - offsetRatio)
|
|
||||||
local scrollHandleSize = math.max(Dev_ScrollArea.AbsoluteSize.Y * ratio, 21)
|
|
||||||
local scrollRatio = scrollHandleSize / Dev_ScrollArea.AbsoluteSize.Y
|
|
||||||
local ratioConversion = (1 - scrollRatio) / (1 - ratio)
|
|
||||||
local topScrollRatio = topRatio * ratioConversion
|
|
||||||
local sPos = math.min(Dev_ScrollArea.AbsoluteSize.Y * topScrollRatio, Dev_ScrollArea.AbsoluteSize.Y - scrollHandleSize)
|
|
||||||
Dev_ScrollArea.Handle.Size = UDim2.new(1, 0, 0, scrollHandleSize)
|
|
||||||
Dev_ScrollArea.Handle.Position = UDim2.new(0, 0, 0, sPos)
|
|
||||||
Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize + (function()
|
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
|
||||||
return localOffset
|
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
|
||||||
return serverOffset
|
|
||||||
end
|
|
||||||
end)())
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local changeOffset
|
|
||||||
changeOffset = function(value)
|
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
|
||||||
localOffset = localOffset + value
|
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
|
||||||
serverOffset = serverOffset + value
|
|
||||||
end
|
|
||||||
return repositionList()
|
|
||||||
end
|
|
||||||
local refreshTextHolderForReal
|
|
||||||
refreshTextHolderForReal = function()
|
|
||||||
local childMessages = Dev_TextHolder:GetChildren()
|
|
||||||
local messageList
|
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
|
||||||
messageList = localMessageList
|
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
|
||||||
messageList = serverMessageList
|
|
||||||
end
|
|
||||||
local posOffset = 0
|
|
||||||
for i = 1, #childMessages do
|
|
||||||
childMessages[i].Visible = false
|
|
||||||
end
|
|
||||||
for i = 1, #messageList do
|
|
||||||
local message
|
|
||||||
local movePosition = false
|
|
||||||
if i > #childMessages then
|
|
||||||
message = Create("TextLabel")({
|
|
||||||
Name = "Message",
|
|
||||||
Parent = Dev_TextHolder,
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
TextXAlignment = "Left",
|
|
||||||
Size = UDim2.new(1, 0, 0, 14),
|
|
||||||
FontSize = "Size10",
|
|
||||||
ZIndex = 1
|
|
||||||
})
|
|
||||||
movePosition = true
|
|
||||||
else
|
|
||||||
message = childMessages[i]
|
|
||||||
end
|
|
||||||
if (outputToggleOn or messageList[i].Type ~= Enum.MessageType.MessageOutput) and (infoToggleOn or messageList[i].Type ~= Enum.MessageType.MessageInfo) and (warningToggleOn or messageList[i].Type ~= Enum.MessageType.MessageWarning) and (errorToggleOn or messageList[i].Type ~= Enum.MessageType.MessageError) then
|
|
||||||
do
|
|
||||||
message.TextWrapped = wordWrapToggleOn
|
|
||||||
message.Size = UDim2.new(0.98, 0, 0, 2000)
|
|
||||||
message.Parent = Dev_Container
|
|
||||||
message.Text = tostring(messageList[i].Time) .. " -- " .. tostring(messageList[i].Message)
|
|
||||||
message.Size = UDim2.new(0.98, 0, 0, message.TextBounds.Y)
|
|
||||||
message.Position = UDim2.new(0, 5, 0, posOffset)
|
|
||||||
message.Parent = Dev_TextHolder
|
|
||||||
posOffset = posOffset + message.TextBounds.Y
|
|
||||||
end
|
|
||||||
if movePosition then
|
|
||||||
if (currentConsole == LOCAL_CONSOLE and localOffset > 0) or (currentConsole == SERVER_CONSOLE and serverOffset > 0) then
|
|
||||||
changeOffset(message.TextBounds.Y)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
message.Visible = true
|
|
||||||
message.TextColor3 = Color3.new((function()
|
|
||||||
if messageList[i].Type == Enum.MessageType.MessageError then
|
|
||||||
return 1, 0, 0
|
|
||||||
elseif messageList[i].Type == Enum.MessageType.MessageInfo then
|
|
||||||
return 0.4, 0.5, 1
|
|
||||||
elseif messageList[i].Type == Enum.MessageType.MessageWarning then
|
|
||||||
return 1, 0.6, 0.4
|
|
||||||
else
|
|
||||||
return 1, 1, 1
|
|
||||||
end
|
|
||||||
end)())
|
|
||||||
end
|
|
||||||
end
|
|
||||||
textHolderSize = posOffset
|
|
||||||
end
|
|
||||||
local refreshQueued = false
|
|
||||||
local refreshTextHolder
|
|
||||||
refreshTextHolder = function()
|
|
||||||
if refreshQueued then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
Delay(0.1, function()
|
|
||||||
refreshQueued = false
|
|
||||||
return refreshTextHolderForReal()
|
|
||||||
end)
|
|
||||||
refreshQueued = true
|
|
||||||
end
|
|
||||||
local inside = 0
|
|
||||||
local holdingUpButton
|
|
||||||
holdingUpButton = function()
|
|
||||||
if scrollUpIsDown then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
scrollUpIsDown = true
|
|
||||||
wait(0.6)
|
|
||||||
inside = inside + 1
|
|
||||||
while scrollUpIsDown and inside < 2 do
|
|
||||||
wait()
|
|
||||||
changeOffset(12)
|
|
||||||
end
|
|
||||||
inside = inside - 1
|
|
||||||
end
|
|
||||||
local holdingDownButton
|
|
||||||
holdingDownButton = function()
|
|
||||||
if scrollDownIsDown then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
scrollDownIsDown = true
|
|
||||||
wait(0.6)
|
|
||||||
inside = inside + 1
|
|
||||||
while scrollDownIsDown and inside < 2 do
|
|
||||||
wait()
|
|
||||||
changeOffset(-12)
|
|
||||||
end
|
|
||||||
inside = inside - 1
|
|
||||||
end
|
|
||||||
Dev_Container.Body.ScrollBar.Up.MouseButton1Click:connect(function()
|
|
||||||
return changeOffset(10)
|
|
||||||
end)
|
|
||||||
Dev_Container.Body.ScrollBar.Up.MouseButton1Down:connect(function()
|
|
||||||
changeOffset(10)
|
|
||||||
return holdingUpButton()
|
|
||||||
end)
|
|
||||||
Dev_Container.Body.ScrollBar.Up.MouseButton1Up:connect(clean)
|
|
||||||
Dev_Container.Body.ScrollBar.Down.MouseButton1Down:connect(function()
|
|
||||||
changeOffset(-10)
|
|
||||||
return holdingDownButton()
|
|
||||||
end)
|
|
||||||
Dev_Container.Body.ScrollBar.Down.MouseButton1Up:connect(clean)
|
|
||||||
local handleScroll
|
|
||||||
handleScroll = function(x, y)
|
|
||||||
if not previousMousePosScroll then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local delta = (Vector2.new(x, y - previousMousePosScroll)).Y
|
|
||||||
local backRatio = 1 - (Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y)
|
|
||||||
local movementSize = Dev_ScrollArea.AbsoluteSize.Y - Dev_ScrollArea.Handle.AbsoluteSize.Y
|
|
||||||
local normalDelta = math.max(math.min(delta, movementSize), 0 - movementSize)
|
|
||||||
local normalRatio = normalDelta / movementSize
|
|
||||||
local textMovementSize = (backRatio * Dev_TextHolder.AbsoluteSize.Y)
|
|
||||||
local offsetChange = textMovementSize * normalRatio
|
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
|
||||||
localOffset = pOffset - offsetChange
|
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
|
||||||
serverOffset = pOffset - offsetChange
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Dev_ScrollArea.Handle.MouseButton1Down:connect(function(x, y)
|
|
||||||
previousMousePosScroll = Vector2.new(x, y)
|
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
|
||||||
pOffset = localOffset
|
|
||||||
elseif currentConsole == SERVER_CONSOLE then
|
|
||||||
pOffset = serverOffset
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
Dev_ScrollArea.Handle.MouseButton1Up:connect(clean)
|
|
||||||
local existsInsideContainer
|
|
||||||
existsInsideContainer = function(container, x, y)
|
|
||||||
local pos = container.AbsolutePosition
|
|
||||||
local size = container.AbsoluteSize
|
|
||||||
if x < pos.X or x > pos.X + size.X or y < pos.y or y > pos.y + size.y then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
local numberWithZero
|
|
||||||
numberWithZero = function(num)
|
|
||||||
if num < 10 then
|
|
||||||
return "0" .. tostring(num)
|
|
||||||
else
|
|
||||||
return num
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local str = "%s:%s:%s"
|
|
||||||
local ConvertTimeStamp
|
|
||||||
ConvertTimeStamp = function(timeStamp)
|
|
||||||
local localTime = timeStamp - os.time() + math.floor(tick())
|
|
||||||
local dayTime = localTime % 86400
|
|
||||||
local hour = math.floor(dayTime / 3600)
|
|
||||||
dayTime = dayTime - (hour * 3600)
|
|
||||||
local minute = math.floor(dayTime / 60)
|
|
||||||
dayTime = dayTime - (minute * 60)
|
|
||||||
local h = numberWithZero(hour)
|
|
||||||
local m = numberWithZero(minute)
|
|
||||||
local s = numberWithZero(dayTime)
|
|
||||||
return str:format(h, m, s)
|
|
||||||
end
|
|
||||||
Dev_OptionsBar.ErrorToggleButton.MouseButton1Down:connect(function()
|
|
||||||
errorToggleOn = not errorToggleOn
|
|
||||||
Dev_OptionsBar.ErrorToggleButton.CheckFrame.Visible = errorToggleOn
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end)
|
|
||||||
Dev_OptionsBar.WarningToggleButton.MouseButton1Down:connect(function()
|
|
||||||
warningToggleOn = not warningToggleOn
|
|
||||||
Dev_OptionsBar.WarningToggleButton.CheckFrame.Visible = warningToggleOn
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end)
|
|
||||||
Dev_OptionsBar.InfoToggleButton.MouseButton1Down:connect(function()
|
|
||||||
infoToggleOn = not infoToggleOn
|
|
||||||
Dev_OptionsBar.InfoToggleButton.CheckFrame.Visible = infoToggleOn
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end)
|
|
||||||
Dev_OptionsBar.OutputToggleButton.MouseButton1Down:connect(function()
|
|
||||||
outputToggleOn = not outputToggleOn
|
|
||||||
Dev_OptionsBar.OutputToggleButton.CheckFrame.Visible = outputToggleOn
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end)
|
|
||||||
Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down:connect(function()
|
|
||||||
wordWrapToggleOn = not wordWrapToggleOn
|
|
||||||
Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible = wordWrapToggleOn
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end)
|
|
||||||
local AddLocalMessage
|
|
||||||
AddLocalMessage = function(str, messageType, timeStamp)
|
|
||||||
localMessageList[#localMessageList + 1] = {
|
|
||||||
Message = str,
|
|
||||||
Time = ConvertTimeStamp(timeStamp),
|
|
||||||
Type = messageType
|
|
||||||
}
|
|
||||||
while #localMessageList > MAX_LIST_SIZE do
|
|
||||||
table.remove(localMessageList, 1)
|
|
||||||
end
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end
|
|
||||||
local AddServerMessage
|
|
||||||
AddServerMessage = function(str, messageType, timeStamp)
|
|
||||||
serverMessageList[#serverMessageList + 1] = {
|
|
||||||
Message = str,
|
|
||||||
Time = ConvertTimeStamp(timeStamp),
|
|
||||||
Type = messageType
|
|
||||||
}
|
|
||||||
while #serverMessageList > MAX_LIST_SIZE do
|
|
||||||
table.remove(serverMessageList, 1)
|
|
||||||
end
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end
|
|
||||||
Dev_Container.Body.LocalConsole.MouseButton1Click:connect(function()
|
|
||||||
if currentConsole == SERVER_CONSOLE then
|
|
||||||
currentConsole = LOCAL_CONSOLE
|
|
||||||
local localConsole = Dev_Container.Body.LocalConsole
|
|
||||||
local serverConsole = Dev_Container.Body.ServerConsole
|
|
||||||
localConsole.Size = UDim2.new(0, 90, 0, 20)
|
|
||||||
serverConsole.Size = UDim2.new(0, 90, 0, 17)
|
|
||||||
localConsole.BackgroundTransparency = 0.6
|
|
||||||
serverConsole.BackgroundTransparency = 0.8
|
|
||||||
if game:FindFirstChild("Players") and game.Players["LocalPlayer"] then
|
|
||||||
local mouse = game.Players.LocalPlayer:GetMouse()
|
|
||||||
refreshConsolePosition(mouse.X, mouse.Y)
|
|
||||||
refreshConsoleSize(mouse.X, mouse.Y)
|
|
||||||
handleScroll(mouse.X, mouse.Y)
|
|
||||||
end
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
Dev_Container.Body.LocalConsole.MouseButton1Up:connect(clean)
|
|
||||||
local serverHistoryRequested = false
|
|
||||||
Dev_Container.Body.ServerConsole.MouseButton1Click:connect(function()
|
|
||||||
if not serverHistoryRequested then
|
|
||||||
serverHistoryRequested = true
|
|
||||||
game:GetService("LogService"):RequestServerOutput()
|
|
||||||
end
|
|
||||||
if currentConsole == LOCAL_CONSOLE then
|
|
||||||
currentConsole = SERVER_CONSOLE
|
|
||||||
local localConsole = Dev_Container.Body.LocalConsole
|
|
||||||
local serverConsole = Dev_Container.Body.ServerConsole
|
|
||||||
serverConsole.Size = UDim2.new(0, 90, 0, 20)
|
|
||||||
localConsole.Size = UDim2.new(0, 90, 0, 17)
|
|
||||||
serverConsole.BackgroundTransparency = 0.6
|
|
||||||
localConsole.BackgroundTransparency = 0.8
|
|
||||||
if game:FindFirstChild("Players") and game.Players["LocalPlayer"] then
|
|
||||||
local mouse = game.Players.LocalPlayer:GetMouse()
|
|
||||||
refreshConsolePosition(mouse.X, mouse.Y)
|
|
||||||
refreshConsoleSize(mouse.X, mouse.Y)
|
|
||||||
handleScroll(mouse.X, mouse.Y)
|
|
||||||
end
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
Dev_Container.Body.ServerConsole.MouseButton1Up:connect(clean)
|
|
||||||
if game:FindFirstChild("Players") and game.Players["LocalPlayer"] then
|
|
||||||
local LocalMouse = game.Players.LocalPlayer:GetMouse()
|
|
||||||
LocalMouse.Move:connect(function()
|
|
||||||
if not Dev_Container.Visible then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local mouse = game.Players.LocalPlayer:GetMouse()
|
|
||||||
refreshConsolePosition(mouse.X, mouse.Y)
|
|
||||||
refreshConsoleSize(mouse.X, mouse.Y)
|
|
||||||
handleScroll(mouse.X, mouse.Y)
|
|
||||||
refreshTextHolder()
|
|
||||||
return repositionList()
|
|
||||||
end)
|
|
||||||
LocalMouse.Button1Up:connect(clean)
|
|
||||||
LocalMouse.WheelForward:connect(function()
|
|
||||||
if not Dev_Container.Visible then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then
|
|
||||||
return changeOffset(10)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
LocalMouse.WheelBackward:connect(function()
|
|
||||||
if not Dev_Container.Visible then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then
|
|
||||||
return changeOffset(-10)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
Dev_ScrollArea.Handle.MouseButton1Down:connect(function()
|
|
||||||
return repositionList()
|
|
||||||
end)
|
|
||||||
local history = game:GetService("LogService"):GetLogHistory()
|
|
||||||
for i = 1, #history do
|
|
||||||
AddLocalMessage(history[i].message, history[i].messageType, history[i].timestamp)
|
|
||||||
end
|
|
||||||
local _with_0 = game:GetService("LogService")
|
|
||||||
_with_0.MessageOut:connect(function(message, messageType)
|
|
||||||
return AddLocalMessage(message, messageType, os.time())
|
|
||||||
end)
|
|
||||||
_with_0.ServerMessageOut:connect(AddServerMessage)
|
|
||||||
return _with_0
|
|
||||||
end
|
|
||||||
local currentlyToggling = false
|
|
||||||
ToggleConsole.OnInvoke = function()
|
|
||||||
if currentlyToggling then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
currentlyToggling = true
|
|
||||||
initializeDeveloperConsole()
|
|
||||||
Dev_Container.Visible = not Dev_Container.Visible
|
|
||||||
currentlyToggling = false
|
|
||||||
end
|
|
||||||
126
yue/36868950.lua
126
yue/36868950.lua
|
|
@ -1,126 +0,0 @@
|
||||||
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,68 +0,0 @@
|
||||||
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
|
|
||||||
230
yue/38037565.lua
230
yue/38037565.lua
|
|
@ -1,230 +0,0 @@
|
||||||
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
|
|
||||||
541
yue/39250920.lua
541
yue/39250920.lua
|
|
@ -1,541 +0,0 @@
|
||||||
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()
|
|
||||||
3448
yue/45284430.lua
3448
yue/45284430.lua
File diff suppressed because it is too large
Load Diff
|
|
@ -1,15 +0,0 @@
|
||||||
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
|
|
||||||
1797
yue/46295863.lua
1797
yue/46295863.lua
File diff suppressed because it is too large
Load Diff
2304
yue/48488235.lua
2304
yue/48488235.lua
File diff suppressed because it is too large
Load Diff
234
yue/48488398.lua
234
yue/48488398.lua
|
|
@ -1,234 +0,0 @@
|
||||||
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,90 +0,0 @@
|
||||||
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()
|
|
||||||
757
yue/53878047.lua
757
yue/53878047.lua
|
|
@ -1,757 +0,0 @@
|
||||||
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()
|
|
||||||
1055
yue/53878057.lua
1055
yue/53878057.lua
File diff suppressed because it is too large
Load Diff
730
yue/60595411.lua
730
yue/60595411.lua
|
|
@ -1,730 +0,0 @@
|
||||||
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,21 +0,0 @@
|
||||||
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
|
|
||||||
1944
yue/73157242.lua
1944
yue/73157242.lua
File diff suppressed because it is too large
Load Diff
863
yue/89449008.lua
863
yue/89449008.lua
|
|
@ -1,863 +0,0 @@
|
||||||
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 waitForChild
|
|
||||||
waitForChild = function(instance, name)
|
|
||||||
assert(instance)
|
|
||||||
assert(name)
|
|
||||||
while not instance:FindFirstChild(name) do
|
|
||||||
print("Waiting for ...", instance, name)
|
|
||||||
instance.ChildAdded:wait()
|
|
||||||
end
|
|
||||||
return instance:FindFirstChild(name)
|
|
||||||
end
|
|
||||||
local waitForProperty
|
|
||||||
waitForProperty = function(instance, property)
|
|
||||||
assert(instance)
|
|
||||||
assert(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
|
|
||||||
waitForChild(game, "Players")
|
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
|
||||||
local player = game.Players.LocalPlayer
|
|
||||||
local RbxGui, _
|
|
||||||
RbxGui, _ = LoadLibrary("RbxGui")
|
|
||||||
if not RbxGui then
|
|
||||||
print("could not find RbxGui!")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local StaticTabName = "gear"
|
|
||||||
local backpack = script.Parent
|
|
||||||
local backpackItems = { }
|
|
||||||
local buttons = { }
|
|
||||||
local debounce = false
|
|
||||||
local browsingMenu = false
|
|
||||||
local mouseEnterCons = { }
|
|
||||||
local mouseClickCons = { }
|
|
||||||
local characterChildAddedCon
|
|
||||||
local characterChildRemovedCon
|
|
||||||
local backpackAddCon
|
|
||||||
local playerBackpack = waitForChild(player, "Backpack")
|
|
||||||
waitForChild(backpack, "Tabs")
|
|
||||||
waitForChild(backpack, "Gear")
|
|
||||||
local gearPreview = waitForChild(backpack.Gear, "GearPreview")
|
|
||||||
local scroller = waitForChild(backpack.Gear, "GearGridScrollingArea")
|
|
||||||
local currentLoadout = waitForChild(backpack.Parent, "CurrentLoadout")
|
|
||||||
local grid = waitForChild(backpack.Gear, "GearGrid")
|
|
||||||
local gearButton = waitForChild(grid, "GearButton")
|
|
||||||
local swapSlot = waitForChild(script.Parent, "SwapSlot")
|
|
||||||
local backpackManager = waitForChild(script.Parent, "CoreScripts/BackpackScripts/BackpackManager")
|
|
||||||
local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent")
|
|
||||||
local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent")
|
|
||||||
local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent")
|
|
||||||
local resizeEvent = waitForChild(backpackManager, "ResizeEvent")
|
|
||||||
local searchRequestedEvent = waitForChild(backpackManager, "SearchRequestedEvent")
|
|
||||||
local tellBackpackReadyFunc = waitForChild(backpackManager, "BackpackReady")
|
|
||||||
local scrollFrame, scrollUp, scrollDown, recalculateScroll
|
|
||||||
scrollFrame, scrollUp, scrollDown, recalculateScroll = RbxGui.CreateScrollingFrame(nil, "grid", Vector2.new(6, 6))
|
|
||||||
scrollFrame.Position = UDim2.new(0, 0, 0, 30)
|
|
||||||
scrollFrame.Size = UDim2.new(1, 0, 1, -30)
|
|
||||||
scrollFrame.Parent = backpack.Gear.GearGrid
|
|
||||||
local scrollBar = New("Frame", "ScrollBar", {
|
|
||||||
BackgroundTransparency = 0.9,
|
|
||||||
BackgroundColor3 = Color3.new(1, 1, 1),
|
|
||||||
BorderSizePixel = 0,
|
|
||||||
Size = UDim2.new(0, 17, 1, -36),
|
|
||||||
Position = UDim2.new(0, 0, 0, 18),
|
|
||||||
Parent = scroller
|
|
||||||
})
|
|
||||||
scrollDown.Position = UDim2.new(0, 0, 1, -17)
|
|
||||||
scrollUp.Parent = scroller
|
|
||||||
scrollDown.Parent = scroller
|
|
||||||
local scrollFrameLoadout, scrollUpLoadout, scrollDownLoadout, recalculateScrollLoadout
|
|
||||||
scrollFrameLoadout, scrollUpLoadout, scrollDownLoadout, recalculateScrollLoadout = RbxGui.CreateScrollingFrame()
|
|
||||||
scrollFrameLoadout.Position = UDim2.new(0, 0, 0, 0)
|
|
||||||
scrollFrameLoadout.Size = UDim2.new(1, 0, 1, 0)
|
|
||||||
scrollFrameLoadout.Parent = backpack.Gear.GearLoadouts.LoadoutsList
|
|
||||||
local LoadoutButton = New("TextButton", "LoadoutButton", {
|
|
||||||
RobloxLocked = true,
|
|
||||||
Font = Enum.Font.ArialBold,
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(1, 0, 0, 32),
|
|
||||||
Style = Enum.ButtonStyle.RobloxButton,
|
|
||||||
Text = "Loadout #1",
|
|
||||||
TextColor3 = Color3.new(1, 1, 1),
|
|
||||||
Parent = scrollFrameLoadout
|
|
||||||
})
|
|
||||||
do
|
|
||||||
local _with_0 = LoadoutButton:clone()
|
|
||||||
_with_0.Text = "Loadout #2"
|
|
||||||
_with_0.Parent = scrollFrameLoadout
|
|
||||||
end
|
|
||||||
do
|
|
||||||
local _with_0 = LoadoutButton:clone()
|
|
||||||
_with_0.Text = "Loadout #3"
|
|
||||||
_with_0.Parent = scrollFrameLoadout
|
|
||||||
end
|
|
||||||
do
|
|
||||||
local _with_0 = LoadoutButton:clone()
|
|
||||||
_with_0.Text = "Loadout #4"
|
|
||||||
_with_0.Parent = scrollFrameLoadout
|
|
||||||
end
|
|
||||||
New("Frame", "ScrollBarLoadout", {
|
|
||||||
BackgroundTransparency = 0.9,
|
|
||||||
BackgroundColor3 = Color3.new(1, 1, 1),
|
|
||||||
BorderSizePixel = 0,
|
|
||||||
Size = UDim2.new(0, 17, 1, -36),
|
|
||||||
Position = UDim2.new(0, 0, 0, 18),
|
|
||||||
Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
|
|
||||||
})
|
|
||||||
scrollDownLoadout.Position = UDim2.new(0, 0, 1, -17)
|
|
||||||
scrollUpLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
|
|
||||||
scrollDownLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
|
|
||||||
local removeFromMap
|
|
||||||
removeFromMap = function(map, object)
|
|
||||||
for i = 1, #map do
|
|
||||||
if map[i] == object then
|
|
||||||
table.remove(map, i)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local robloxLock
|
|
||||||
robloxLock = function(instance)
|
|
||||||
instance.RobloxLocked = true
|
|
||||||
local children = instance:GetChildren()
|
|
||||||
if children then
|
|
||||||
for _, child in ipairs(children) do
|
|
||||||
robloxLock(child)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local clearPreview
|
|
||||||
clearPreview = function()
|
|
||||||
gearPreview.GearImage.Image = ""
|
|
||||||
gearPreview.GearStats.GearName.Text = ""
|
|
||||||
end
|
|
||||||
local clearHighlight
|
|
||||||
clearHighlight = function(button)
|
|
||||||
button.TextColor3 = Color3.new(1, 1, 1)
|
|
||||||
button.BackgroundColor3 = Color3.new(0, 0, 0)
|
|
||||||
end
|
|
||||||
local inLoadout
|
|
||||||
inLoadout = function(gear)
|
|
||||||
local children = currentLoadout:GetChildren()
|
|
||||||
for i = 1, #children do
|
|
||||||
if children[i]:IsA("Frame") then
|
|
||||||
local button = children[i]:GetChildren()
|
|
||||||
if #button > 0 and button[1].GearReference.Value and button[1].GearReference.Value == gear then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local updateGridActive
|
|
||||||
updateGridActive = function()
|
|
||||||
for _, v in pairs(backpackItems) do
|
|
||||||
if buttons[v] then
|
|
||||||
local gear
|
|
||||||
local gearRef = buttons[v]:FindFirstChild("GearReference")
|
|
||||||
if gearRef then
|
|
||||||
gear = gearRef.Value
|
|
||||||
end
|
|
||||||
if (not gear) or inLoadout(gear) then
|
|
||||||
buttons[v].Active = false
|
|
||||||
else
|
|
||||||
buttons[v].Active = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local swapGearSlot
|
|
||||||
swapGearSlot = function(slot, gearButton)
|
|
||||||
if not swapSlot.Value then
|
|
||||||
swapSlot.Slot.Value = slot
|
|
||||||
swapSlot.GearButton.Value = gearButton
|
|
||||||
swapSlot.Value = true
|
|
||||||
return updateGridActive()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local unequipGear
|
|
||||||
unequipGear = function(physGear)
|
|
||||||
physGear.Parent = playerBackpack
|
|
||||||
return updateGridActive()
|
|
||||||
end
|
|
||||||
local UnequipGearMenuClick
|
|
||||||
UnequipGearMenuClick = function(element, menu)
|
|
||||||
if type(element.Action) ~= "number" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local num = element.Action
|
|
||||||
if num == 1 then
|
|
||||||
unequipGear(menu.Parent.GearReference.Value)
|
|
||||||
local inventoryButton = menu.Parent
|
|
||||||
local gearToUnequip = inventoryButton.GearReference.Value
|
|
||||||
local loadoutChildren = currentLoadout:GetChildren()
|
|
||||||
local slot = -1
|
|
||||||
for i = 1, #loadoutChildren do
|
|
||||||
if loadoutChildren[i]:IsA("Frame") then
|
|
||||||
local button = loadoutChildren[i]:GetChildren()
|
|
||||||
if button[1] and button[1].GearReference.Value == gearToUnequip then
|
|
||||||
slot = button[1].SlotNumber.Text
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return swapGearSlot(slot, nil)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local highlight
|
|
||||||
highlight = function(button)
|
|
||||||
button.TextColor3 = Color3.new(0, 0, 0)
|
|
||||||
button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8)
|
|
||||||
end
|
|
||||||
local getGearContextMenu
|
|
||||||
getGearContextMenu = function()
|
|
||||||
local gearContextMenu = New("Frame", "UnequipContextMenu", {
|
|
||||||
Active = true,
|
|
||||||
Size = UDim2.new(0, 115, 0, 70),
|
|
||||||
Position = UDim2.new(0, -16, 0, -16),
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Visible = false
|
|
||||||
})
|
|
||||||
local gearContextMenuButton = New("TextButton", "UnequipContextMenuButton", {
|
|
||||||
Text = "",
|
|
||||||
Style = Enum.ButtonStyle.RobloxButtonDefault,
|
|
||||||
ZIndex = 8,
|
|
||||||
Size = UDim2.new(1, 0, 1, -20),
|
|
||||||
Visible = true,
|
|
||||||
Parent = gearContextMenu
|
|
||||||
})
|
|
||||||
local elementHeight = 12
|
|
||||||
local contextMenuElements = { }
|
|
||||||
local contextMenuElementsName = {
|
|
||||||
"Remove Hotkey"
|
|
||||||
}
|
|
||||||
for i = 1, #contextMenuElementsName do
|
|
||||||
local element = { }
|
|
||||||
element.Type = "Button"
|
|
||||||
element.Text = contextMenuElementsName[i]
|
|
||||||
element.Action = i
|
|
||||||
element.DoIt = UnequipGearMenuClick
|
|
||||||
table.insert(contextMenuElements, element)
|
|
||||||
end
|
|
||||||
for i, contextElement in ipairs(contextMenuElements) do
|
|
||||||
local element = contextElement
|
|
||||||
if element.Type == "Button" then
|
|
||||||
local button = New("TextButton", "UnequipContextButton" .. tostring(i), {
|
|
||||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
|
||||||
BorderSizePixel = 0,
|
|
||||||
TextXAlignment = Enum.TextXAlignment.Left,
|
|
||||||
Text = " " .. tostring(contextElement.Text),
|
|
||||||
Font = Enum.Font.Arial,
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Size = UDim2.new(1, 8, 0, elementHeight),
|
|
||||||
Position = UDim2.new(0, 0, 0, elementHeight * i),
|
|
||||||
TextColor3 = Color3.new(1, 1, 1),
|
|
||||||
ZIndex = 9,
|
|
||||||
Parent = gearContextMenuButton
|
|
||||||
})
|
|
||||||
if not IsTouchDevice() then
|
|
||||||
button.MouseButton1Click:connect(function()
|
|
||||||
if button.Active and not gearContextMenu.Parent.Active then
|
|
||||||
pcall(function()
|
|
||||||
return element.DoIt(element, gearContextMenu)
|
|
||||||
end)
|
|
||||||
browsingMenu = false
|
|
||||||
gearContextMenu.Visible = false
|
|
||||||
clearHighlight(button)
|
|
||||||
return clearPreview()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
button.MouseEnter:connect(function()
|
|
||||||
if button.Active and gearContextMenu.Parent.Active then
|
|
||||||
return highlight(button)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
button.MouseLeave:connect(function()
|
|
||||||
if button.Active and gearContextMenu.Parent.Active then
|
|
||||||
return clearHighlight(button)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
contextElement.Button = button
|
|
||||||
contextElement.Element = button
|
|
||||||
elseif element.Type == "Label" then
|
|
||||||
local frame = New("Frame", "ContextLabel" .. tostring(i), {
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
Size = UDim2.new(1, 8, 0, elementHeight),
|
|
||||||
New("TextLabel", "Text1", {
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
BackgroundColor3 = Color3.new(1, 1, 1),
|
|
||||||
BorderSizePixel = 0,
|
|
||||||
TextXAlignment = Enum.TextXAlignment.Left,
|
|
||||||
Font = Enum.Font.ArialBold,
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
|
||||||
Size = UDim2.new(0.5, 0, 1, 0),
|
|
||||||
TextColor3 = Color3.new(1, 1, 1),
|
|
||||||
ZIndex = 9
|
|
||||||
})
|
|
||||||
})
|
|
||||||
element.Label1 = frame.Text1
|
|
||||||
if element.GetText2 then
|
|
||||||
element.Label2 = New("TextLabel", "Text2", {
|
|
||||||
BackgroundTransparency = 1,
|
|
||||||
BackgroundColor3 = Color3.new(1, 1, 1),
|
|
||||||
BorderSizePixel = 0,
|
|
||||||
TextXAlignment = Enum.TextXAlignment.Right,
|
|
||||||
Font = Enum.Font.Arial,
|
|
||||||
FontSize = Enum.FontSize.Size14,
|
|
||||||
Position = UDim2.new(0.5, 0, 0, 0),
|
|
||||||
Size = UDim2.new(0.5, 0, 1, 0),
|
|
||||||
TextColor3 = Color3.new(1, 1, 1),
|
|
||||||
ZIndex = 9,
|
|
||||||
Parent = frame
|
|
||||||
})
|
|
||||||
end
|
|
||||||
frame.Parent = gearContextMenuButton
|
|
||||||
element.Label = frame
|
|
||||||
element.Element = frame
|
|
||||||
end
|
|
||||||
end
|
|
||||||
gearContextMenu.ZIndex = 4
|
|
||||||
gearContextMenu.MouseLeave:connect(function()
|
|
||||||
browsingMenu = false
|
|
||||||
gearContextMenu.Visible = false
|
|
||||||
return clearPreview()
|
|
||||||
end)
|
|
||||||
robloxLock(gearContextMenu)
|
|
||||||
return gearContextMenu
|
|
||||||
end
|
|
||||||
local findEmptySlot
|
|
||||||
findEmptySlot = function()
|
|
||||||
local smallestNum
|
|
||||||
local loadout = currentLoadout:GetChildren()
|
|
||||||
for i = 1, #loadout do
|
|
||||||
if loadout[i]:IsA("Frame") and #loadout[i]:GetChildren() <= 0 then
|
|
||||||
local frameNum = tonumber(string.sub(loadout[i].Name, 5))
|
|
||||||
if frameNum == 0 then
|
|
||||||
frameNum = 10
|
|
||||||
end
|
|
||||||
if not smallestNum or (smallestNum > frameNum) then
|
|
||||||
smallestNum = frameNum
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if smallestNum == 10 then
|
|
||||||
smallestNum = 0
|
|
||||||
end
|
|
||||||
return smallestNum
|
|
||||||
end
|
|
||||||
local checkForSwap
|
|
||||||
checkForSwap = function(button, x, y)
|
|
||||||
local loadoutChildren = currentLoadout:GetChildren()
|
|
||||||
for i = 1, #loadoutChildren do
|
|
||||||
if loadoutChildren[i]:IsA("Frame") and string.find(loadoutChildren[i].Name, "Slot") then
|
|
||||||
if x >= loadoutChildren[i].AbsolutePosition.x and x <= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x) then
|
|
||||||
if y >= loadoutChildren[i].AbsolutePosition.y and y <= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y) then
|
|
||||||
local slot = tonumber(string.sub(loadoutChildren[i].Name, 5))
|
|
||||||
swapGearSlot(slot, button)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local previewGear
|
|
||||||
previewGear = function(button)
|
|
||||||
if not browsingMenu then
|
|
||||||
gearPreview.Visible = false
|
|
||||||
gearPreview.GearImage.Image = button.Image
|
|
||||||
gearPreview.GearStats.GearName.Text = button.GearReference.Value.Name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local buttonClick
|
|
||||||
buttonClick = function(button)
|
|
||||||
if button:FindFirstChild("UnequipContextMenu" and not button.Active) then
|
|
||||||
button.UnequipContextMenu.Visible = true
|
|
||||||
browsingMenu = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local resizeGrid
|
|
||||||
resizeGrid = function()
|
|
||||||
for _, v in pairs(backpackItems) do
|
|
||||||
if not v:FindFirstChild("RobloxBuildTool") then
|
|
||||||
if not buttons[v] then
|
|
||||||
local buttonClone = gearButton:clone()
|
|
||||||
buttonClone.Parent = grid.ScrollingFrame
|
|
||||||
buttonClone.Visible = true
|
|
||||||
buttonClone.Image = v.TextureId
|
|
||||||
if buttonClone.Image == "" then
|
|
||||||
buttonClone.GearText.Text = v.Name
|
|
||||||
end
|
|
||||||
buttonClone.GearReference.Value = v
|
|
||||||
buttonClone.Draggable = true
|
|
||||||
buttons[v] = buttonClone
|
|
||||||
if not IsTouchDevice() then
|
|
||||||
local unequipMenu = getGearContextMenu()
|
|
||||||
unequipMenu.Visible = false
|
|
||||||
unequipMenu.Parent = buttonClone
|
|
||||||
end
|
|
||||||
local beginPos
|
|
||||||
buttonClone.DragBegin:connect(function(value)
|
|
||||||
waitForChild(buttonClone, "Background")
|
|
||||||
buttonClone["Background"].ZIndex = 10
|
|
||||||
buttonClone.ZIndex = 10
|
|
||||||
beginPos = value
|
|
||||||
end)
|
|
||||||
buttonClone.DragStopped:connect(function(x, y)
|
|
||||||
waitForChild(buttonClone, "Background")
|
|
||||||
buttonClone["Background"].ZIndex = 1
|
|
||||||
buttonClone.ZIndex = 2
|
|
||||||
if beginPos ~= buttonClone.Position then
|
|
||||||
if not checkForSwap(buttonClone, x, y) then
|
|
||||||
buttonClone:TweenPosition(beginPos, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
|
|
||||||
buttonClone.Draggable = false
|
|
||||||
return delay(0.5, function()
|
|
||||||
buttonClone.Draggable = true
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
buttonClone.Position = beginPos
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
local clickTime = tick()
|
|
||||||
mouseEnterCons[buttonClone] = buttonClone.MouseEnter:connect(function()
|
|
||||||
return previewGear(buttonClone)
|
|
||||||
end)
|
|
||||||
mouseClickCons[buttonClone] = buttonClone.MouseButton1Click:connect(function()
|
|
||||||
local newClickTime = tick()
|
|
||||||
if buttonClone.Active and (newClickTime - clickTime) < 0.5 then
|
|
||||||
local slot = findEmptySlot()
|
|
||||||
if slot then
|
|
||||||
buttonClone.ZIndex = 1
|
|
||||||
swapGearSlot(slot, buttonClone)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
buttonClick(buttonClone)
|
|
||||||
end
|
|
||||||
clickTime = newClickTime
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return recalculateScroll()
|
|
||||||
end
|
|
||||||
local resize
|
|
||||||
resize = function()
|
|
||||||
local size = 0.75 * (function()
|
|
||||||
if gearPreview.AbsoluteSize.Y > gearPreview.AbsoluteSize.X then
|
|
||||||
return gearPreview.AbsoluteSize.X
|
|
||||||
else
|
|
||||||
return gearPreview.AbsoluteSize.Y
|
|
||||||
end
|
|
||||||
end)()
|
|
||||||
waitForChild(gearPreview, "GearImage")
|
|
||||||
gearPreview.GearImage.Size = UDim2.new(0, size, 0, size)
|
|
||||||
gearPreview.GearImage.Position = UDim2.new(0, gearPreview.AbsoluteSize.X / 2 - size / 2, 0.75, -size)
|
|
||||||
return resizeGrid()
|
|
||||||
end
|
|
||||||
local addToGrid
|
|
||||||
addToGrid = function(child)
|
|
||||||
if not child:IsA("Tool") and not child:IsA("HopperBin") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if child:FindFirstChild("RobloxBuildTool") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
for _, v in pairs(backpackItems) do
|
|
||||||
if v == child then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
table.insert(backpackItems, child)
|
|
||||||
local changeCon = child.Changed:connect(function(prop)
|
|
||||||
if prop == "Name" and buttons[child] and buttons[child].Image == "" then
|
|
||||||
buttons[child].GearText.Text = child.Name
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
local ancestryCon = child.AncestryChanged:connect(function(_, _)
|
|
||||||
local thisObject
|
|
||||||
for _, v in pairs(backpackItems) do
|
|
||||||
if v == child then
|
|
||||||
thisObject = v
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
waitForProperty(player, "Character")
|
|
||||||
waitForChild(player, "Backpack")
|
|
||||||
if child.Parent ~= player.Backpack and child.Parent ~= player.Character then
|
|
||||||
do
|
|
||||||
local _obj_0 = ancestryCon
|
|
||||||
if _obj_0 ~= nil then
|
|
||||||
_obj_0:disconnect()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if changeCon ~= nil then
|
|
||||||
changeCon:disconnect()
|
|
||||||
end
|
|
||||||
for _, v in pairs(backpackItems) do
|
|
||||||
if v == thisObject then
|
|
||||||
do
|
|
||||||
local _obj_0 = mouseEnterCons[buttons[v]]
|
|
||||||
if _obj_0 ~= nil then
|
|
||||||
_obj_0:disconnect()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
do
|
|
||||||
local _obj_0 = mouseClickCons[buttons[v]]
|
|
||||||
if _obj_0 ~= nil then
|
|
||||||
_obj_0:disconnect()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
buttons[v].Parent = nil
|
|
||||||
buttons[v] = nil
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
removeFromMap(backpackItems, thisObject)
|
|
||||||
resizeGrid()
|
|
||||||
else
|
|
||||||
resizeGrid()
|
|
||||||
end
|
|
||||||
return updateGridActive()
|
|
||||||
end)
|
|
||||||
return resizeGrid()
|
|
||||||
end
|
|
||||||
local showPartialGrid
|
|
||||||
showPartialGrid = function(subset)
|
|
||||||
for _, v in pairs(buttons) do
|
|
||||||
v.Parent = nil
|
|
||||||
end
|
|
||||||
if subset then
|
|
||||||
for _, v in pairs(subset) do
|
|
||||||
v.Parent = grid.ScrollingFrame
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return recalculateScroll()
|
|
||||||
end
|
|
||||||
local showEntireGrid
|
|
||||||
showEntireGrid = function()
|
|
||||||
for _, v in pairs(buttons) do
|
|
||||||
v.Parent = grid.ScrollingFrame
|
|
||||||
end
|
|
||||||
return recalculateScroll()
|
|
||||||
end
|
|
||||||
local centerGear
|
|
||||||
centerGear = function(loadoutChildren)
|
|
||||||
local gearButtons = { }
|
|
||||||
local lastSlotAdd
|
|
||||||
for i = 1, #loadoutChildren do
|
|
||||||
if loadoutChildren[i]:IsA("Frame") and #loadoutChildren[i]:GetChildren() > 0 then
|
|
||||||
if loadoutChildren[i].Name == "Slot0" then
|
|
||||||
lastSlotAdd = loadoutChildren[i]
|
|
||||||
else
|
|
||||||
table.insert(gearButtons, loadoutChildren[i])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if lastSlotAdd then
|
|
||||||
table.insert(gearButtons, lastSlotAdd)
|
|
||||||
end
|
|
||||||
local startPos = (1 - (#gearButtons * 0.1)) / 2
|
|
||||||
for i = 1, #gearButtons do
|
|
||||||
gearButtons[i]:TweenPosition(UDim2.new(startPos + ((i - 1) * 0.1), 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local backpackOpenHandler
|
|
||||||
backpackOpenHandler = function(currentTab)
|
|
||||||
if currentTab and currentTab ~= StaticTabName then
|
|
||||||
backpack.Gear.Visible = false
|
|
||||||
return
|
|
||||||
end
|
|
||||||
backpack.Gear.Visible = true
|
|
||||||
updateGridActive()
|
|
||||||
resizeGrid()
|
|
||||||
resize()
|
|
||||||
return tellBackpackReadyFunc:Invoke()
|
|
||||||
end
|
|
||||||
local backpackCloseHandler
|
|
||||||
backpackCloseHandler = function(currentTab)
|
|
||||||
if currentTab and currentTab ~= StaticTabName then
|
|
||||||
backpack.Gear.Visible = false
|
|
||||||
return
|
|
||||||
end
|
|
||||||
backpack.Gear.Visible = false
|
|
||||||
resizeGrid()
|
|
||||||
resize()
|
|
||||||
return tellBackpackReadyFunc:Invoke()
|
|
||||||
end
|
|
||||||
local tabClickHandler
|
|
||||||
tabClickHandler = function(tabName)
|
|
||||||
if tabName == StaticTabName then
|
|
||||||
return backpackOpenHandler(tabName)
|
|
||||||
else
|
|
||||||
return backpackCloseHandler(tabName)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local loadoutCheck
|
|
||||||
loadoutCheck = function(child, selectState)
|
|
||||||
if not child:IsA("ImageButton") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
for _, v in pairs(backpackItems) do
|
|
||||||
if buttons[v] then
|
|
||||||
if child:FindFirstChild("GearReference" and buttons[v]:FindFirstChild("GearReference")) then
|
|
||||||
if buttons[v].GearReference.Value == child.GearReference.Value then
|
|
||||||
buttons[v].Active = selectState
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local setupCharacterConnections
|
|
||||||
setupCharacterConnections = function()
|
|
||||||
if backpackAddCon ~= nil then
|
|
||||||
backpackAddCon:disconnect()
|
|
||||||
end
|
|
||||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child)
|
|
||||||
return addToGrid(child)
|
|
||||||
end)
|
|
||||||
local backpackChildren = game.Players.LocalPlayer.Backpack:GetChildren()
|
|
||||||
for i = 1, #backpackChildren do
|
|
||||||
addToGrid(backpackChildren[i])
|
|
||||||
end
|
|
||||||
if characterChildAddedCon ~= nil then
|
|
||||||
characterChildAddedCon:disconnect()
|
|
||||||
end
|
|
||||||
characterChildAddedCon = game.Players.LocalPlayer.Character.ChildAdded:connect(function(child)
|
|
||||||
addToGrid(child)
|
|
||||||
return updateGridActive()
|
|
||||||
end)
|
|
||||||
if characterChildRemovedCon ~= nil then
|
|
||||||
characterChildRemovedCon:disconnect()
|
|
||||||
end
|
|
||||||
characterChildRemovedCon = game.Players.LocalPlayer.Character.ChildRemoved:connect(function(_)
|
|
||||||
return updateGridActive()
|
|
||||||
end)
|
|
||||||
wait()
|
|
||||||
return centerGear(currentLoadout:GetChildren())
|
|
||||||
end
|
|
||||||
local removeCharacterConnections
|
|
||||||
removeCharacterConnections = function()
|
|
||||||
if characterChildAddedCon ~= nil then
|
|
||||||
characterChildAddedCon:disconnect()
|
|
||||||
end
|
|
||||||
if characterChildRemovedCon ~= nil then
|
|
||||||
characterChildRemovedCon:disconnect()
|
|
||||||
end
|
|
||||||
if backpackAddCon ~= nil then
|
|
||||||
return backpackAddCon:disconnect()
|
|
||||||
end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
local trim
|
|
||||||
trim = function(s)
|
|
||||||
return s:gsub("^%s*(.-)%s*$", "%1")
|
|
||||||
end
|
|
||||||
local filterGear
|
|
||||||
filterGear = function(terms)
|
|
||||||
local filteredGear = { }
|
|
||||||
for _, v in pairs(backpackItems) do
|
|
||||||
if buttons[v] then
|
|
||||||
local gearString = string.lower(buttons[v].GearReference.Value.Name)
|
|
||||||
gearString = trim(gearString)
|
|
||||||
for i = 1, #terms do
|
|
||||||
if string.match(gearString, terms[i]) then
|
|
||||||
table.insert(filteredGear, buttons[v])
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return filteredGear
|
|
||||||
end
|
|
||||||
local splitByWhitespace
|
|
||||||
splitByWhitespace = function(text)
|
|
||||||
if type(text) ~= "string" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local terms = { }
|
|
||||||
for token in string.gmatch(text, "[^%s]+") do
|
|
||||||
if string.len(token) > 0 then
|
|
||||||
table.insert(terms, token)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return terms
|
|
||||||
end
|
|
||||||
local showSearchGear
|
|
||||||
showSearchGear = function(searchTerms)
|
|
||||||
if not backpack.Gear.Visible then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local searchTermTable = splitByWhitespace(searchTerms)
|
|
||||||
local currSearchTerms
|
|
||||||
if searchTermTable and (#searchTermTable > 0) then
|
|
||||||
currSearchTerms = searchTermTable
|
|
||||||
else
|
|
||||||
currSearchTerms = nil
|
|
||||||
end
|
|
||||||
if not (searchTermTable ~= nil) then
|
|
||||||
showEntireGrid()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local filteredButtons = filterGear(currSearchTerms)
|
|
||||||
return showPartialGrid(filteredButtons)
|
|
||||||
end
|
|
||||||
local nukeBackpack
|
|
||||||
nukeBackpack = function()
|
|
||||||
while #buttons > 0 do
|
|
||||||
table.remove(buttons)
|
|
||||||
end
|
|
||||||
buttons = { }
|
|
||||||
while #backpackItems > 0 do
|
|
||||||
table.remove(backpackItems)
|
|
||||||
end
|
|
||||||
backpackItems = { }
|
|
||||||
local scrollingFrameChildren = grid.ScrollingFrame:GetChildren()
|
|
||||||
for i = 1, #scrollingFrameChildren do
|
|
||||||
scrollingFrameChildren[i]:remove()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local coreGuiChanged
|
|
||||||
coreGuiChanged = function(coreGuiType, enabled)
|
|
||||||
if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then
|
|
||||||
if not enabled then
|
|
||||||
backpack.Gear.Visible = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local backpackChildren = player.Backpack:GetChildren()
|
|
||||||
for i = 1, #backpackChildren do
|
|
||||||
addToGrid(backpackChildren[i])
|
|
||||||
end
|
|
||||||
resizeEvent.Event:connect(function(_)
|
|
||||||
if debounce then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
debounce = true
|
|
||||||
wait()
|
|
||||||
resize()
|
|
||||||
resizeGrid()
|
|
||||||
debounce = false
|
|
||||||
end)
|
|
||||||
currentLoadout.ChildAdded:connect(function(child)
|
|
||||||
return loadoutCheck(child, false)
|
|
||||||
end)
|
|
||||||
currentLoadout.ChildRemoved:connect(function(child)
|
|
||||||
return loadoutCheck(child, true)
|
|
||||||
end)
|
|
||||||
currentLoadout.DescendantAdded:connect(function(descendant)
|
|
||||||
if not backpack.Visible and (descendant:IsA("ImageButton") or descendant:IsA("TextButton")) then
|
|
||||||
return centerGear(currentLoadout:GetChildren())
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
currentLoadout.DescendantRemoving:connect(function(descendant)
|
|
||||||
if not backpack.Visible and (descendant:IsA("ImageButton") or descendant:IsA("TextButton")) then
|
|
||||||
wait()
|
|
||||||
return centerGear(currentLoadout:GetChildren())
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
grid.MouseEnter:connect(function()
|
|
||||||
return clearPreview()
|
|
||||||
end)
|
|
||||||
grid.MouseLeave:connect(function()
|
|
||||||
return clearPreview()
|
|
||||||
end)
|
|
||||||
player.CharacterRemoving:connect(function()
|
|
||||||
removeCharacterConnections()
|
|
||||||
return nukeBackpack()
|
|
||||||
end)
|
|
||||||
player.CharacterAdded:connect(function()
|
|
||||||
return setupCharacterConnections()
|
|
||||||
end)
|
|
||||||
player.ChildAdded:connect(function(child)
|
|
||||||
if child:IsA("Backpack") then
|
|
||||||
playerBackpack = child
|
|
||||||
if backpackAddCon ~= nil then
|
|
||||||
backpackAddCon:disconnect()
|
|
||||||
end
|
|
||||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child)
|
|
||||||
return addToGrid(child)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
swapSlot.Changed:connect(function()
|
|
||||||
if not swapSlot.Value then
|
|
||||||
return updateGridActive()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
local loadoutChildren = currentLoadout:GetChildren()
|
|
||||||
for i = 1, #loadoutChildren do
|
|
||||||
if loadoutChildren[i]:IsA("Frame") and string.find(loadoutChildren[i].Name, "Slot") then
|
|
||||||
loadoutChildren[i].ChildRemoved:connect(function()
|
|
||||||
return updateGridActive()
|
|
||||||
end)
|
|
||||||
loadoutChildren[i].ChildAdded:connect(function()
|
|
||||||
return updateGridActive()
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
pcall(function()
|
|
||||||
coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))
|
|
||||||
return Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
|
||||||
end)
|
|
||||||
resize()
|
|
||||||
resizeGrid()
|
|
||||||
loadoutChildren = currentLoadout:GetChildren()
|
|
||||||
for i = 1, #loadoutChildren do
|
|
||||||
loadoutCheck(loadoutChildren[i], false)
|
|
||||||
end
|
|
||||||
if not backpack.Visible then
|
|
||||||
centerGear(currentLoadout:GetChildren())
|
|
||||||
end
|
|
||||||
if not (characterChildAddedCon ~= nil) and game.Players.LocalPlayer["Character"] then
|
|
||||||
setupCharacterConnections()
|
|
||||||
end
|
|
||||||
if not backpackAddCon then
|
|
||||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child)
|
|
||||||
return addToGrid(child)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
backpackOpenEvent.Event:connect(backpackOpenHandler)
|
|
||||||
backpackCloseEvent.Event:connect(backpackCloseHandler)
|
|
||||||
tabClickedEvent.Event:connect(tabClickHandler)
|
|
||||||
searchRequestedEvent.Event:connect(showSearchGear)
|
|
||||||
return recalculateScrollLoadout()
|
|
||||||
389
yue/89449093.lua
389
yue/89449093.lua
|
|
@ -1,389 +0,0 @@
|
||||||
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
|
|
||||||
1609
yue/97188756.lua
1609
yue/97188756.lua
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue