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
|
||||
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 a,b,c,d,e,f,g,h,i,j,
|
||||
k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=nil,game:GetService'ContentProvider'.BaseUrl:
|
||||
lower(),nil,nil,nil,nil,nil,nil,nil,false,nil,false,true,nil,false,nil,0.3,UDim2
|
||||
.new(0.5,-330,0.5,-200),UDim2.new(0.5,-330,1,25),nil,false,nil,450,{},
|
||||
'http://www.roblox.com/Asset/?id='local z=y..'42557901'table.insert(x,z)local A=
|
||||
y..'104651457'table.insert(x,A)local B=y..'104651515'table.insert(x,B)local C=y
|
||||
..'104651532'table.insert(x,C)local D=y..'104651592'table.insert(x,D)local E=y..
|
||||
'104651639'table.insert(x,E)local F=y..'104651665'table.insert(x,F)local G=y..
|
||||
'104651707'table.insert(x,G)local H=y..'104651733'table.insert(x,H)local I=y..
|
||||
'104651761'table.insert(x,I)local J=y..'102481431'table.insert(x,J)local K=y..
|
||||
'102481419'table.insert(x,K)local L,M,N,O,P,Q,R,S,T,U='Buy','Take',
|
||||
'An Error Occurred','in-game purchases are disabled',
|
||||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=a(b)if c then
|
||||
e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then if g==
|
||||
'Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)=='userdata'
|
||||
then h.Parent=e end end e.Parent=f return e end 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 b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y
|
||||
,z=nil,game:GetService'ContentProvider'.BaseUrl:lower(),nil,nil,nil,nil,nil,nil,
|
||||
nil,false,nil,false,true,nil,false,nil,0.3,UDim2.new(0.5,-330,0.5,-200),UDim2.
|
||||
new(0.5,-330,1,25),nil,false,nil,450,{},nil z=function(A)return
|
||||
'http://www.roblox.com/Asset/?id='..tostring(A)end local A=z'42557901'table.
|
||||
insert(y,A)local B=z'104651457'table.insert(y,B)local C=z'104651515'table.
|
||||
insert(y,C)local D=z'104651532'table.insert(y,D)local E=z'104651592'table.
|
||||
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!',
|
||||
[[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 take the assetType 'itemName' for FREE?",
|
||||
[[Your balance of Robux or Tix will not be affected by this transaction.]]
|
||||
function getSecureApiBaseUrl()local V=b V=string.gsub(V,'http','https')V=string.
|
||||
gsub(V,'www','api')return V end function getRbxUtility()if not a then a=
|
||||
LoadLibrary'RbxUtility'end return a end function preloadAssets()for V=1,#x do
|
||||
game:GetService'ContentProvider':Preload(x[V])end end function
|
||||
removeCurrentPurchaseInfo()d=nil e=nil f=nil g=nil h=nil c=nil i=nil j=false end
|
||||
function closePurchasePrompt()p:TweenPosition(s,Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quad,q,true,function()game.GuiService:RemoveCenterDialog(p)
|
||||
hidePurchasing()p.Visible=false o=false end)end function
|
||||
userPurchaseActionsEnded(V)j=false if V then local W=string.gsub(Q,'itemName',
|
||||
tostring(c['Name']))p.BodyFrame.ItemPreview.ItemDescription.Text=W
|
||||
setButtonsVisible(p.BodyFrame.OkPurchasedButton)hidePurchasing()else
|
||||
signalPromptEnded(V)end end function signalPromptEnded(V)closePurchasePrompt()if
|
||||
l then game:GetService'MarketplaceService':SignalPromptProductPurchaseFinished(
|
||||
game.Players.LocalPlayer.userId,h,V)else game:GetService'MarketplaceService':
|
||||
SignalPromptPurchaseFinished(game.Players.LocalPlayer,d,V)end
|
||||
removeCurrentPurchaseInfo()end function updatePurchasePromptData(V)local W=''if
|
||||
not h then h=c['ProductId']end if isFreeItem()then W=string.gsub(T,'itemName',
|
||||
tostring(c['Name']))W=string.gsub(W,'assetType',tostring(assetTypeToString(c[
|
||||
'AssetTypeId'])))setHeaderText(M)else W=string.gsub(S,'itemName',tostring(c[
|
||||
'Name']))W=string.gsub(W,'currencyType',tostring(currencyTypeToString(e)))W=
|
||||
string.gsub(W,'currencyAmount',tostring(f))setHeaderText(L)end p.BodyFrame.
|
||||
ItemPreview.ItemDescription.Text=W if l then p.BodyFrame.ItemPreview.Image=b..
|
||||
'thumbs/asset.ashx?assetid='..tostring(c['IconImageAssetId'])..
|
||||
'&x=100&y=100&format=png'else p.BodyFrame.ItemPreview.Image=b..
|
||||
'thumbs/asset.ashx?assetid='..tostring(d)..'&x=100&y=100&format=png'end end
|
||||
function doPlayerFundsCheck(V)if j then local W,X=canPurchaseItem()if W and X
|
||||
then local Y=1000 while(Y>0 or V)and X and j and W do wait(0.1)W,X=
|
||||
canPurchaseItem()Y=Y-1 end end if W and not X then setButtonsVisible(p.BodyFrame
|
||||
.BuyButton,p.BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)end end end
|
||||
function showPurchasePrompt()local V,W,X,Y,Z=canPurchaseItem()if V then
|
||||
updatePurchasePromptData()if Y and Z then p.BodyFrame.ItemPreview.
|
||||
ItemDescription.Text=Z p.BodyFrame.AfterBalanceButton.Visible=false end game.
|
||||
GuiService:AddCenterDialog(p,Enum.CenterDialogType.ModalDialog,function()p.
|
||||
Visible=true if isFreeItem()then setButtonsVisible(p.BodyFrame.FreeButton,p.
|
||||
BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)elseif X then p.BodyFrame.
|
||||
AfterBalanceButton.Text=
|
||||
[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]]
|
||||
if not k then k=p.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(
|
||||
function()if p.BodyFrame.AfterBalanceButton.Text==
|
||||
[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]]
|
||||
then openBCUpSellWindow()end end)end setButtonsVisible(p.BodyFrame.
|
||||
BuyDisabledButton,p.BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)elseif
|
||||
W then setButtonsVisible(p.BodyFrame.BuyDisabledButton,p.BodyFrame.CancelButton,
|
||||
p.BodyFrame.AfterBalanceButton)elseif Y then setButtonsVisible(p.BodyFrame.
|
||||
BuyDisabledButton,p.BodyFrame.CancelButton)else setButtonsVisible(p.BodyFrame.
|
||||
BuyButton,p.BodyFrame.CancelButton)end p:TweenPosition(r,Enum.EasingDirection.
|
||||
Out,Enum.EasingStyle.Quad,q,true)if V and W and not m then j=true
|
||||
doPlayerFundsCheck(true)end end,function()p.Visible=false end)else
|
||||
doDeclinePurchase()end end function getToolAssetID(V)local W=game:GetService
|
||||
'InsertService':LoadAsset(V)if not W then return nil end if W:IsA'Tool'then
|
||||
return W end local X=W:GetChildren()for Y=1,#X do if X[Y]:IsA'Tool'then return X
|
||||
[Y]end end return nil end function purchaseFailed(V)local W='Item'if c then W=c[
|
||||
'Name']end local X=string.gsub(R,'itemName',tostring(W))if V then X=string.gsub(
|
||||
X,'errorReason',tostring(O))else X=string.gsub(X,'errorReason',tostring(P))end p
|
||||
.BodyFrame.ItemPreview.ItemDescription.Text=X p.BodyFrame.ItemPreview.Image=z
|
||||
setButtonsVisible(p.BodyFrame.OkButton)setHeaderText(N)hidePurchasing()end
|
||||
function doAcceptPurchase(V)showPurchasing()local W,X,Y=tick(),'none',nil if l
|
||||
then Y=getSecureApiBaseUrl()..'marketplace/submitpurchase?productId='..tostring(
|
||||
h)..'¤cyTypeId='..tostring(currencyEnumToInt(e))..'&expectedUnitPrice='..
|
||||
tostring(f)..'&placeId='..tostring(Game.PlaceId)else Y=getSecureApiBaseUrl()..
|
||||
'marketplace/purchase?productId='..tostring(h)..'¤cyTypeId='..tostring(
|
||||
currencyEnumToInt(e))..'&purchasePrice='..tostring(f)..'&locationType=Game'..
|
||||
'&locationId='..Game.PlaceId end local Z,_=ypcall(function()X=game:
|
||||
HttpPostAsync(Y,'RobloxPurchaseRequest')end)print(
|
||||
'doAcceptPurchase success from ypcall is ',Z,'reason is',_)if(tick()-W)<1 then
|
||||
wait(1)end if X=='none'or X==nil or X==''then print(
|
||||
'did not get a proper response from web on purchase of',d,h)purchaseFailed()
|
||||
return end X=getRbxUtility().DecodeJSON(X)if X then if X['success']==false then
|
||||
if X['status']~='AlreadyOwned'then print(
|
||||
'web return response of fail on purchase of',d,h)purchaseFailed((X['status']==
|
||||
'EconomyDisabled'))return end end else print(
|
||||
'web return response of non parsable JSON on purchase of',d)purchaseFailed()
|
||||
return end if g and Z and d and tonumber(c['AssetTypeId'])==19 then local aa=
|
||||
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=
|
||||
[[Your balance of Robux or Tix will not be affected by this transaction.]],nil W
|
||||
=function()local X=string.gsub(c,'http','https')X=string.gsub(X,'www','api')
|
||||
return X end local X X=function()if not b then b=LoadLibrary'RbxUtility'end
|
||||
return b end local Y Y=function()for Z=1,#y do game:GetService'ContentProvider':
|
||||
Preload(y[Z])end end local Z Z=function()e=nil f=nil g=nil h=nil i=nil d=nil j=
|
||||
nil k=false end local _ _=function()q.PurchasingFrame.Visible=false v=false end
|
||||
local aa aa=function()return q:TweenPosition(t,Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quad,r,true,function()game.GuiService:RemoveCenterDialog(q)_()q.
|
||||
Visible=false p=false end)end local ab ab=function(...)local ac,ad,ae={...},
|
||||
select('#',...),q.BodyFrame:GetChildren()for af=1,#ae do if ae[af]:IsA
|
||||
'GuiButton'then ae[af].Visible=false for ag=1,ad do if ae[af]==ac[ag]then ae[af]
|
||||
.Visible=true break end end end end end local ac ac=function(ad)aa()if m then
|
||||
game:GetService'MarketplaceService':SignalPromptProductPurchaseFinished(game.
|
||||
Players.LocalPlayer.userId,i,ad)else game:GetService'MarketplaceService':
|
||||
SignalPromptPurchaseFinished(game.Players.LocalPlayer,e,ad)end return Z()end
|
||||
local ad ad=function(ae)k=false if ae then local af=string.gsub(R,'itemName',
|
||||
tostring(d['Name']))q.BodyFrame.ItemPreview.ItemDescription.Text=af ab(q.
|
||||
BodyFrame.OkPurchasedButton)return _()else return ac(ae)end end local ae ae=
|
||||
function()return d and d['IsForSale']==true and d['IsPublicDomain']==true end
|
||||
local af af=function(ag)q.TitleLabel.Text=ag q.TitleBackdrop.Text=ag end local
|
||||
ag ag=function(ah)if 1==ah then return'Image'elseif 2==ah then return'T-Shirt'
|
||||
elseif 3==ah then return'Audio'elseif 4==ah then return'Mesh'elseif 5==ah then
|
||||
return'Lua'elseif 6==ah then return'HTML'elseif 7==ah then return'Text'elseif 8
|
||||
==ah then return'Hat'elseif 9==ah then return'Place'elseif 10==ah then return
|
||||
'Model'elseif 11==ah then return'Shirt'elseif 12==ah then return'Pants'elseif 13
|
||||
==ah then return'Decal'elseif 16==ah then return'Avatar'elseif 17==ah then
|
||||
return'Head'elseif 18==ah then return'Face'elseif 19==ah then return'Gear'elseif
|
||||
21==ah then return'Badge'elseif 22==ah then return'Group Emblem'elseif 24==ah
|
||||
then return'Animation'elseif 25==ah then return'Arms'elseif 26==ah then return
|
||||
'Legs'elseif 27==ah then return'Torso'elseif 28==ah then return'Right Arm'elseif
|
||||
29==ah then return'Left Arm'elseif 30==ah then return'Left Leg'elseif 31==ah
|
||||
then return'Right Leg'elseif 32==ah then return'Package'elseif 33==ah then
|
||||
return'YouTube Video'elseif 34==ah then return'Game Pass'elseif 0==ah then
|
||||
return'Product'else return''end end local ah ah=function(ai)if ai==Enum.
|
||||
CurrencyType.Tix then return'Tix'else return'R$'end end local ai ai=function(aj)
|
||||
local ak=''if not i then i=d['ProductId']end if ae()then ak=string.gsub(U,
|
||||
'itemName',tostring(d['Name']))ak=string.gsub(ak,'assetType',tostring(ag(d[
|
||||
'AssetTypeId'])))af(N)else ak=string.gsub(T,'itemName',tostring(d['Name']))ak=
|
||||
string.gsub(ak,'currencyType',tostring(ah(f)))ak=string.gsub(ak,'currencyAmount'
|
||||
,tostring(g))af(M)end q.BodyFrame.ItemPreview.ItemDescription.Text=ak if m then
|
||||
q.BodyFrame.ItemPreview.Image=c..'thumbs/asset.ashx?assetid='..tostring(d[
|
||||
'IconImageAssetId'])..'&x=100&y=100&format=png'else q.BodyFrame.ItemPreview.
|
||||
Image=c..'thumbs/asset.ashx?assetid='..tostring(e)..'&x=100&y=100&format=png'end
|
||||
end local aj aj=function(ak,al)if f==Enum.CurrencyType.Default or f==Enum.
|
||||
CurrencyType.Robux then if(ak~=nil)and ak~=0 then g=ak f=Enum.CurrencyType.Robux
|
||||
else g=al f=Enum.CurrencyType.Tix end elseif f==Enum.CurrencyType.Tix then if(al
|
||||
~=nil)and al~=0 then g=al f=Enum.CurrencyType.Tix else g=ak f=Enum.CurrencyType.
|
||||
Robux end else return false end if not(g~=nil)then return false end return true
|
||||
end local ak ak=function()local al,am,an am,an=pcall(function()al=game:
|
||||
HttpGetAsync(tostring(W())..'currency/balance')end)if not am then print(
|
||||
'Get player balance failed because',an)return nil end if al==''then return nil
|
||||
end al=X().DecodeJSON(al)return al end local al al=function(am)if Enum.
|
||||
MembershipType.None==am then return 0 elseif Enum.MembershipType.BuildersClub==
|
||||
am then return 1 elseif Enum.MembershipType.TurboBuildersClub==am then return 2
|
||||
elseif Enum.MembershipType.OutrageousBuildersClub==am then return 3 else return-
|
||||
1 end end local am am=function()k=true return game:GetService'GuiService':
|
||||
OpenBrowserWindow(tostring(c)..'Upgrades/Robux.aspx')end local an an=function(ao
|
||||
,ap)if ae()then q.BodyFrame.AfterBalanceButton.Text=V return true,false end
|
||||
local aq if f==Enum.CurrencyType.Robux then aq='robux'elseif f==Enum.
|
||||
CurrencyType.Tix then aq='tickets'end if not aq then return false end local ar=
|
||||
tonumber(ao[aq])if not ar then return false end local as=ar-g if not ap then if
|
||||
as<0 and aq=='robux'then if not(o~=nil)then o=q.BodyFrame.AfterBalanceButton.
|
||||
MouseButton1Click:connect(am)end q.BodyFrame.AfterBalanceButton.Text='You need '
|
||||
..tostring(ah(f))..' '..tostring(-as)..
|
||||
' more to buy this, click here to purchase more.'return true,true elseif as<0
|
||||
and aq=='tickets'then q.BodyFrame.AfterBalanceButton.Text='You need '..tostring(
|
||||
-as)..' '..tostring(ah(f))..' more to buy this item.'return true,true end end if
|
||||
o then o:disconnect()o=nil end q.BodyFrame.AfterBalanceButton.Text=
|
||||
'Your balance after this transaction will be '..tostring(ah(f))..' '..tostring(
|
||||
as)..'.'return true,false end local ao ao=function()local ap,aq,ar,as=false,
|
||||
false,nil,false if m then local at as=pcall(function()at=Game:HttpGetAsync(
|
||||
tostring(W())..'marketplace/productDetails?productid='..tostring(i))end)if as
|
||||
then d=X().DecodeJSON(at)end else as=pcall(function()d=game:GetService
|
||||
'MarketplaceService':GetProductInfo(e)end)end if not(d~=nil)or not as then ar=
|
||||
[[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
|
||||
'current asset id is nil, this should always have a value'return false end if d
|
||||
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 e
|
||||
<=0 then print[[current asset id is negative, this should always be positive]]
|
||||
return false end local Y,Z=ypcall(function()aa=game:HttpGetAsync(
|
||||
getSecureApiBaseUrl()..'ownership/hasAsset?userId='..tostring(game.Players.
|
||||
LocalPlayer.userId)..'&assetId='..tostring(d))end)if not Y then print(
|
||||
'could not tell if player owns asset because',Z)return false end if aa==true or
|
||||
aa=='true'then W='You already own this item.'return true,nil,nil,true,W end end
|
||||
p.BodyFrame.AfterBalanceButton.Visible=true if type(c)~='table'then c=
|
||||
getRbxUtility().DecodeJSON(c)end if not c then W=
|
||||
'Could not get product info. Please try again later.'return true,nil,nil,true,W
|
||||
end if c['IsForSale']==false and c['IsPublicDomain']==false then W=
|
||||
'This item is no longer for sale.'return true,nil,nil,true,W end if not
|
||||
setCurrencyAmountAndType(tonumber(c['PriceInRobux']),tonumber(c['PriceInTickets'
|
||||
]))then W=
|
||||
return false end local at,au at,au=pcall(function()ap=game:HttpGetAsync(W()..
|
||||
'ownership/hasAsset?userId='..tostring(game.Players.LocalPlayer.userId)..
|
||||
'&assetId='..tostring(e))end)if not at then print(
|
||||
'could not tell if player owns asset because',au)return false end if ap==true or
|
||||
ap=='true'then ar='You already own this item.'return true,nil,nil,true,ar end
|
||||
end q.BodyFrame.AfterBalanceButton.Visible=true if type(d)~='table'then d=X().
|
||||
DecodeJSON(d)end if not d then ar=
|
||||
'Could not get product info. Please try again later.'return true,nil,nil,true,ar
|
||||
end if d['IsForSale']==false and d['IsPublicDomain']==false then ar=
|
||||
'This item is no longer for sale.'return true,nil,nil,true,ar end if not aj(
|
||||
tonumber(d['PriceInRobux']),tonumber(d['PriceInTickets']))then ar=
|
||||
[[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,
|
||||
true,W end if tonumber(c['MinimumMembershipLevel'])>membershipTypeToNumber(game.
|
||||
Players.LocalPlayer.MembershipType)then V=true end local Z,_=
|
||||
updateAfterBalanceText(Y,V)if V then p.BodyFrame.AfterBalanceButton.Active=true
|
||||
return true,_,V,false end if c['ContentRatingTypeId']==1 then if game.Players.
|
||||
LocalPlayer:GetUnder13()then W=
|
||||
true,ar end if tonumber(d['MinimumMembershipLevel'])>al(game.Players.LocalPlayer
|
||||
.MembershipType)then aq=true end local au,av au,av=an(at,aq)if aq then q.
|
||||
BodyFrame.AfterBalanceButton.Active=true return true,av,aq,false end if d[
|
||||
'ContentRatingTypeId']==1 then if game.Players.LocalPlayer:GetUnder13()then ar=
|
||||
[[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)
|
||||
and(c['Remaining']==''or c['Remaining']==0 or c['Remaining']==nil)then W=
|
||||
,nil,nil,true,ar end end if(d['IsLimited']==true or d['IsLimitedUnique']==true)
|
||||
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.]]
|
||||
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
|
||||
,nil,nil,true,W end p.BodyFrame.AfterBalanceButton.Active=true return true,_ end
|
||||
function startSpinner()u=true Spawn(function()local aa=0 while u do local V=0
|
||||
while V<8 do if V==aa or V==((aa+1)%8)then v[V+1].Image=
|
||||
'http://www.roblox.com/Asset/?id=45880668'else v[V+1].Image=
|
||||
'http://www.roblox.com/Asset/?id=45880710'end V=V+1 end aa=(aa+1)%8 wait(
|
||||
6.666666666666666E-2)end end)end function stopSpinner()u=false end function
|
||||
setButtonsVisible(...)local aa,V,W={...},select('#',...),p.BodyFrame:
|
||||
GetChildren()for X=1,#W do if W[X]:IsA'GuiButton'then W[X].Visible=false for Y=1
|
||||
,V do if W[X]==aa[Y]then W[X].Visible=true break end end end end end function
|
||||
createSpinner(aa,V,W)local X=Instance.new'Frame'X.Name='Spinner'X.Size=aa X.
|
||||
Position=V X.BackgroundTransparency=1 X.ZIndex=10 X.Parent=W v={}local Y=1 while
|
||||
Y<=8 do local Z=Instance.new'ImageLabel'Z.Name='Spinner'..Y Z.Size=UDim2.new(0,
|
||||
16,0,16)Z.Position=UDim2.new(0.5+0.3*math.cos(math.rad(45*Y)),-8,0.5+0.3*math.
|
||||
sin(math.rad(45*Y)),-8)Z.BackgroundTransparency=1 Z.ZIndex=10 Z.Image=
|
||||
'http://www.roblox.com/Asset/?id=45880710'Z.Parent=X v[Y]=Z Y=Y+1 end end
|
||||
function createPurchasePromptGui()p=Instance.new'Frame'p.Name='PurchaseFrame'p.
|
||||
Size=UDim2.new(0,660,0,400)p.Position=s p.Visible=false p.BackgroundColor3=
|
||||
Color3.new(0.5529411764705883,0.5529411764705883,0.5529411764705883)p.
|
||||
BorderColor3=Color3.new(0.8,0.8,0.8)p.Parent=game.CoreGui.RobloxGui local aa=
|
||||
Instance.new'Frame'aa.Name='BodyFrame'aa.Size=UDim2.new(1,0,1,-60)aa.Position=
|
||||
UDim2.new(0,0,0,60)aa.BackgroundColor3=Color3.new(0.2627450980392157,
|
||||
0.2627450980392157,0.2627450980392157)aa.BorderSizePixel=0 aa.ZIndex=8 aa.Parent
|
||||
=p local V=createTextObject('TitleLabel','Buy Item','TextLabel',Enum.FontSize.
|
||||
Size48)V.ZIndex=8 V.Size=UDim2.new(1,0,0,60)local W=V:Clone()W.Name=
|
||||
'TitleBackdrop'W.TextColor3=Color3.new(0.12549019607843137,0.12549019607843137,
|
||||
0.12549019607843137)W.BackgroundTransparency=0 W.BackgroundColor3=Color3.new(
|
||||
0.21176470588235294,0.3764705882352941,0.6705882352941176)W.Position=UDim2.new(0
|
||||
,0,0,-2)W.ZIndex=8 W.Parent=p V.Parent=p local X,Y=90,createImageButton
|
||||
'CancelButton'Y.Position=UDim2.new(0.5,(X/2),1,-120)Y.BackgroundTransparency=1 Y
|
||||
.BorderSizePixel=0 Y.Parent=aa Y.Modal=true Y.ZIndex=8 Y.Image=D Y.
|
||||
MouseButton1Down:connect(function()Y.Image=E end)Y.MouseButton1Up:connect(
|
||||
function()Y.Image=D end)Y.MouseLeave:connect(function()Y.Image=D end)Y.
|
||||
MouseButton1Click:connect(doDeclinePurchase)local Z=createImageButton'BuyButton'
|
||||
Z.Position=UDim2.new(0.5,-153-(X/2),1,-120)Z.BackgroundTransparency=1 Z.
|
||||
BorderSizePixel=0 Z.Image=A Z.ZIndex=8 Z.MouseButton1Down:connect(function()Z.
|
||||
Image=B end)Z.MouseButton1Up:connect(function()Z.Image=A end)Z.MouseLeave:
|
||||
connect(function()Z.Image=A end)Z.Parent=aa local _=Z:Clone()_.Name=
|
||||
'BuyDisabledButton'_.AutoButtonColor=false _.Visible=false _.Active=false _.
|
||||
Image=C _.ZIndex=8 _.Parent=aa local ab=Z:Clone()ab.BackgroundTransparency=1 ab.
|
||||
Name='FreeButton'ab.Visible=false ab.ZIndex=8 ab.Image=H ab.MouseButton1Down:
|
||||
connect(function()ab.Image=I end)ab.MouseButton1Up:connect(function()ab.Image=H
|
||||
end)ab.MouseLeave:connect(function()ab.Image=H end)ab.Parent=aa local ac=Z:
|
||||
Clone()ac.Name='OkButton'ac.BackgroundTransparency=1 ac.Visible=false ac.
|
||||
Position=UDim2.new(0.5,-ac.Size.X.Offset/2,1,-120)ac.Modal=true ac.Image=F ac.
|
||||
ZIndex=8 ac.MouseButton1Down:connect(function()ac.Image=G end)ac.MouseButton1Up:
|
||||
connect(function()ac.Image=F end)ac.MouseLeave:connect(function()ac.Image=F end)
|
||||
ac.Parent=aa local ad=ac:Clone()ad.ZIndex=8 ad.Name='OkPurchasedButton'ad.
|
||||
MouseButton1Down:connect(function()ad.Image=G end)ad.MouseButton1Up:connect(
|
||||
function()ad.Image=F end)ad.MouseLeave:connect(function()ad.Image=F end)ad.
|
||||
Parent=aa ac.MouseButton1Click:connect(function()userPurchaseActionsEnded(false)
|
||||
end)ad.MouseButton1Click:connect(function()if l then
|
||||
userPurchaseProductActionsEnded(true)else signalPromptEnded(true)end end)Z.
|
||||
MouseButton1Click:connect(function()doAcceptPurchase(Enum.CurrencyType.Robux)end
|
||||
)ab.MouseButton1Click:connect(function()doAcceptPurchase(false)end)local ae=
|
||||
Instance.new'ImageLabel'ae.Name='ItemPreview'ae.BackgroundColor3=Color3.new(
|
||||
0.12549019607843137,0.12549019607843137,0.12549019607843137)ae.BorderColor3=
|
||||
Color3.new(0.5529411764705883,0.5529411764705883,0.5529411764705883)ae.Position=
|
||||
UDim2.new(0,30,0,20)ae.Size=UDim2.new(0,180,0,180)ae.ZIndex=9 ae.Parent=aa local
|
||||
af=createTextObject('ItemDescription',
|
||||
,nil,nil,true,ar end q.BodyFrame.AfterBalanceButton.Active=true return true,av
|
||||
end local ap ap=function(aq)if k then local ar,as ar,as=ao()if ar and as then
|
||||
local at=1000 while(at>0 or aq)and as and k and ar do wait(0.1)ar,as=ao()at=at-1
|
||||
end end if ar and not as then return ab(q.BodyFrame.BuyButton,q.BodyFrame.
|
||||
CancelButton,q.BodyFrame.AfterBalanceButton)end end end local aq aq=function()
|
||||
return Game:GetService'GuiService':OpenBrowserWindow(tostring(c)..
|
||||
'Upgrades/BuildersClubMemberships.aspx')end local ar ar=function()return ad(
|
||||
false)end local as as=function()local at,au,av,aw,ax at,au,av,aw,ax=ao()if at
|
||||
then ai()if aw and ax then q.BodyFrame.ItemPreview.ItemDescription.Text=ax q.
|
||||
BodyFrame.AfterBalanceButton.Visible=false end game.GuiService:AddCenterDialog(q
|
||||
,Enum.CenterDialogType.ModalDialog,function()q.Visible=true if ae()then ab(q.
|
||||
BodyFrame.FreeButton,q.BodyFrame.CancelButton,q.BodyFrame.AfterBalanceButton)
|
||||
elseif av then q.BodyFrame.AfterBalanceButton.Text=
|
||||
[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]]
|
||||
if not l then l=q.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(
|
||||
function()if q.BodyFrame.AfterBalanceButton.Text==
|
||||
[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]]
|
||||
then return aq()end end)end ab(q.BodyFrame.BuyDisabledButton,q.BodyFrame.
|
||||
CancelButton,q.BodyFrame.AfterBalanceButton)elseif au then ab(q.BodyFrame.
|
||||
BuyDisabledButton,q.BodyFrame.CancelButton,q.BodyFrame.AfterBalanceButton)elseif
|
||||
aw then ab(q.BodyFrame.BuyDisabledButton,q.BodyFrame.CancelButton)else ab(q.
|
||||
BodyFrame.BuyButton,q.BodyFrame.CancelButton)end q:TweenPosition(s,Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quad,r,true)if at and au and not n then k=
|
||||
true return ap(true)end end,function()q.Visible=false end)return q else return
|
||||
ar()end end local at at=function(au)local av=game:GetService'InsertService':
|
||||
LoadAsset(au)if not av then return nil end if av:IsA'Tool'then return av end
|
||||
local aw=av:GetChildren()for ax=1,#aw do if aw[ax]:IsA'Tool'then return aw[ax]
|
||||
end end return nil end local au au=function(av)local aw='Item'if d then aw=d[
|
||||
'Name']end local ax=string.gsub(S,'itemName',tostring(aw))if av then ax=string.
|
||||
gsub(ax,'errorReason',tostring(P))else ax=string.gsub(ax,'errorReason',tostring(
|
||||
Q))end q.BodyFrame.ItemPreview.ItemDescription.Text=ax q.BodyFrame.ItemPreview.
|
||||
Image=A ab(q.BodyFrame.OkButton)af(O)return _()end local av av=function()v=true
|
||||
return Spawn(function()local aw=0 while v do local ax=0 while ax<8 do w[ax+1].
|
||||
Image='http://www.roblox.com/Asset/?id='..(function()if ax==aw or ax==(aw+1)%8
|
||||
then return'45880668'else return'45880710'end end)()ax=ax+1 end aw=(aw+1)%8
|
||||
wait(6.666666666666666E-2)end end)end local aw aw=function()av()q.
|
||||
PurchasingFrame.Visible=true end local ax ax=function(ay)if ay==Enum.
|
||||
CurrencyType.Robux or ay==Enum.CurrencyType.Default then return 1 elseif ay==
|
||||
Enum.CurrencyType.Tix then return 2 end end local ay ay=function(az)aw()local aA
|
||||
,aB,aC=tick(),'none',nil if m then aC=W()..
|
||||
'marketplace/submitpurchase?productId='..tostring(i)..'¤cyTypeId='..
|
||||
tostring(ax(f))..'&expectedUnitPrice='..tostring(g)..'&placeId='..tostring(Game.
|
||||
PlaceId)else aC=W()..'marketplace/purchase?productId='..tostring(i)..
|
||||
'¤cyTypeId='..tostring(ax(f))..'&purchasePrice='..tostring(g)..
|
||||
'&locationType=Game'..'&locationId='..tostring(Game.PlaceId)end local aD,aE aD,
|
||||
aE=pcall(function()aB=game:HttpPostAsync(aC,'RobloxPurchaseRequest')end)print(
|
||||
'doAcceptPurchase success from ypcall is ',aD,'reason is',aE)if(tick()-aA)<1
|
||||
then wait(1)end if aB=='none'or not(aB~=nil)or aB==''then print(
|
||||
'did not get a proper response from web on purchase of',e,i)au()return end aB=X(
|
||||
).DecodeJSON(aB)if aB then if aB['success']==false then if aB['status']~=
|
||||
'AlreadyOwned'then print('web return response of fail on purchase of',e,i)au(aB[
|
||||
'status']=='EconomyDisabled')return end end else print(
|
||||
'web return response of non parsable JSON on purchase of',e)au()return end if h
|
||||
and aD and e and tonumber(d['AssetTypeId'])==19 then local aF=at(tonumber(e))if
|
||||
aF then aF.Parent=game.Players.LocalPlayer.Backpack end end if m then if not aB[
|
||||
'receipt']then print(
|
||||
[[tried to buy productId, but no receipt returned. productId was]],i)au()return
|
||||
end return Game:GetService'MarketplaceService':SignalClientPurchaseSuccess(
|
||||
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?]],
|
||||
'TextLabel',Enum.FontSize.Size24)af.Position=UDim2.new(1,20,0,0)af.Size=UDim2.
|
||||
new(0,410,1,0)af.ZIndex=8 af.Parent=ae local ag=createTextObject(
|
||||
'AfterBalanceButton','Place holder text ip sum lorem dodo ashs','TextButton',
|
||||
Enum.FontSize.Size24)ag.AutoButtonColor=false ag.TextColor3=Color3.new(
|
||||
0.8705882352941177,0.23137254901960785,0.11764705882352941)ag.Position=UDim2.
|
||||
new(0,5,1,-55)ag.Size=UDim2.new(1,-10,0,50)ag.ZIndex=8 ag.Parent=aa local ah=
|
||||
Instance.new'Frame'ah.Name='PurchasingFrame'ah.Size=UDim2.new(1,0,1,0)ah.
|
||||
BackgroundColor3=Color3.new(0,0,0)ah.BackgroundTransparency=0.2 ah.
|
||||
BorderSizePixel=0 ah.ZIndex=9 ah.Visible=false ah.Active=true ah.Parent=p local
|
||||
ai=createTextObject('PurchasingLabel','Purchasing...','TextLabel',Enum.FontSize.
|
||||
Size48)ai.Size=UDim2.new(1,0,1,0)ai.ZIndex=10 ai.Parent=ah createSpinner(UDim2.
|
||||
new(0,50,0,50),UDim2.new(0.5,-25,0.5,30),ai)end function showPurchasing()
|
||||
startSpinner()p.PurchasingFrame.Visible=true end function hidePurchasing()p.
|
||||
PurchasingFrame.Visible=false stopSpinner()end function createTextObject(aa,ab,
|
||||
ac,ad)local ae=Instance.new(ac)ae.Font=Enum.Font.ArialBold ae.TextColor3=Color3.
|
||||
new(0.8509803921568627,0.8509803921568627,0.8509803921568627)ae.TextWrapped=true
|
||||
ae.Name=aa ae.Text=ab ae.BackgroundTransparency=1 ae.BorderSizePixel=0 ae.
|
||||
FontSize=ad return ae end function createImageButton(aa)local ab=Instance.new
|
||||
'ImageButton'ab.Size=UDim2.new(0,153,0,46)ab.Name=aa return ab end function
|
||||
setHeaderText(aa)p.TitleLabel.Text=aa p.TitleBackdrop.Text=aa end function
|
||||
cutSizeInHalfRecursive(aa)end function doubleSizeRecursive(aa)end function
|
||||
modifyForSmallScreen()cutSizeInHalfRecursive(p)end function modifyForLargeScreen
|
||||
()doubleSizeRecursive(p)end function changeGuiToScreenSize(aa)if aa then
|
||||
modifyForSmallScreen()else modifyForLargeScreen()end end function
|
||||
doPurchasePrompt(aa,ab,ac,ad,ae)if not p then createPurchasePromptGui()end if aa
|
||||
==game.Players.LocalPlayer then if o then return end o=true d=ab h=ae e=ad g=ac
|
||||
l=(h~=nil)showPurchasePrompt()end end function userPurchaseProductActionsEnded(
|
||||
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
|
||||
'TextLabel',Enum.FontSize.Size24)aK.Position=UDim2.new(1,20,0,0)aK.Size=UDim2.
|
||||
new(0,410,1,0)aK.ZIndex=8 aK.Parent=aJ end do local aK=aA('AfterBalanceButton',
|
||||
'Place holder text ip sum lorem dodo ashs','TextButton',Enum.FontSize.Size24)aK.
|
||||
AutoButtonColor=false aK.TextColor3=Color3.new(0.8705882352941177,
|
||||
0.23137254901960785,0.11764705882352941)aK.Position=UDim2.new(0,5,1,-55)aK.Size=
|
||||
UDim2.new(1,-10,0,50)aK.ZIndex=8 aK.Parent=aE end local aK,aL=a('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=q}),aA('PurchasingLabel','Purchasing...','TextLabel',Enum.FontSize.Size48
|
||||
)aL.Size=UDim2.new(1,0,1,0)aL.ZIndex=10 aL.Parent=aK return az(UDim2.new(0,50,0,
|
||||
50),UDim2.new(0.5,-25,0.5,30),aL)end local aE aE=function(aF)end local aF aF=
|
||||
function(aG)end local aG aG=function(aH)if aH then return aE(q)else return aF(q)
|
||||
end end local aH aH=function(aI,aJ,aK,aL,aM)if not q then aD()end if aI==game.
|
||||
Players.LocalPlayer then if p then return end p=true e=aJ i=aM f=aL h=aK m=(i~=
|
||||
nil)return as()end end local aI aI=function(aJ)if not aJ then print
|
||||
'Server response table was nil, cancelling purchase'au()return end if aJ[
|
||||
'playerId']and tonumber(aJ['playerId'])==game.Players.LocalPlayer.userId then j=
|
||||
aJ return aC(false)end end Y()game:GetService'MarketplaceService'.
|
||||
PromptProductPurchaseRequested:connect(function(aJ,aK,aL,aM)return aH(aJ,nil,aL,
|
||||
aM,aK)end)Game:GetService'MarketplaceService'.PromptPurchaseRequested:connect(
|
||||
function(aJ,aK,aL,aM)return aH(aJ,aK,aL,aM,nil)end)Game:GetService
|
||||
'MarketplaceService'.ServerPurchaseVerification:connect(function(aJ)return aI(aJ
|
||||
)end)if n then Game:GetService'GuiService'.BrowserWindowClosed:connect(function(
|
||||
)return ap(false)end)end Game.CoreGui.RobloxGui.Changed:connect(function()local
|
||||
aJ=game.CoreGui.RobloxGui.AbsoluteSize.Y<=x if aJ and not u then aG(true)elseif
|
||||
not aJ and u then aG(false)end u=aJ end)u=game.CoreGui.RobloxGui.AbsoluteSize.Y
|
||||
<=x if u then return aG(true)end
|
||||
|
|
@ -1,52 +1,51 @@
|
|||
local a,b,c,d,e,f,g,h,i,j=Game:GetService'ContextActionService',Game:GetService
|
||||
'UserInputService'.TouchEnabled,{},{},nil,nil,
|
||||
'http://www.banland.xyz/asset/?id=97166756',
|
||||
'http://www.banland.xyz/asset/?id=97166444',{},{[1]=UDim2.new(0,123,0,70),[2]=
|
||||
UDim2.new(0,30,0,60),[3]=UDim2.new(0,180,0,160),[4]=UDim2.new(0,85,0,-25),[5]=
|
||||
UDim2.new(0,185,0,-25),[6]=UDim2.new(0,185,0,260),[7]=UDim2.new(0,216,0,65)}
|
||||
local k=#j Game:GetService'ContentProvider':Preload(g)Game:GetService
|
||||
'ContentProvider':Preload(h)while not Game.Players do wait()end while not Game.
|
||||
Players.LocalPlayer do wait()end function createContextActionGui()if not e and b
|
||||
then e=Instance.new'ScreenGui'e.Name='ContextActionGui'f=Instance.new'Frame'f.
|
||||
BackgroundTransparency=1 f.Size=UDim2.new(0.3,0,0.5,0)f.Position=UDim2.new(0.7,0
|
||||
,0.5,0)f.Name='ContextButtonFrame'f.Parent=e end end function contextButtonDown(
|
||||
l,m,n)if m.UserInputType==Enum.UserInputType.Touch then l.Image=g a:
|
||||
CallFunction(n,Enum.UserInputState.Begin,m)end end function contextButtonMoved(l
|
||||
,m,n)if m.UserInputType==Enum.UserInputType.Touch then l.Image=g a:CallFunction(
|
||||
n,Enum.UserInputState.Change,m)end end function contextButtonUp(l,m,n)l.Image=h
|
||||
if m.UserInputType==Enum.UserInputType.Touch and m.UserInputState==Enum.
|
||||
UserInputState.End then a:CallFunction(n,Enum.UserInputState.End,m)end end
|
||||
function isSmallScreenDevice()return Game:GetService'GuiService':
|
||||
GetScreenResolution().y<=320 end function createNewButton(l,m)local n=Instance.
|
||||
new'ImageButton'n.Name='ContextActionButton'n.BackgroundTransparency=1 n.Size=
|
||||
UDim2.new(0,90,0,90)n.Active=true if isSmallScreenDevice()then n.Size=UDim2.new(
|
||||
0,70,0,70)end n.Image=h n.Parent=f local o=nil Game:GetService'UserInputService'
|
||||
.InputEnded:connect(function(p)i[p]=nil end)n.InputBegan:connect(function(p)if i
|
||||
[p]then return end if p.UserInputState==Enum.UserInputState.Begin and o==nil
|
||||
then o=p contextButtonDown(n,p,l)end end)n.InputChanged:connect(function(p)if i[
|
||||
p]then return end if o~=p then return end contextButtonMoved(n,p,l)end)n.
|
||||
InputEnded:connect(function(p)if i[p]then return end if o~=p then return end o=
|
||||
nil i[p]=true contextButtonUp(n,p,l)end)local p=Instance.new'ImageLabel'p.Name=
|
||||
'ActionIcon'p.Position=UDim2.new(0.175,0,0.175,0)p.Size=UDim2.new(0.65,0,0.65,0)
|
||||
p.BackgroundTransparency=1 if m['image']and type(m['image'])=='string'then p.
|
||||
Image=m['image']end p.Parent=n local q=Instance.new'TextLabel'q.Name=
|
||||
'ActionTitle'q.Size=UDim2.new(1,0,1,0)q.BackgroundTransparency=1 q.Font=Enum.
|
||||
Font.SourceSansBold q.TextColor3=Color3.new(1,1,1)q.TextStrokeTransparency=0 q.
|
||||
FontSize=Enum.FontSize.Size18 q.TextWrapped=true q.Text=''if m['title']and type(
|
||||
m['title'])=='string'then q.Text=m['title']end q.Parent=n return n end function
|
||||
createButton(l,m)local n,o=createNewButton(l,m),nil for p=1,#d do if d[p]==
|
||||
'empty'then o=p break end end if not o then o=#d+1 end if o>k then return end d[
|
||||
o]=n c[l]['button']=n n.Position=j[o]n.Parent=f if e and e.Parent==nil then e.
|
||||
Parent=Game.Players.LocalPlayer.PlayerGui end end function removeAction(l)if not
|
||||
c[l]then return end local m=c[l]['button']if m then m.Parent=nil for n=1,#d do
|
||||
if d[n]==m then d[n]='empty'break end end m:Destroy()end c[l]=nil end function
|
||||
addAction(l,m,n)if c[l]then removeAction(l)end c[l]={n}if m and b then
|
||||
createContextActionGui()createButton(l,n)end end a.BoundActionChanged:connect(
|
||||
function(l,m,n)if c[l]and n then local o=c[l]['button']if o then if m=='image'
|
||||
then o.ActionIcon.Image=n[m]elseif m=='title'then o.ActionTitle.Text=n[m]elseif
|
||||
m=='position'then o.Position=n[m]end end end end)a.BoundActionAdded:connect(
|
||||
function(l,m,n)addAction(l,m,n)end)a.BoundActionRemoved:connect(function(l,m)
|
||||
removeAction(l)end)a.GetActionButtonEvent:connect(function(l)if c[l]then a:
|
||||
FireActionButtonFoundSignal(l,c[l]['button'])end end)local l=a:
|
||||
GetAllBoundActionInfo()for m,n in pairs(l)do addAction(m,n['createTouchButton'],
|
||||
n)end
|
||||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||
'userdata'then h.Parent=e end end e.Parent=f return e end local b,c,d,e,f,g,h,i,
|
||||
j,k=Game:GetService'ContextActionService',Game:GetService'UserInputService'.
|
||||
TouchEnabled,{},{},nil,nil,'http://www.banland.xyz/asset/?id=97166756',
|
||||
'http://www.banland.xyz/asset/?id=97166444',{},{UDim2.new(0,123,0,70),UDim2.new(
|
||||
0,30,0,60),UDim2.new(0,180,0,160),UDim2.new(0,85,0,-25),UDim2.new(0,185,0,-25),
|
||||
UDim2.new(0,185,0,260),UDim2.new(0,216,0,65)}local l=#k do local m=Game:
|
||||
GetService'ContentProvider'm:Preload(h)m:Preload(i)end while not Game.Players do
|
||||
wait()end while not Game.Players.LocalPlayer do wait()end local m m=function()if
|
||||
not f and c then f=a('ScreenGui','ContextActionGui',{a('Frame',
|
||||
'ContextButtonFrame',{BackgroundTransparency=1,Size=UDim2.new(0.3,0,0.5,0),
|
||||
Position=UDim2.new(0.7,0,0.5,0)})})end end local n n=function(o,p,q)if p.
|
||||
UserInputType==Enum.UserInputType.Touch then o.Image=h return b:CallFunction(q,
|
||||
Enum.UserInputState.Begin)end end local o o=function(p,q,r)if q.UserInputType==
|
||||
Enum.UserInputType.Touch then p.Image=h return b:CallFunction(r,Enum.
|
||||
UserInputState.Change)end end local p p=function(q,r,s)q.Image=i if r.
|
||||
UserInputType==Enum.UserInputType.Touch and r.UserInputState==Enum.
|
||||
UserInputState.End then return b:CallFunction(s,Enum.UserInputState.End,r)end
|
||||
end local q q=function()return Game:GetService'GuiService':GetScreenResolution()
|
||||
.y<=320 end local r r=function(s,t)local u,v=a('ImageButton',
|
||||
'ContextActionButton',{BackgroundTransparency=1,Size=UDim2.new((function()if q()
|
||||
then return 0,90,0,90 else return 0,70,0,70 end end)()),Active=true,Image=i,
|
||||
Parent=g}),nil Game:GetService'UserInputService'.InputEnded:connect(function(w)j
|
||||
[w]=nil end)u.InputBegan:connect(function(w)if j[w]then return end if w.
|
||||
UserInputState==Enum.UserInputState.Begin and not(v~=nil)then v=w return n(u,w,s
|
||||
)end end)u.InputChanged:connect(function(w)if j[w]or v~=w then return end return
|
||||
o(u,w,s)end)u.InputEnded:connect(function(w)if j[w]or v~=w then return end v=nil
|
||||
j[w]=true return p(u,w,s)end)local w=a('ImageLabel','ActionIcon',{Position=UDim2
|
||||
.new(0.175,0,0.175,0),Size=UDim2.new(0.65,0,0.65,0),BackgroundTransparency=1})if
|
||||
t['image']and type(t['image'])=='string'then w.Image=t['image']end w.Parent=u
|
||||
local x=a('TextLabel','ActionTitle',{Size=UDim2.new(1,0,1,0),
|
||||
BackgroundTransparency=1,Font=Enum.Font.SourceSansBold,TextColor3=Color3.new(1,1
|
||||
,1),TextStrokeTransparency=0,FontSize=Enum.FontSize.Size18,TextWrapped=true,Text
|
||||
=''})if t['title']and type(t['title'])=='string'then x.Text=t['title']end x.
|
||||
Parent=u return u end local s s=function(t,u)local v,w=r(t,u),nil for x=1,#e do
|
||||
if e[x]=='empty'then w=x break end end if not w then w=#e+1 end if w>l then
|
||||
return end e[w]=v d[t]['button']=v v.Position=k[w]v.Parent=g if f and not(f.
|
||||
Parent~=nil)then f.Parent=Game.Players.LocalPlayer.PlayerGui end end local t t=
|
||||
function(u)if not d[u]then return end local v=d[u]['button']if v then v.Parent=
|
||||
nil for w=1,#e do if e[w]==v then e[w]='empty'break end end v:Destroy()end d[u]=
|
||||
nil end local u u=function(v,w,x)if d[v]then t(v)end d[v]={x}if w and c then m()
|
||||
return s(v,x)end end b.BoundActionChanged:connect(function(v,w,x)if d[v]and x
|
||||
then do local y=d[v]['button']if y then if w=='image'then y.ActionIcon.Image=x[w
|
||||
]elseif w=='title'then y.ActionTitle.Text=x[w]elseif w=='position'then y.
|
||||
Position=x[w]end end end end end)b.BoundActionAdded:connect(function(v,w,x)
|
||||
return u(v,w,x)end)b.BoundActionRemoved:connect(function(v,w)return t(v)end)b.
|
||||
GetActionButtonEvent:connect(function(v)if d[v]then return b:
|
||||
FireActionButtonFoundSignal(v,d[v]['button'])end end)local v=b:
|
||||
GetAllBoundActionInfo()for w,x in pairs(v)do u(w,x['createTouchButton'],x)end
|
||||
|
|
@ -1,112 +1,104 @@
|
|||
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 a=Game:GetService'UserInputService'local b=pcall(function()a:
|
||||
IsLuaTouchControls()end)if not b then script:Destroy()end local c=Game:
|
||||
GetService'GuiService':GetScreenResolution()function isSmallScreenDevice()return
|
||||
c.y<=320 end local d,e=Game.Players.LocalPlayer,120 if isSmallScreenDevice()then
|
||||
e=70 end local f,g,h,i,j='rbxasset://textures/ui/TouchControlsSheet.png',5,0.92,
|
||||
{},90 if isSmallScreenDevice()then j=70 end local k,l,m={},nil,0.007 local n,o,p
|
||||
,q=m*16,0.03,0.2,nil Game:GetService'ContentProvider':Preload(f)function
|
||||
DistanceBetweenTwoPoints(r,s)local t,u=s.x-r.x,s.y-r.y return math.sqrt((t*t)+(u
|
||||
*u))end function transformFromCenterToTopLeft(r,s)return UDim2.new(0,r.x-s.
|
||||
AbsoluteSize.x/2,0,r.y-s.AbsoluteSize.y/2)end function rotatePointAboutLocation(
|
||||
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
|
||||
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
|
||||
dotProduct(r,s)return((r.x*s.x)+(r.y*s.y))end function
|
||||
stationaryThumbstickTouchMove(r,s,t)local u=Vector2.new(s.Position.X.Offset+s.
|
||||
AbsoluteSize.x/2,s.Position.Y.Offset+s.AbsoluteSize.y/2)local v=
|
||||
DistanceBetweenTwoPoints(t,u)if v>(e/2)then local w=Vector2.new(t.x-u.x,t.y-u.y)
|
||||
local x=w.unit if x.x==math.nan or x.x==math.inf then x=Vector2.new(0,x.y)end if
|
||||
x.y==math.nan or x.y==math.inf then x=Vector2.new(x.x,0)end local y=u+(x*(e/2))r
|
||||
.Position=transformFromCenterToTopLeft(y,r)else r.Position=
|
||||
transformFromCenterToTopLeft(t,r)end return Vector2.new(r.Position.X.Offset-s.
|
||||
Position.X.Offset,r.Position.Y.Offset-s.Position.Y.Offset)end function
|
||||
followThumbstickTouchMove(r,s,t)local u=Vector2.new(s.Position.X.Offset+s.
|
||||
AbsoluteSize.x/2,s.Position.Y.Offset+s.AbsoluteSize.y/2)if
|
||||
DistanceBetweenTwoPoints(t,u)>e/2 then local v=Vector2.new(r.Position.X.Offset+r
|
||||
.AbsoluteSize.x/2,r.Position.Y.Offset+r.AbsoluteSize.y/2)local w,x=Vector2.new(t
|
||||
.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-v.x,t.y-v.y)local A=(y.x*w.y)-(y.y*w.x)local B=math.atan2(A,dotProduct(y,w))
|
||||
local C=B*math.min(z.magnitude/x.magnitude,1)if math.abs(C)>0.00001 then local D
|
||||
=rotatePointAboutLocation(u,v,C)s.Position=transformFromCenterToTopLeft(Vector2.
|
||||
new(D.x,D.y),s)end s.Position=UDim2.new(0,s.Position.X.Offset+z.x,0,s.Position.Y
|
||||
.Offset+z.y)end r.Position=transformFromCenterToTopLeft(t,r)local v,w=Vector2.
|
||||
new(r.Position.X.Offset,r.Position.Y.Offset),Vector2.new(s.Position.X.Offset,s.
|
||||
Position.Y.Offset)if DistanceBetweenTwoPoints(v,w)>e/2 then local x=(w-v).unit*e
|
||||
/2 s.Position=UDim2.new(0,v.x+x.x,0,v.y+x.y)end return Vector2.new(r.Position.X.
|
||||
Offset-s.Position.X.Offset,r.Position.Y.Offset-s.Position.Y.Offset)end function
|
||||
movementOutsideDeadZone(r)return((math.abs(r.x)>g)or(math.abs(r.y)>g))end
|
||||
function constructThumbstick(r,s,t)local u=Instance.new'Frame'u.Name=
|
||||
'ThumbstickFrame'u.Active=true u.Size=UDim2.new(0,e,0,e)u.Position=r u.
|
||||
BackgroundTransparency=1 local v=Instance.new'ImageLabel'v.Name=
|
||||
'OuterThumbstick'v.Image=f v.ImageRectOffset=Vector2.new(0,0)v.ImageRectSize=
|
||||
Vector2.new(220,220)v.BackgroundTransparency=1 v.Size=UDim2.new(0,e,0,e)v.
|
||||
Position=r v.Parent=Game.CoreGui.RobloxGui local w=Instance.new'ImageLabel'w.
|
||||
Name='InnerThumbstick'w.Image=f w.ImageRectOffset=Vector2.new(220,0)w.
|
||||
ImageRectSize=Vector2.new(111,111)w.BackgroundTransparency=1 w.Size=UDim2.new(0,
|
||||
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
|
||||
.Parent=u w.ZIndex=2 local x,y,z=nil,nil,nil local A=function(A)if x then return
|
||||
end if A==q then return end if A==l then return end if A.UserInputType~=Enum.
|
||||
UserInputType.Touch then return end x=A table.insert(i,x)u.Position=
|
||||
transformFromCenterToTopLeft(x.Position,u)v.Position=u.Position y=a.TouchMoved:
|
||||
connect(function(B)if B==x then local C=nil if t then C=
|
||||
stationaryThumbstickTouchMove(u,v,Vector2.new(B.Position.x,B.Position.y))else C=
|
||||
followThumbstickTouchMove(u,v,Vector2.new(B.Position.x,B.Position.y))end if s
|
||||
then s(C,v.Size.X.Offset/2)end end end)z=a.TouchEnded:connect(function(B)if B==x
|
||||
then if s then s(Vector2.new(0,0),1)end z:disconnect()y:disconnect()u.Position=r
|
||||
v.Position=r for C,D in pairs(i)do if D==x then table.remove(i,C)break end end x
|
||||
=nil end end)end a.Changed:connect(function(B)if B=='ModalEnabled'then u.Visible
|
||||
=not a.ModalEnabled v.Visible=not a.ModalEnabled end end)u.InputBegan:connect(A)
|
||||
return u end function setupCharacterMovement(r)local s,t=nil local u=d.
|
||||
MoveCharacter local v,w=function(v,w)if d then if movementOutsideDeadZone(v)then
|
||||
s=v t=w if v.magnitude/w>h then w=v.magnitude-1 end u(d,v,w)else s=Vector2.new(0
|
||||
,0)t=1 u(d,s,t)end end end,UDim2.new(0,e/2,1,-e*1.75)if isSmallScreenDevice()
|
||||
then w=UDim2.new(0,(e/2)-10,1,-e-20)end local x=constructThumbstick(w,v,false)x.
|
||||
Name='CharacterThumbstick'x.Parent=r local y=function()if d and u and s and t
|
||||
then u(d,s,t)end end return y end function setupJumpButton(r)local s=Instance.
|
||||
new'ImageButton's.Name='JumpButton's.BackgroundTransparency=1 s.Image=f s.
|
||||
ImageRectOffset=Vector2.new(176,222)s.ImageRectSize=Vector2.new(174,174)s.Size=
|
||||
UDim2.new(0,j,0,j)if isSmallScreenDevice()then s.Position=UDim2.new(1,-(j*2.25),
|
||||
1,-j-20)else s.Position=UDim2.new(1,-(j*2.75),1,-j-120)end local t=d.
|
||||
JumpCharacter local u=function()while l do if d then t(d)end wait(
|
||||
1.6666666666666665E-2)end end s.InputBegan:connect(function(v)if v.UserInputType
|
||||
~=Enum.UserInputType.Touch then return end if l then return end if v==q then
|
||||
return end for w,x in pairs(k)do if x==v then return end end l=v s.
|
||||
ImageRectOffset=Vector2.new(0,222)s.ImageRectSize=Vector2.new(174,174)u()end)s.
|
||||
InputEnded:connect(function(v)if v.UserInputType~=Enum.UserInputType.Touch then
|
||||
return end s.ImageRectOffset=Vector2.new(176,222)s.ImageRectSize=Vector2.new(174
|
||||
,174)if v==l then table.insert(k,l)l=nil end end)a.InputEnded:connect(function(v
|
||||
)for w,x in pairs(k)do if x==v then table.remove(k,w)break end end end)a.Changed
|
||||
:connect(function(v)if v=='ModalEnabled'then s.Visible=not a.ModalEnabled end
|
||||
end)s.Parent=r end function isTouchUsedByJumpButton(r)if r==l then return true
|
||||
end for s,t in pairs(k)do if r==t then return true end end return false end
|
||||
function isTouchUsedByThumbstick(r)for s,t in pairs(i)do if r==t then return
|
||||
true end end return false end function setupCameraControl(r,s)local t,u,v,w,x,y,
|
||||
z,A,B=nil,false,a.RotateCamera,-1,false,nil,a.ZoomCamera,{},nil local C,D=
|
||||
function()q=nil u=false t=nil end,function()A={}y=nil x=false B:Destroy()B=nil
|
||||
end local E=function(E,F)if B then B:Destroy()end B=Instance.new'Frame'B.Name=
|
||||
'PinchFrame'B.BackgroundTransparency=1 B.Parent=r B.Size=UDim2.new(1,0,1,0)B.
|
||||
InputChanged:connect(function(G)if not x then D()return end C()if y==nil then if
|
||||
G==E then y=(G.Position-F.Position).magnitude E=G elseif G==F then y=(G.Position
|
||||
-E.Position).magnitude F=G end else local H=0 if G==E then H=(G.Position-F.
|
||||
Position).magnitude E=G elseif G==F then H=(G.Position-E.Position).magnitude F=G
|
||||
end if H~=0 then local I=H-y if I~=0 then z(a,(I*o))end y=H end end end)B.
|
||||
InputEnded:connect(function(G)if G==E or G==F then D()end end)end local F=
|
||||
function(F)if#A<1 then table.insert(A,F)w=tick()x=false elseif#A==1 then x=((
|
||||
tick()-w)<=p)if x then table.insert(A,F)E(A[1],A[2])else A={}end end end r.
|
||||
InputBegan:connect(function(G)if G.UserInputType~=Enum.UserInputType.Touch then
|
||||
return end if isTouchUsedByJumpButton(G)then return end local H=
|
||||
isTouchUsedByThumbstick(G)if not H then F(G)end if q==nil and not H then q=G t=
|
||||
Vector2.new(q.Position.x,q.Position.y)end end)a.InputChanged:connect(function(G)
|
||||
if G.UserInputType~=Enum.UserInputType.Touch then return end if q~=G then return
|
||||
end local H=Vector2.new(q.Position.x,q.Position.y)local I=(t-H)*m if not u and(I
|
||||
.magnitude>n)then u=true t=H end if u and(t~=H)then v(a,I)s()t=H end end)a.
|
||||
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
|
||||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||
'userdata'then h.Parent=e end end e.Parent=f return e end while not Game do
|
||||
wait()end while not Game:FindFirstChild'Players'do wait()end while not Game.
|
||||
Players.LocalPlayer do wait()end while not Game:FindFirstChild'CoreGui'do wait()
|
||||
end while not Game.CoreGui:FindFirstChild'RobloxGui'do wait()end local b=Game:
|
||||
GetService'UserInputService'local c=pcall(function()return b:IsLuaTouchControls(
|
||||
)end)if not c then script:Destroy()end local d,e=Game:GetService'GuiService':
|
||||
GetScreenResolution(),nil e=function()return d.y<=320 end local f,g=Game.Players
|
||||
.LocalPlayer,120 if e()then g=70 end local h,i,j,k,l=
|
||||
'rbxasset://textures/ui/TouchControlsSheet.png',5,0.92,{},90 if e()then l=70 end
|
||||
local m,n,o={},nil,0.007 local p,q,r,s=o*16,0.03,0.2,nil Game:GetService
|
||||
'ContentProvider':Preload(h)local t t=function(u,v)local w,x=v.x-u.x,v.y-u.y
|
||||
return math.sqrt(w*w+x*x)end local u u=function(v,w)return UDim2.new(0,v.x-w.
|
||||
AbsoluteSize.x/2,0,v.y-w.AbsoluteSize.y/2)end local v v=function(w,x,y)local z,A
|
||||
,B=math.sin(y),math.cos(y),w B=Vector2.new(B.x-x.x,B.y-x.y)local C,D=B.x*A-B.y*z
|
||||
,B.x*z+B.y*A B=Vector2.new(C+x.x,D+x.y)return B end local w w=function(x,y)
|
||||
return x.x*y.x+x.y*y.y end local x x=function(y,z,A)local B=Vector2.new(z.
|
||||
Position.X.Offset+z.AbsoluteSize.x/2,z.Position.Y.Offset+z.AbsoluteSize.y/2)
|
||||
local C=t(A,B)if C>(g/2)then local D=Vector2.new(A.x-B.x,A.y-B.y)local E=D.unit
|
||||
if E.x==math.nan or E.x==math.inf then E=Vector2.new(0,E.y)end if E.y==math.nan
|
||||
or E.y==math.inf then E=Vector2.new(E.x,0)end local F=B+(E*(g/2))y.Position=u(F,
|
||||
y)else y.Position=u(A,y)end return Vector2.new(y.Position.X.Offset-z.Position.X.
|
||||
Offset,y.Position.Y.Offset-z.Position.Y.Offset)end local y y=function(z,A,B)
|
||||
local C=Vector2.new(A.Position.X.Offset+A.AbsoluteSize.x/2,A.Position.Y.Offset+A
|
||||
.AbsoluteSize.y/2)if t(B,C)>g/2 then local D=Vector2.new(z.Position.X.Offset+z.
|
||||
AbsoluteSize.x/2,z.Position.Y.Offset+z.AbsoluteSize.y/2)local E,F=Vector2.new(B.
|
||||
x-D.x,B.y-D.y).unit,Vector2.new(D.x-C.x,D.y-C.y)local G,H=F.unit,Vector2.new(B.x
|
||||
-D.x,B.y-D.y)local I=(G.x*E.y)-(G.y*E.x)local J=math.atan2(I,w(G,E))local K=J*
|
||||
math.min(H.magnitude/F.magnitude,1)if math.abs(K)>0.00001 then local L=v(C,D,K)A
|
||||
.Position=u(Vector2.new(L.x,L.y),A)end A.Position=UDim2.new(0,A.Position.X.
|
||||
Offset+H.x,0,A.Position.Y.Offset+H.y)end z.Position=u(B,z)local D,E=Vector2.new(
|
||||
z.Position.X.Offset,z.Position.Y.Offset),Vector2.new(A.Position.X.Offset,A.
|
||||
Position.Y.Offset)if t(D,E)>g/2 then local F=(E-D).unit*g/2 A.Position=UDim2.
|
||||
new(0,D.x+F.x,0,D.y+F.y)end return Vector2.new(z.Position.X.Offset-A.Position.X.
|
||||
Offset,z.Position.Y.Offset-A.Position.Y.Offset)end local z z=function(A)return(
|
||||
math.abs(A.x)>i)or(math.abs(A.y)>i)end local A A=function(B,C,D)local E=a(
|
||||
'Frame','ThumbstickFrame',{Active=true,Size=UDim2.new(0,g,0,g),Position=B,
|
||||
BackgroundTransparency=1})a('ImageLabel','InnerThumbstick',{Image=h,
|
||||
ImageRectOffset=Vector2.new(220,0),ImageRectSize=Vector2.new(111,111),
|
||||
BackgroundTransparency=1,Size=UDim2.new(0,g/2,0,g/2),Position=UDim2.new(0,E.Size
|
||||
.X.Offset/2-g/4,0,E.Size.Y.Offset/2-g/4),ZIndex=2,Parent=E})local F,G,H,I,J=a(
|
||||
'ImageLabel','OuterThumbstick',{Image=h,ImageRectOffset=Vector2.new(0,0),
|
||||
ImageRectSize=Vector2.new(220,220),BackgroundTransparency=1,Size=UDim2.new(0,g,0
|
||||
,g),Position=B,Parent=Game.CoreGui.RobloxGui}),nil,nil,nil,nil J=function(K)if G
|
||||
then return end if K==s then return end if K==n then return end if K.
|
||||
UserInputType~=Enum.UserInputType.Touch then return end G=K table.insert(k,G)E.
|
||||
Position=u(G.Position,E)F.Position=E.Position H=b.TouchMoved:connect(function(L)
|
||||
if L==G then local M if D then M=x(E,F,Vector2.new(L.Position.x,L.Position.y))
|
||||
else M=y(E,F,Vector2.new(L.Position.x,L.Position.y))end if C then return C(M,F.
|
||||
Size.X.Offset/2)end end end)I=b.TouchEnded:connect(function(L)if L==G then if C
|
||||
then C(Vector2.new(0,0),1)end I:disconnect()H:disconnect()E.Position=B F.
|
||||
Position=B for M,N in pairs(k)do if N==G then table.remove(k,M)break end end G=
|
||||
nil end end)end b.Changed:connect(function(K)if K=='ModalEnabled'then do local L
|
||||
=not b.ModalEnabled E.Visible=L F.Visible=L end end end)E.InputBegan:connect(J)
|
||||
return E end local B B=function(C)local D,E,F,G=nil,nil,f.MoveCharacter,nil G=
|
||||
function(H,I)if f then if z(H)then D=H E=I if H.magnitude/I>j then I=H.magnitude
|
||||
-1 end return F(f,H,I)else D=Vector2.new(0,0)E=1 return F(f,D,E)end end end
|
||||
local H=UDim2.new(0,g/2,1,-g*1.75)if e()then H=UDim2.new(0,(g/2)-10,1,-g-20)end
|
||||
local I=A(H,G,false)I.Name='CharacterThumbstick'I.Parent=C local J J=function()
|
||||
if f and F and D and E then return F(f,D,E)end end return J end local C C=
|
||||
function(D)local E,F,G=a('ImageButton','JumpButton',{BackgroundTransparency=1,
|
||||
Image=h,ImageRectOffset=Vector2.new(176,222),ImageRectSize=Vector2.new(174,174),
|
||||
Size=UDim2.new(0,l,0,l),Position=UDim2.new(1,(function()if e()then return-(l*
|
||||
2.25),1,-l-20 else return-(l*2.75),1,-l-120 end end)())}),f.JumpCharacter,nil G=
|
||||
function()while n do if f then F(f)end wait(1.6666666666666665E-2)end end E.
|
||||
InputBegan:connect(function(H)if H.UserInputType~=Enum.UserInputType.Touch then
|
||||
return end if n then return end if H==s then return end for I,J in pairs(m)do if
|
||||
J==H then return end end n=H E.ImageRectOffset=Vector2.new(0,222)E.ImageRectSize
|
||||
=Vector2.new(174,174)return G()end)E.InputEnded:connect(function(H)if H.
|
||||
UserInputType~=Enum.UserInputType.Touch then return end E.ImageRectOffset=
|
||||
Vector2.new(176,222)E.ImageRectSize=Vector2.new(174,174)if H==n then table.
|
||||
insert(m,n)n=nil end end)b.InputEnded:connect(function(H)for I,J in pairs(m)do
|
||||
if J==H then table.remove(m,I)break end end end)b.Changed:connect(function(H)if
|
||||
H=='ModalEnabled'then E.Visible=not b.ModalEnabled end end)E.Parent=D end local
|
||||
D D=function(E)if E==n then return true end for F,G in pairs(m)do if E==G then
|
||||
return true end end return false end local E E=function(F)for G,H in pairs(k)do
|
||||
if F==H then return true end end return false end local F F=function(G,H)local I
|
||||
,J,K,L,M,N,O,P,Q,R=nil,false,b.RotateCamera,-1,false,nil,b.ZoomCamera,{},nil,nil
|
||||
R=function()s=nil J=false I=nil end local S S=function()P={}N=nil M=false Q:
|
||||
Destroy()Q=nil end local T T=function(U,V)if Q~=nil then Q:Destroy()end Q=a(
|
||||
'Frame',{Name='PinchFrame',BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),
|
||||
Parent=G})Q.InputChanged:connect(function(W)if not M then S()return end R()if
|
||||
not(N~=nil)then if W==U then N=(W.Position-V.Position).magnitude U=W elseif W==V
|
||||
then N=(W.Position-U.Position).magnitude V=W end else local X=0 if W==U then X=(
|
||||
W.Position-V.Position).magnitude U=W elseif W==V then X=(W.Position-U.Position).
|
||||
magnitude V=W end if X~=0 then local Y=X-N if Y~=0 then O(b,(Y*q))end N=X end
|
||||
end end)return Q.InputEnded:connect(function(W)if W==U or W==V then return S()
|
||||
end end)end local U U=function(V)if#P<1 then table.insert(P,V)L=tick()M=false
|
||||
elseif#P==1 then M=((tick()-L)<=r)if M then table.insert(P,V)return T(P[1],P[2])
|
||||
else P={}end end end G.InputBegan:connect(function(V)if V.UserInputType~=Enum.
|
||||
UserInputType.Touch then return end if D(V)then return end local W=E(V)if not W
|
||||
then U(V)end if not(s~=nil)and not W then s=V I=Vector2.new(s.Position.x,s.
|
||||
Position.y)end end)b.InputChanged:connect(function(V)if V.UserInputType~=Enum.
|
||||
UserInputType.Touch then return end if s~=V then return end local W=Vector2.new(
|
||||
s.Position.x,s.Position.y)local X=(I-W)*o if not J and(X.magnitude>p)then J=true
|
||||
I=W end if J and(I~=W)then K(b,X)H()I=W end end)return b.InputEnded:connect(
|
||||
function(V)if s==V or not(s~=nil)then R()end for W,X in pairs(P)do if X==V then
|
||||
table.remove(P,W)end end end)end local G G=function()local H=a('Frame',
|
||||
'TouchControlFrame',{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Parent=
|
||||
Game.CoreGui.RobloxGui})local I=B(H)C(H)F(H,I)return b.ProcessedEvent:connect(
|
||||
function(J,K)if not K then return end if J==s and J.UserInputState==Enum.
|
||||
UserInputState.Begin then s=nil end end)end return G()
|
||||
|
|
@ -1,215 +1,201 @@
|
|||
local a,b=assert(LoadLibrary'RbxUtility').Create,nil if script.Parent:
|
||||
FindFirstChild'ControlFrame'then b=script.Parent:FindFirstChild'ControlFrame'
|
||||
else b=script.Parent end local c,d,e=a'Frame'{Name='DevConsoleContainer',Parent=
|
||||
b,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},a'BindableFunction'
|
||||
{Name='ToggleDevConsole',Parent=b},false function initializeDeveloperConsole()if
|
||||
e then return end e=true local f,g,h,i=1,2,1000,Vector2.new(245,180)local j,k,l,
|
||||
m,n,o,p,q,r,s,t,u,v=f,{},{},0,0,true,true,true,true,false,0,0,a'Frame'{Name=
|
||||
'Body',Parent=c,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,
|
||||
Position=UDim2.new(0,0,0,21),Size=UDim2.new(1,0,1,-25)}local w=a'Frame'{Name=
|
||||
'OptionsHolder',Parent=v,BackgroundColor3=Color3.new(0,0,0),
|
||||
local a,b=assert(LoadLibrary'RbxUtility').Create,script.Parent:FindFirstChild
|
||||
'ControlFrame'or script.Parent local c,d,e,f=a'Frame'{Name='DevConsoleContainer'
|
||||
,Parent=b,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},a
|
||||
'BindableFunction'{Name='ToggleDevConsole',Parent=b},false,nil f=function()if e
|
||||
then return end e=true local g,h,i,j=1,2,1000,Vector2.new(245,180)local k,l,m,n,
|
||||
o,p,q,r,s,t,u,v,w=g,{},{},0,0,true,true,true,true,false,0,0,a'Frame'{Name='Body'
|
||||
,Parent=c,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position
|
||||
=UDim2.new(0,0,0,21),Size=UDim2.new(1,0,1,-25)}local x=a'Frame'{Name=
|
||||
'OptionsHolder',Parent=w,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 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
|
||||
,-250,0,4),Size=UDim2.new(0,234,0,18)}local y=a'TextButton'{Name=
|
||||
'ErrorToggleButton',Parent=x,BackgroundColor3=Color3.new(0,0,0),BorderColor3=
|
||||
,-250,0,4),Size=UDim2.new(0,234,0,18)}local z=a'TextButton'{Name=
|
||||
'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=
|
||||
'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
|
||||
,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
|
||||
),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),
|
||||
Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local A=a'TextButton'{Name
|
||||
='OutputToggleButton',Parent=x,BackgroundColor3=Color3.new(0,0,0),BorderColor3=
|
||||
Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local B=a'TextButton'{Name
|
||||
='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=
|
||||
'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
|
||||
,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
|
||||
),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),
|
||||
Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local C=a'TextButton'{Name
|
||||
='WordWrapToggleButton',Parent=x,BackgroundColor3=Color3.new(0,0,0),BorderColor3
|
||||
Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local D=a'TextButton'{Name
|
||||
='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)
|
||||
,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
|
||||
),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),
|
||||
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',
|
||||
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,
|
||||
-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)}
|
||||
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,
|
||||
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=
|
||||
'http://www.roblox.com/Asset?id=151205881'}local G=a'ImageButton'{Name='Down',
|
||||
Parent=D,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position=
|
||||
'http://www.roblox.com/Asset?id=151205881'}local H=a'ImageButton'{Name='Down',
|
||||
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',
|
||||
Parent=G,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
|
||||
'ImageButton'{Name='Up',Parent=D,BackgroundColor3=Color3.new(0,0,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 I=a
|
||||
'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)
|
||||
}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=
|
||||
'http://www.roblox.com/Asset?id=151205813'}local I=a'Frame'{Name='TextBox',
|
||||
Parent=v,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
|
||||
'Frame'{Name='TextHolder',Parent=I,BackgroundTransparency=1,Position=UDim2.new(0
|
||||
,0,0,0),Size=UDim2.new(1,0,1,0)},a'ImageButton'{Name='OptionsButton',Parent=v,
|
||||
'http://www.roblox.com/Asset?id=151205813'}local J=a'Frame'{Name='TextBox',
|
||||
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 K,L=a
|
||||
'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=w,
|
||||
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),
|
||||
Rotation=0,Image='http://www.roblox.com/Asset?id=152093917'}local L=a
|
||||
'ImageButton'{Name='ResizeButton',Parent=v,BackgroundColor3=Color3.new(0,0,0),
|
||||
Rotation=0,Image='http://www.roblox.com/Asset?id=152093917'}local M=a
|
||||
'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
|
||||
,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=
|
||||
'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
|
||||
.FontSize.Size14,Text='Local Console',TextColor3=Color3.new(1,1,1),
|
||||
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=
|
||||
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=
|
||||
UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,20)}local N=a'ImageButton'{Name=
|
||||
'CloseButton',Parent=M,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency
|
||||
UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,20)}local O=a'ImageButton'{Name=
|
||||
'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'{
|
||||
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=
|
||||
'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=
|
||||
'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,
|
||||
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,
|
||||
false function clean()O=nil P=nil Q=nil R=nil S=nil T=nil U=nil V=false W=false
|
||||
end function refreshConsolePosition(X,Y)if not O then return end local Z=Vector2
|
||||
.new(X,Y)-O c.Position=UDim2.new(0,P.X+Z.X,0,P.Y+Z.Y)end M.TextButton.
|
||||
MouseButton1Down:connect(function(X,Y)O=Vector2.new(X,Y)P=c.AbsolutePosition end
|
||||
)M.TextButton.MouseButton1Up:connect(function(X,Y)clean()end)function
|
||||
refreshConsoleSize(Y,Z)if not Q then return end local _=Vector2.new(Y,Z)-Q c.
|
||||
Size=UDim2.new(0,math.max(R.X+_.X,i.X),0,math.max(R.Y+_.Y,i.Y))end c.Body.
|
||||
ResizeButton.MouseButton1Down:connect(function(Y,Z)Q=Vector2.new(Y,Z)R=c.
|
||||
AbsoluteSize end)c.Body.ResizeButton.MouseButton1Up:connect(function(Y,Z)clean()
|
||||
end)M.CloseButton.MouseButton1Down:connect(function(Z,_)c.Visible=false end)c.
|
||||
TitleBar.CloseButton.MouseButton1Up:connect(function()clean()end)local _,aa=true
|
||||
,false function startAnimation()if aa then return end aa=true repeat if _ then u
|
||||
=u-1 else u=u+1 end local ab=u/5 local ac=ab*ab*(3-(2*ab))K.ImageLabel.Rotation=
|
||||
ac*5*9 x.Position=UDim2.new(0,(ac*5*50)-250,0,4)wait()if(u<=0 and _)or(u>=5 and
|
||||
not _)then aa=false end until not aa end K.MouseButton1Down:connect(function(ab,
|
||||
ac)_=not _ startAnimation()end)function changeOffset(ac)if j==f then m=m+ac
|
||||
elseif j==g then n=n+ac end repositionList()end function
|
||||
refreshTextHolderForReal()local ac,ad=J:GetChildren(),nil if j==f then ad=k
|
||||
elseif j==g then ad=l end local ae=0 for af=1,#ac do ac[af].Visible=false end
|
||||
for af=1,#ad do local ag,ah=nil,false if af>#ac then ag=a'TextLabel'{Name=
|
||||
'Message',Parent=J,BackgroundTransparency=1,TextXAlignment='Left',Size=UDim2.
|
||||
new(1,0,0,14),FontSize='Size10',ZIndex=1}ah=true else ag=ac[af]end if(r or ad[af
|
||||
].Type~=Enum.MessageType.MessageOutput)and(q or ad[af].Type~=Enum.MessageType.
|
||||
MessageInfo)and(p or ad[af].Type~=Enum.MessageType.MessageWarning)and(o or ad[af
|
||||
].Type~=Enum.MessageType.MessageError)then ag.TextWrapped=s ag.Size=UDim2.new(
|
||||
0.98,0,0,2000)ag.Parent=c ag.Text=ad[af].Time..' -- '..ad[af].Message ag.Size=
|
||||
UDim2.new(0.98,0,0,ag.TextBounds.Y)ag.Position=UDim2.new(0,5,0,ae)ag.Parent=J ae
|
||||
=ae+ag.TextBounds.Y if ah then if(j==f and m>0)or(j==g and n>0)then
|
||||
changeOffset(ag.TextBounds.Y)end end ag.Visible=true if ad[af].Type==Enum.
|
||||
MessageType.MessageError then ag.TextColor3=Color3.new(1,0,0)elseif ad[af].Type
|
||||
==Enum.MessageType.MessageInfo then ag.TextColor3=Color3.new(0.4,0.5,1)elseif ad
|
||||
[af].Type==Enum.MessageType.MessageWarning then ag.TextColor3=Color3.new(1,0.6,
|
||||
0.4)else ag.TextColor3=Color3.new(1,1,1)end end end t=ae end local ac=false
|
||||
function refreshTextHolder()if ac then return end Delay(0.1,function()ac=false
|
||||
refreshTextHolderForReal()end)ac=true end local ad=0 function holdingUpButton()
|
||||
if V then return end V=true wait(0.6)ad=ad+1 while V and ad<2 do wait()
|
||||
changeOffset(12)end ad=ad-1 end function holdingDownButton()if W then return end
|
||||
W=true wait(0.6)ad=ad+1 while W and ad<2 do wait()changeOffset(-12)end ad=ad-1
|
||||
end c.Body.ScrollBar.Up.MouseButton1Click:connect(function()changeOffset(10)end)
|
||||
c.Body.ScrollBar.Up.MouseButton1Down:connect(function()changeOffset(10)
|
||||
holdingUpButton()end)c.Body.ScrollBar.Up.MouseButton1Up:connect(function()clean(
|
||||
)end)c.Body.ScrollBar.Down.MouseButton1Down:connect(function()changeOffset(-10)
|
||||
holdingDownButton()end)c.Body.ScrollBar.Down.MouseButton1Up:connect(function()
|
||||
clean()end)function handleScroll(ae,af)if not S then return end local ag,ah,ai=(
|
||||
Vector2.new(ae,af)-S).Y,1-(c.Body.TextBox.AbsoluteSize.Y/J.AbsoluteSize.Y),E.
|
||||
AbsoluteSize.Y-E.Handle.AbsoluteSize.Y local aj=math.max(math.min(ag,ai),0-ai)
|
||||
local ak,al=aj/ai,(ah*J.AbsoluteSize.Y)local am=al*ak if j==f then m=U-am elseif
|
||||
j==g then n=U-am end end E.Handle.MouseButton1Down:connect(function(ae,af)S=
|
||||
Vector2.new(ae,af)T=E.Handle.AbsolutePosition if j==f then U=m elseif j==g then
|
||||
U=n end end)E.Handle.MouseButton1Up:connect(function(ae,af)clean()end)
|
||||
local function existsInsideContainer(af,ag,ah)local ai,aj=af.AbsolutePosition,af
|
||||
.AbsoluteSize if ag<ai.X or ag>ai.X+aj.X or ah<ai.y or ah>ai.y+aj.y then return
|
||||
false end return true end function repositionList()if j==f then m=math.min(math.
|
||||
max(m,0),t-c.Body.TextBox.AbsoluteSize.Y)J.Size=UDim2.new(1,0,0,t)elseif j==g
|
||||
then n=math.min(math.max(n,0),t-c.Body.TextBox.AbsoluteSize.Y)J.Size=UDim2.new(1
|
||||
,0,0,t)end local af=c.Body.TextBox.AbsoluteSize.Y/J.AbsoluteSize.Y if af>=1 then
|
||||
c.Body.ScrollBar.Visible=false c.Body.TextBox.Size=UDim2.new(1,-4,1,-28)if j==f
|
||||
or j==g then J.Position=UDim2.new(0,0,1,0-t)end else c.Body.ScrollBar.Visible=
|
||||
true c.Body.TextBox.Size=UDim2.new(1,-25,1,-28)local ag,ah=1-af,nil if j==f then
|
||||
ah=m/J.AbsoluteSize.Y elseif j==g then ah=n/J.AbsoluteSize.Y end local ai,aj=
|
||||
math.max(0,ag-ah),math.max(E.AbsoluteSize.Y*af,21)local ak=aj/E.AbsoluteSize.Y
|
||||
local al=(1-ak)/(1-af)local am=ai*al local an=math.min(E.AbsoluteSize.Y*am,E.
|
||||
AbsoluteSize.Y-aj)E.Handle.Size=UDim2.new(1,0,0,aj)E.Handle.Position=UDim2.new(0
|
||||
,0,0,an)if j==f then J.Position=UDim2.new(0,0,1,0-t+m)elseif j==g then J.
|
||||
Position=UDim2.new(0,0,1,0-t+n)end end end local function numberWithZero(af)
|
||||
return(af<10 and'0'or'')..af end local af='%s:%s:%s'function ConvertTimeStamp(ag
|
||||
)local ah=ag-os.time()+math.floor(tick())local ai=ah%86400 local aj=math.floor(
|
||||
ai/3600)ai=ai-(aj*3600)local ak=math.floor(ai/60)ai=ai-(ak*60)local al,am,an=
|
||||
numberWithZero(aj),numberWithZero(ak),numberWithZero(ai)return af:format(al,am,
|
||||
an)end x.ErrorToggleButton.MouseButton1Down:connect(function(ag,ah)o=not o x.
|
||||
ErrorToggleButton.CheckFrame.Visible=o refreshTextHolder()repositionList()end)x.
|
||||
WarningToggleButton.MouseButton1Down:connect(function(ah,ai)p=not p x.
|
||||
WarningToggleButton.CheckFrame.Visible=p refreshTextHolder()repositionList()end)
|
||||
x.InfoToggleButton.MouseButton1Down:connect(function(ai,aj)q=not q x.
|
||||
InfoToggleButton.CheckFrame.Visible=q refreshTextHolder()repositionList()end)x.
|
||||
OutputToggleButton.MouseButton1Down:connect(function(aj,ak)r=not r x.
|
||||
OutputToggleButton.CheckFrame.Visible=r refreshTextHolder()repositionList()end)x
|
||||
.WordWrapToggleButton.MouseButton1Down:connect(function(ak,al)s=not s x.
|
||||
WordWrapToggleButton.CheckFrame.Visible=s refreshTextHolder()repositionList()end
|
||||
)function AddLocalMessage(al,am,an)k[#k+1]={Message=al,Time=ConvertTimeStamp(an)
|
||||
,Type=am}while#k>h do table.remove(k,1)end refreshTextHolder()repositionList()
|
||||
end function AddServerMessage(al,am,an)l[#l+1]={Message=al,Time=
|
||||
ConvertTimeStamp(an),Type=am}while#l>h do table.remove(l,1)end
|
||||
refreshTextHolder()repositionList()end c.Body.LocalConsole.MouseButton1Click:
|
||||
connect(function(al,am)if j==g then j=f local an,ao=c.Body.LocalConsole,c.Body.
|
||||
ServerConsole an.Size=UDim2.new(0,90,0,20)ao.Size=UDim2.new(0,90,0,17)an.
|
||||
BackgroundTransparency=0.6 ao.BackgroundTransparency=0.8 if game:FindFirstChild
|
||||
'Players'and game.Players['LocalPlayer']then local ap=game.Players.LocalPlayer:
|
||||
GetMouse()refreshConsolePosition(ap.X,ap.Y)refreshConsoleSize(ap.X,ap.Y)
|
||||
handleScroll(ap.X,ap.Y)end refreshTextHolder()repositionList()end end)c.Body.
|
||||
LocalConsole.MouseButton1Up:connect(function()clean()end)local am=false c.Body.
|
||||
ServerConsole.MouseButton1Click:connect(function(an,ao)if not am then am=true
|
||||
game:GetService'LogService':RequestServerOutput()end if j==f then j=g local ap,
|
||||
aq=c.Body.LocalConsole,c.Body.ServerConsole aq.Size=UDim2.new(0,90,0,20)ap.Size=
|
||||
UDim2.new(0,90,0,17)aq.BackgroundTransparency=0.6 ap.BackgroundTransparency=0.8
|
||||
if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local ar=game
|
||||
.Players.LocalPlayer:GetMouse()refreshConsolePosition(ar.X,ar.Y)
|
||||
refreshConsoleSize(ar.X,ar.Y)handleScroll(ar.X,ar.Y)end refreshTextHolder()
|
||||
repositionList()end end)c.Body.ServerConsole.MouseButton1Up:connect(function()
|
||||
clean()end)if game:FindFirstChild'Players'and game.Players['LocalPlayer']then
|
||||
local ao=game.Players.LocalPlayer:GetMouse()ao.Move:connect(function()if not c.
|
||||
Visible then return end local ap=game.Players.LocalPlayer:GetMouse()
|
||||
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
|
||||
.TextYAlignment.Top}local P,Q,R,S,T,U,V,W,X=nil,nil,nil,nil,nil,nil,false,false,
|
||||
nil X=function()P=nil Q=nil R=nil S=nil T=nil U=nil V=false W=false end local Y
|
||||
Y=function(Z,_)if not P then return end local aa=Vector2.new(Z,_-P)c.Position=
|
||||
UDim2.new(0,Q.X+aa.X,0,Q.Y+aa.Y)end N.TextButton.MouseButton1Down:connect(
|
||||
function(aa,Z)P=Vector2.new(aa,Z)Q=c.AbsolutePosition end)N.TextButton.
|
||||
MouseButton1Up:connect(X)local aa aa=function(Z,_)if not R then return end local
|
||||
ab=Vector2.new(Z,_-R)c.Size=UDim2.new(0,math.max(S.X+ab.X,j.X),0,math.max(S.Y+ab
|
||||
.Y,j.Y))end c.Body.ResizeButton.MouseButton1Down:connect(function(ab,Z)R=Vector2
|
||||
.new(ab,Z)S=c.AbsoluteSize end)c.Body.ResizeButton.MouseButton1Up:connect(X)N.
|
||||
CloseButton.MouseButton1Down:connect(function()c.Visible=false end)c.TitleBar.
|
||||
CloseButton.MouseButton1Up:connect(X)local ab,Z,_=true,false,nil _=function()if
|
||||
Z then return end Z=true repeat v=v+(function()if ab then return-1 else return 1
|
||||
end end)()local ac=v/5 local ad=ac*ac*(3-(2*ac))L.ImageLabel.Rotation=ad*5*9 y.
|
||||
Position=UDim2.new(0,(ad*5*50)-250,0,4)wait()if(v<=0 and ab)or(v>=5 and not ab)
|
||||
then Z=false end until not Z end L.MouseButton1Down:connect(function()ab=not ab
|
||||
return _()end)local ac ac=function()if k==g then n=math.min(math.max(n,0),u-c.
|
||||
Body.TextBox.AbsoluteSize.Y)K.Size=UDim2.new(1,0,0,u)elseif k==h then o=math.
|
||||
min(math.max(o,0),u-c.Body.TextBox.AbsoluteSize.Y)K.Size=UDim2.new(1,0,0,u)end
|
||||
local ad=c.Body.TextBox.AbsoluteSize.Y/K.AbsoluteSize.Y if ad>=1 then c.Body.
|
||||
ScrollBar.Visible=false c.Body.TextBox.Size=UDim2.new(1,-4,1,-28)if k==g or k==h
|
||||
then K.Position=UDim2.new(0,0,1,0-u)end else c.Body.ScrollBar.Visible=true c.
|
||||
Body.TextBox.Size=UDim2.new(1,-25,1,-28)local ae,af=1-ad,nil if k==g then af=n/K
|
||||
.AbsoluteSize.Y elseif k==h then af=o/K.AbsoluteSize.Y end local ag,ah=math.max(
|
||||
0,ae-af),math.max(F.AbsoluteSize.Y*ad,21)local ai=ah/F.AbsoluteSize.Y local aj=(
|
||||
1-ai)/(1-ad)local ak=ag*aj local al=math.min(F.AbsoluteSize.Y*ak,F.AbsoluteSize.
|
||||
Y-ah)F.Handle.Size=UDim2.new(1,0,0,ah)F.Handle.Position=UDim2.new(0,0,0,al)K.
|
||||
Position=UDim2.new(0,0,1,0-u+(function()if k==g then return n elseif k==h then
|
||||
return o end end)())end end local ad ad=function(ae)if k==g then n=n+ae elseif k
|
||||
==h then o=o+ae end return ac()end local ae ae=function()local af,ag=K:
|
||||
GetChildren(),nil if k==g then ag=l elseif k==h then ag=m end local ah=0 for ai=
|
||||
1,#af do af[ai].Visible=false end for ai=1,#ag do local aj,ak=nil,false if ai>#
|
||||
af then aj=a'TextLabel'{Name='Message',Parent=K,BackgroundTransparency=1,
|
||||
TextXAlignment='Left',Size=UDim2.new(1,0,0,14),FontSize='Size10',ZIndex=1}ak=
|
||||
true else aj=af[ai]end if(s or ag[ai].Type~=Enum.MessageType.MessageOutput)and(r
|
||||
or ag[ai].Type~=Enum.MessageType.MessageInfo)and(q or ag[ai].Type~=Enum.
|
||||
MessageType.MessageWarning)and(p or ag[ai].Type~=Enum.MessageType.MessageError)
|
||||
then do aj.TextWrapped=t aj.Size=UDim2.new(0.98,0,0,2000)aj.Parent=c aj.Text=
|
||||
tostring(ag[ai].Time)..' -- '..tostring(ag[ai].Message)aj.Size=UDim2.new(0.98,0,
|
||||
0,aj.TextBounds.Y)aj.Position=UDim2.new(0,5,0,ah)aj.Parent=K ah=ah+aj.TextBounds
|
||||
.Y end if ak then if(k==g and n>0)or(k==h and o>0)then ad(aj.TextBounds.Y)end
|
||||
end aj.Visible=true aj.TextColor3=Color3.new((function()if ag[ai].Type==Enum.
|
||||
MessageType.MessageError then return 1,0,0 elseif ag[ai].Type==Enum.MessageType.
|
||||
MessageInfo then return 0.4,0.5,1 elseif ag[ai].Type==Enum.MessageType.
|
||||
MessageWarning then return 1,0.6,0.4 else return 1,1,1 end end)())end end u=ah
|
||||
end local af,ag=false,nil ag=function()if af then return end Delay(0.1,function(
|
||||
)af=false return ae()end)af=true end local ah,ai=0,nil ai=function()if V then
|
||||
return end V=true wait(0.6)ah=ah+1 while V and ah<2 do wait()ad(12)end ah=ah-1
|
||||
end local aj aj=function()if W then return end W=true wait(0.6)ah=ah+1 while W
|
||||
and ah<2 do wait()ad(-12)end ah=ah-1 end c.Body.ScrollBar.Up.MouseButton1Click:
|
||||
connect(function()return ad(10)end)c.Body.ScrollBar.Up.MouseButton1Down:connect(
|
||||
function()ad(10)return ai()end)c.Body.ScrollBar.Up.MouseButton1Up:connect(X)c.
|
||||
Body.ScrollBar.Down.MouseButton1Down:connect(function()ad(-10)return aj()end)c.
|
||||
Body.ScrollBar.Down.MouseButton1Up:connect(X)local ak ak=function(al,am)if not T
|
||||
then return end local an,ao,ap=(Vector2.new(al,am-T)).Y,1-(c.Body.TextBox.
|
||||
AbsoluteSize.Y/K.AbsoluteSize.Y),F.AbsoluteSize.Y-F.Handle.AbsoluteSize.Y local
|
||||
aq=math.max(math.min(an,ap),0-ap)local ar,as=aq/ap,(ao*K.AbsoluteSize.Y)local at
|
||||
=as*ar if k==g then n=U-at elseif k==h then o=U-at end end F.Handle.
|
||||
MouseButton1Down:connect(function(al,am)T=Vector2.new(al,am)if k==g then U=n
|
||||
elseif k==h then U=o end end)F.Handle.MouseButton1Up:connect(X)local al al=
|
||||
function(am,an,ao)local ap,aq=am.AbsolutePosition,am.AbsoluteSize if an<ap.X or
|
||||
an>ap.X+aq.X or ao<ap.y or ao>ap.y+aq.y then return false end return true end
|
||||
local am am=function(an)if an<10 then return'0'..tostring(an)else return an end
|
||||
end local an,ao='%s:%s:%s',nil ao=function(ap)local aq=ap-os.time()+math.floor(
|
||||
tick())local ar=aq%86400 local as=math.floor(ar/3600)ar=ar-(as*3600)local at=
|
||||
math.floor(ar/60)ar=ar-(at*60)local au,av,aw=am(as),am(at),am(ar)return an:
|
||||
format(au,av,aw)end y.ErrorToggleButton.MouseButton1Down:connect(function()p=not
|
||||
p y.ErrorToggleButton.CheckFrame.Visible=p ag()return ac()end)y.
|
||||
WarningToggleButton.MouseButton1Down:connect(function()q=not q y.
|
||||
WarningToggleButton.CheckFrame.Visible=q ag()return ac()end)y.InfoToggleButton.
|
||||
MouseButton1Down:connect(function()r=not r y.InfoToggleButton.CheckFrame.Visible
|
||||
=r ag()return ac()end)y.OutputToggleButton.MouseButton1Down:connect(function()s=
|
||||
not s y.OutputToggleButton.CheckFrame.Visible=s ag()return ac()end)y.
|
||||
WordWrapToggleButton.MouseButton1Down:connect(function()t=not t y.
|
||||
WordWrapToggleButton.CheckFrame.Visible=t ag()return ac()end)local ap ap=
|
||||
function(aq,ar,as)l[#l+1]={Message=aq,Time=ao(as),Type=ar}while#l>i do table.
|
||||
remove(l,1)end ag()return ac()end local aq aq=function(ar,as,at)m[#m+1]={Message
|
||||
=ar,Time=ao(at),Type=as}while#m>i do table.remove(m,1)end ag()return ac()end c.
|
||||
Body.LocalConsole.MouseButton1Click:connect(function()if k==h then k=g local ar,
|
||||
as=c.Body.LocalConsole,c.Body.ServerConsole ar.Size=UDim2.new(0,90,0,20)as.Size=
|
||||
UDim2.new(0,90,0,17)ar.BackgroundTransparency=0.6 as.BackgroundTransparency=0.8
|
||||
if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local at=game
|
||||
.Players.LocalPlayer:GetMouse()Y(at.X,at.Y)aa(at.X,at.Y)ak(at.X,at.Y)end ag()
|
||||
return ac()end end)c.Body.LocalConsole.MouseButton1Up:connect(X)local ar=false c
|
||||
.Body.ServerConsole.MouseButton1Click:connect(function()if not ar then ar=true
|
||||
game:GetService'LogService':RequestServerOutput()end if k==g then k=h local as,
|
||||
at=c.Body.LocalConsole,c.Body.ServerConsole at.Size=UDim2.new(0,90,0,20)as.Size=
|
||||
UDim2.new(0,90,0,17)at.BackgroundTransparency=0.6 as.BackgroundTransparency=0.8
|
||||
if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local au=game
|
||||
.Players.LocalPlayer:GetMouse()Y(au.X,au.Y)aa(au.X,au.Y)ak(au.X,au.Y)end ag()
|
||||
return ac()end end)c.Body.ServerConsole.MouseButton1Up:connect(X)if game:
|
||||
FindFirstChild'Players'and game.Players['LocalPlayer']then local as=game.Players
|
||||
.LocalPlayer:GetMouse()as.Move:connect(function()if not c.Visible then return
|
||||
end local at=game.Players.LocalPlayer:GetMouse()Y(at.X,at.Y)aa(at.X,at.Y)ak(at.X
|
||||
,at.Y)ag()return ac()end)as.Button1Up:connect(X)as.WheelForward:connect(function
|
||||
()if not c.Visible then return end if al(c,as.X,as.Y)then return ad(10)end end)
|
||||
as.WheelBackward:connect(function()if not c.Visible then return end if al(c,as.X
|
||||
,as.Y)then return ad(-10)end end)end F.Handle.MouseButton1Down:connect(function(
|
||||
)return ac()end)local as=game:GetService'LogService':GetLogHistory()for at=1,#as
|
||||
do ap(as[at].message,as[at].messageType,as[at].timestamp)end local at=game:
|
||||
GetService'LogService'at.MessageOut:connect(function(au,av)return ap(au,av,os.
|
||||
time())end)at.ServerMessageOut:connect(aq)return at end local aa=false d.
|
||||
OnInvoke=function()if aa then return end aa=true f()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
|
||||
b,c,d=a:FindFirstChild'BottomLeftControl',a:FindFirstChild'BottomRightControl',
|
||||
Instance.new'TextLabel'd.Name='ToolTip'd.Text=''d.Font=Enum.Font.ArialBold d.
|
||||
FontSize=Enum.FontSize.Size12 d.TextColor3=Color3.new(1,1,1)d.BorderSizePixel=0
|
||||
d.ZIndex=10 d.Size=UDim2.new(2,0,1,0)d.Position=UDim2.new(1,0,0,0)d.
|
||||
BackgroundColor3=Color3.new(0,0,0)d.BackgroundTransparency=1 d.TextTransparency=
|
||||
1 d.TextWrap=true local e=Instance.new'BoolValue'e.Name='inside'e.Value=false e.
|
||||
Parent=d function setUpListeners(f)local g=0.1 f.Parent.MouseEnter:connect(
|
||||
function()if f:FindFirstChild'inside'then f.inside.Value=true wait(1.2)if f.
|
||||
inside.Value then while f.inside.Value and f.BackgroundTransparency>0 do f.
|
||||
BackgroundTransparency=f.BackgroundTransparency-g f.TextTransparency=f.
|
||||
TextTransparency-g wait()end end end end)function killTip(h)h.inside.Value=false
|
||||
h.BackgroundTransparency=1 h.TextTransparency=1 end f.Parent.MouseLeave:connect(
|
||||
function()killTip(f)end)f.Parent.MouseButton1Click:connect(function()killTip(f)
|
||||
end)end function createSettingsButtonTip(f)if f==nil then f=b:FindFirstChild
|
||||
'SettingsButton'end local g=d:clone()g.RobloxLocked=true g.Text=
|
||||
'Settings/Leave Game'g.Position=UDim2.new(0,0,0,-18)g.Size=UDim2.new(0,120,0,20)
|
||||
g.Parent=f setUpListeners(g)end wait(5)local f=b:GetChildren()for g=1,#f do if f
|
||||
[g].Name=='Exit'then local h=d:clone()h.RobloxLocked=true h.Text='Leave Place'h.
|
||||
Position=UDim2.new(0,0,-1,0)h.Size=UDim2.new(1,0,1,0)h.Parent=f[g]
|
||||
setUpListeners(h)elseif f[g].Name=='SettingsButton'then createSettingsButtonTip(
|
||||
f[g])end end local g=c:GetChildren()for h=1,#g do if g[h].Name:find'Camera'~=nil
|
||||
then local i=d:clone()i.RobloxLocked=true i.Text='Camera View'if g[h].Name:find
|
||||
'Zoom'then i.Position=UDim2.new(-1,0,-1.5)else i.Position=UDim2.new(0,0,-1.5,0)
|
||||
end i.Size=UDim2.new(2,0,1.25,0)i.Parent=g[h]setUpListeners(i)end end
|
||||
b b=function(c,d,e)if not(e~=nil)then e=d d=nil end local f=Instance.new(c)if d
|
||||
then f.Name=d end local g for h,i in pairs(e)do if type(h)=='string'then if h==
|
||||
'Parent'then g=i else f[h]=i end elseif type(h)=='number'and type(i)=='userdata'
|
||||
then i.Parent=f end end f.Parent=g return f end local c,d,e,f=a:FindFirstChild
|
||||
'BottomLeftControl',a:FindFirstChild'BottomRightControl',b('TextLabel','ToolTip'
|
||||
,{Text='',Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size12,TextColor3=
|
||||
Color3.new(1,1,1),BorderSizePixel=0,ZIndex=10,Size=UDim2.new(2,0,1,0),Position=
|
||||
UDim2.new(1,0,0,0),BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,
|
||||
TextTransparency=1,TextWrap=true,b('BoolValue','inside',{Value=false})}),nil f=
|
||||
function(g)local h=0.1 g.Parent.MouseEnter:connect(function()if g:FindFirstChild
|
||||
'inside'then g.inside.Value=true wait(1.2)if g.inside.Value then while g.inside.
|
||||
Value and g.BackgroundTransparency>0 do g.BackgroundTransparency=g.
|
||||
BackgroundTransparency-h g.TextTransparency=g.TextTransparency-h wait()end end
|
||||
end end)local i i=function(j)j.inside.Value=false j.BackgroundTransparency=1 j.
|
||||
TextTransparency=1 end g.Parent.MouseLeave:connect(function()return i(g)end)
|
||||
return g.Parent.MouseButton1Click:connect(function()return i(g)end)end local g g
|
||||
=function(h)if not(h~=nil)then h=c:FindFirstChild'SettingsButton'end local i=e:
|
||||
clone()i.RobloxLocked=true i.Text='Settings/Leave Game'i.Position=UDim2.new(0,0,
|
||||
0,-18)i.Size=UDim2.new(0,120,0,20)i.Parent=h f(i)return i end wait(5)local h=c:
|
||||
GetChildren()for i=1,#h do if h[i].Name=='Exit'then do local j=e:clone()j.
|
||||
RobloxLocked=true j.Text='Leave Place'j.Position=UDim2.new(0,0,-1,0)j.Size=UDim2
|
||||
.new(1,0,1,0)j.Parent=h[i]f(j)end elseif h[i].Name=='SettingsButton'then g(h[i])
|
||||
end end local i=d:GetChildren()for j=1,#i do if(i[j].Name:find'Camera'~=nil)then
|
||||
do local k=e:clone()k.RobloxLocked=true k.Text='Camera View'if i[j].Name:find
|
||||
'Zoom'then k.Position=UDim2.new(-1,0,-1.5)else k.Position=UDim2.new(0,0,-1.5,0)
|
||||
end k.Size=UDim2.new(2,0,1.25,0)k.Parent=i[j]f(k)end end end
|
||||
|
|
@ -1,35 +1,33 @@
|
|||
local a,b=game:GetService'ScriptContext',false pcall(function()b=game:GetService
|
||||
'UserInputService'.TouchEnabled end)a:AddCoreScript(60595695,a,
|
||||
'/Libraries/LibraryRegistration/LibraryRegistration')local function waitForChild
|
||||
(c,d)while not c:FindFirstChild(d)do c.ChildAdded:wait()end end local c=game:
|
||||
GetService'ScriptContext'c:AddCoreScript(59002209,c,'CoreScripts/Sections')
|
||||
waitForChild(game:GetService'CoreGui','RobloxGui')local d=game:GetService
|
||||
'CoreGui':FindFirstChild'RobloxGui'if not b then c:AddCoreScript(36868950,d,
|
||||
'CoreScripts/ToolTip')c:AddCoreScript(46295863,d,'CoreScripts/Settings')else c:
|
||||
AddCoreScript(153556783,d,'CoreScripts/TouchControls')end c:AddCoreScript(
|
||||
39250920,d,'CoreScripts/MainBotChatScript')c:AddCoreScript(48488451,d,
|
||||
'CoreScripts/PopupScript')c:AddCoreScript(48488398,d,
|
||||
'CoreScripts/NotificationScript')c:AddCoreScript(97188756,d,
|
||||
'CoreScripts/ChatScript')c:AddCoreScript(107893730,d,
|
||||
'CoreScripts/PurchasePromptScript')if not b or d.AbsoluteSize.Y>600 then c:
|
||||
'/Libraries/LibraryRegistration/LibraryRegistration')local c c=function(d,e)
|
||||
while not d:FindFirstChild(e)do d.ChildAdded:wait()end end a=game:GetService
|
||||
'ScriptContext'a:AddCoreScript(59002209,a,'CoreScripts/Sections')c(game:
|
||||
GetService'CoreGui','RobloxGui')local d=game:GetService'CoreGui':FindFirstChild
|
||||
'RobloxGui'if not b then a:AddCoreScript(36868950,d,'CoreScripts/ToolTip')a:
|
||||
AddCoreScript(46295863,d,'CoreScripts/Settings')else a:AddCoreScript(153556783,d
|
||||
,'CoreScripts/TouchControls')end a:AddCoreScript(39250920,d,
|
||||
'CoreScripts/MainBotChatScript')a:AddCoreScript(48488451,d,
|
||||
'CoreScripts/PopupScript')a:AddCoreScript(48488398,d,
|
||||
'CoreScripts/NotificationScript')a:AddCoreScript(97188756,d,
|
||||
'CoreScripts/ChatScript')a:AddCoreScript(107893730,d,
|
||||
'CoreScripts/PurchasePromptScript')if not b or d.AbsoluteSize.Y>600 then a:
|
||||
AddCoreScript(48488235,d,'CoreScripts/PlayerListScript')else delay(5,function()
|
||||
if d.AbsoluteSize.Y>=600 then 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.
|
||||
PlaceId~=130815926 then c:AddCoreScript(53878047,d,
|
||||
'CoreScripts/BackpackScripts/BackpackBuilder')waitForChild(d,'CurrentLoadout')
|
||||
waitForChild(d,'Backpack')local e=d.Backpack if game.CoreGui.Version>=7 then c:
|
||||
AddCoreScript(89449093,e,'CoreScripts/BackpackScripts/BackpackManager')end game:
|
||||
GetService'ScriptContext':AddCoreScript(89449008,e,
|
||||
'CoreScripts/BackpackScripts/BackpackGear')c:AddCoreScript(53878057,d.
|
||||
CurrentLoadout,'CoreScripts/BackpackScripts/LoadoutScript')if game.CoreGui.
|
||||
Version>=8 then c:AddCoreScript(-1,e,
|
||||
PlaceId~=130815926 then a:AddCoreScript(53878047,d,
|
||||
'CoreScripts/BackpackScripts/BackpackBuilder')c(d,'CurrentLoadout')c(d,
|
||||
'Backpack')local e=d.Backpack if game.CoreGui.Version>=7 then a:AddCoreScript(
|
||||
89449093,e,'CoreScripts/BackpackScripts/BackpackManager')end a:AddCoreScript(
|
||||
89449008,e,'CoreScripts/BackpackScripts/BackpackGear')a:AddCoreScript(53878057,d
|
||||
.CurrentLoadout,'CoreScripts/BackpackScripts/LoadoutScript')if game.CoreGui.
|
||||
Version>=8 then a:AddCoreScript(-1,e,
|
||||
'CoreScripts/BackpackScripts/BackpackWardrobe')end end local e=not not game.
|
||||
Workspace:FindFirstChild'PSVariable'if e then game:GetService'ScriptContext':
|
||||
AddCoreScript(64164692,game.Players.LocalPlayer,'BuildToolManager')end game.
|
||||
Workspace.ChildAdded:connect(function(f)if f.Name=='PSVariable'and f:IsA
|
||||
'BoolValue'then e=true game:GetService'ScriptContext':AddCoreScript(64164692,
|
||||
game.Players.LocalPlayer,'BuildToolManager')end end)if b then c:AddCoreScript(
|
||||
152908679,d,'CoreScripts/ContextActionTouch')waitForChild(d,'ControlFrame')
|
||||
waitForChild(d.ControlFrame,'BottomLeftControl')d.ControlFrame.BottomLeftControl
|
||||
.Visible=false waitForChild(d.ControlFrame,'TopLeftControl')d.ControlFrame.
|
||||
TopLeftControl.Visible=false end
|
||||
Workspace:FindFirstChild'PSVariable'if e then a:AddCoreScript(64164692,game.
|
||||
Players.LocalPlayer,'BuildToolManager')end game.Workspace.ChildAdded:connect(
|
||||
function(f)if f.Name=='PSVariable'and f:IsA'BoolValue'then e=true return a:
|
||||
AddCoreScript(64164692,game.Players.LocalPlayer,'BuildToolManager')end end)if b
|
||||
then a:AddCoreScript(152908679,d,'CoreScripts/ContextActionTouch')c(d,
|
||||
'ControlFrame')c(d.ControlFrame,'BottomLeftControl')d.ControlFrame.
|
||||
BottomLeftControl.Visible=false c(d.ControlFrame,'TopLeftControl')d.ControlFrame
|
||||
.TopLeftControl.Visible=false end
|
||||
|
|
@ -1,48 +1,49 @@
|
|||
local a,b=5,5 function waitForChild(c,d)local e=c:findFirstChild(d)if e then
|
||||
return e end while true do e=c.ChildAdded:wait()if e.Name==d then return e end
|
||||
end end local c=script.Parent local d,e,f,g=waitForChild(c,'Humanoid'),
|
||||
waitForChild(c,'Torso'),c:FindFirstChild'PlayerStats',Instance.new'BoolValue'g.
|
||||
Name='InCharTag'local h=Instance.new'BoolValue'h.Name='RobloxBuildTool'local i,j
|
||||
if f==nil then f=Instance.new'Configuration'f.Parent=c f.Name='PlayerStats'end
|
||||
local k=f:FindFirstChild'MaxHealth'if k==nil then k=Instance.new'NumberValue'k.
|
||||
Parent=f k.Value=100 k.Name='MaxHealth'end d.MaxHealth=k.Value d.Health=k.Value
|
||||
function onMaxHealthChange()d.MaxHealth=k.Value d.Health=k.Value end k.Changed:
|
||||
connect(onMaxHealthChange)local l=game.Players:GetPlayerFromCharacter(script.
|
||||
Parent)local m=l.PlayerGui:FindFirstChild'DamageOverTimeGui'if m==nil then m=
|
||||
Instance.new'BillboardGui'm.Name='DamageOverTimeGui'm.Parent=l.PlayerGui m.
|
||||
Adornee=script.Parent:FindFirstChild'Head'm.Active=true m.size=UDim2.new(a,0,b,0
|
||||
)m.StudsOffset=Vector3.new(0,2,0)end print'newHealth declarations finished'
|
||||
function billboardHealthChange(n)local o=Instance.new'TextLabel'if n>0 then o.
|
||||
Text=tostring(n)o.TextColor3=Color3.new(0,1,0)else o.Text=tostring(n)o.
|
||||
TextColor3=Color3.new(1,0,1)end o.size=UDim2.new(1,0,1,0)o.Active=true o.
|
||||
FontSize=6 o.BackgroundTransparency=1 o.Parent=m for p=1,10 do wait(0.1)o.
|
||||
TextTransparency=p/10 o.Position=UDim2.new(0,0,0,-p*5)o.FontSize=6-p*0.6 end o:
|
||||
remove()end function setMaxHealth()if k.Value>=0 then d.MaxHealth=k.Value print(
|
||||
d.MaxHealth)if d.Health>d.MaxHealth then d.Health=d.MaxHealth end end end k.
|
||||
Changed:connect(setMaxHealth)local n=Instance.new'Fire'n.Heat=0.1 n.Size=3 n.
|
||||
Name='FireEffect'n.Enabled=false while true do local o,p=wait(1),d.Health if p>0
|
||||
then local q=0 if f then local r,s,t,u,v=f:FindFirstChild'Regen',f:
|
||||
FindFirstChild'Poison',f:FindFirstChild'Ice',f:FindFirstChild'Fire',f:
|
||||
FindFirstChild'Stun'if r then q=q+r.Value.X if r.Value.Y>=0 then r.Value=Vector3
|
||||
.new(r.Value.X+r.Value.Z,r.Value.Y-o,r.Value.Z)elseif r.Value.Y==-1 then r.Value
|
||||
=Vector3.new(r.Value.X+r.Value.Z,-1,r.Value.Z)else r:remove()end end if s then q
|
||||
=q-s.Value.X if s.Value.Y>=0 then s.Value=Vector3.new(s.Value.X+s.Value.Z,s.
|
||||
Value.Y-o,s.Value.Z)elseif s.Value.Y==-1 then s.Value=Vector3.new(s.Value.X+s.
|
||||
Value.Z,-1,s.Value.Z)else s:remove()end end if t then q=q-t.Value.X if t.Value.Y
|
||||
>=0 then t.Value=Vector3.new(t.Value.X,t.Value.Y-o,t.Value.Z)else t:remove()end
|
||||
end if u then n.Enabled=true n.Parent=c.Torso q=q-u.Value.X if u.Value.Y>=0 then
|
||||
u.Value=Vector3.new(u.Value.X,u.Value.Y-o,u.Value.Z)else u:remove()n.Enabled=
|
||||
false n.Parent=nil end end if v then if v.Value>0 then e.Anchored=true i=script.
|
||||
Parent:GetChildren()j=game.Players:GetPlayerFromCharacter(script.Parent).
|
||||
Backpack:GetChildren()for w=1,#i do if i[w].className=='Tool'then g:Clone().
|
||||
Parent=i[w]print(j)table.insert(j,i[w])end end for w=1,#j do if j[w]:
|
||||
FindFirstChild'RobloxBuildTool'==nil then h:Clone().Parent=j[w]j[w].Parent=game.
|
||||
Lighting end end wait(0.2)for w=1,#j do j[w].Parent=game.Players:
|
||||
GetPlayerFromCharacter(script.Parent).Backpack end v.Value=v.Value-o else e.
|
||||
Anchored=false for w=1,#j do local x=j[w]:FindFirstChild'RobloxBuildTool'if x
|
||||
then x:Remove()end j[w].Parent=game.Lighting end wait(0.2)for w=1,#j do local x=
|
||||
j[w]:FindFirstChild'InCharTag'if x then x:Remove()j[w].Parent=script.Parent else
|
||||
j[w].Parent=game.Players:GetPlayerFromCharacter(script.Parent).Backpack end end
|
||||
v:Remove()end end if q~=0 then coroutine.resume(coroutine.create(
|
||||
billboardHealthChange),q)end end p=d.Health+q*o if p*1.01<d.MaxHealth then d.
|
||||
Health=p elseif q>0 then d.Health=d.MaxHealth end end end
|
||||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||
'userdata'then h.Parent=e end end e.Parent=f return e end local b,c,d=5,5,nil d=
|
||||
function(e,f)local g=e:findFirstChild(f)if g then return g end while true do g=e
|
||||
.ChildAdded:wait()if g.Name==f then return g end end end local e=script.Parent
|
||||
local f,g,h,i=d(e,'Humanoid'),d(e,'Torso'),e:FindFirstChild'PlayerStats',
|
||||
Instance.new'BoolValue'i.Name='InCharTag'local j=Instance.new'BoolValue'j.Name=
|
||||
'RobloxBuildTool'if not(h~=nil)then h=a('Configuration','PlayerStats',{Parent=e}
|
||||
)end local k=h:FindFirstChild'MaxHealth'if not(k~=nil)then k=a('NumberValue',
|
||||
'MaxHealth',{Value=100,Parent=h})end f.MaxHealth=k.Value f.Health=k.Value local
|
||||
l l=function()f.MaxHealth=k.Value f.Health=k.Value end k.Changed:connect(l)local
|
||||
m=game.Players:GetPlayerFromCharacter(script.Parent)local n=m.PlayerGui:
|
||||
FindFirstChild'DamageOverTimeGui'if not(n~=nil)then n=a('BillboardGui',
|
||||
'DamageOverTimeGui',{Parent=m.PlayerGui,Adornee=script.Parent:FindFirstChild
|
||||
'Head',Active=true,size=UDim2.new(b,0,c,0),StudsOffset=Vector3.new(0,2,0)})end
|
||||
print'newHealth declarations finished'local o o=function(p)local q=a('TextLabel'
|
||||
,{Text=tostring(p),TextColor3=(function()if p>0 then return Color3.new(0,1,0)
|
||||
else return Color3.new(1,0,1)end end)(),size=UDim2.new(1,0,1,0),Active=true,
|
||||
FontSize=6,BackgroundTransparency=1,Parent=n})for r=1,10 do wait(0.1)q.
|
||||
TextTransparency=r/10 q.Position=UDim2.new(0,0,0,-r*5)q.FontSize=6-r*0.6 end
|
||||
return q:remove()end local p p=function()if k.Value>=0 then f.MaxHealth=k.Value
|
||||
print(f.MaxHealth)if f.Health>f.MaxHealth then f.Health=f.MaxHealth end end end
|
||||
k.Changed:connect(p)local q=a('Fire','FireEffect',{Heat=0.1,Size=3,Enabled=false
|
||||
})while true do local r,s=wait(1),f.Health if s>0 then local t=0 if h then local
|
||||
u,v,w,x,y=h:FindFirstChild'Regen',h:FindFirstChild'Poison',h:FindFirstChild'Ice'
|
||||
,h:FindFirstChild'Fire',h:FindFirstChild'Stun'if u then t=t+u.Value.X if u.Value
|
||||
.Y>=0 then u.Value=Vector3.new(u.Value.X+u.Value.Z,u.Value.Y-r,u.Value.Z)elseif
|
||||
u.Value.Y==-1 then u.Value=Vector3.new(u.Value.X+u.Value.Z,-1,u.Value.Z)else u:
|
||||
remove()end end if v then t=t-v.Value.X if v.Value.Y>=0 then v.Value=Vector3.
|
||||
new(v.Value.X+v.Value.Z,v.Value.Y-r,v.Value.Z)elseif v.Value.Y==-1 then v.Value=
|
||||
Vector3.new(v.Value.X+v.Value.Z,-1,v.Value.Z)else v:remove()end end if w then t=
|
||||
t-w.Value.X if w.Value.Y>=0 then w.Value=Vector3.new(w.Value.X,w.Value.Y-r,w.
|
||||
Value.Z)else w:remove()end end if x then q.Enabled=true q.Parent=e.Torso t=t-x.
|
||||
Value.X if x.Value.Y>=0 then x.Value=Vector3.new(x.Value.X,x.Value.Y-r,x.Value.Z
|
||||
)else x:remove()q.Enabled=false q.Parent=nil end end if y then local z if y.
|
||||
Value>0 then g.Anchored=true local A=script.Parent:GetChildren()z=game.Players:
|
||||
GetPlayerFromCharacter(script.Parent).Backpack:GetChildren()for B=1,#A do if A[B
|
||||
].className=='Tool'then i:Clone().Parent=A[B]print(z)table.insert(z,A[B])end end
|
||||
for B=1,#z do if not(z[B]:FindFirstChild'RobloxBuildTool'~=nil)then j:Clone().
|
||||
Parent=z[B]z[B].Parent=game.Lighting end end wait(0.2)for B=1,#z do z[B].Parent=
|
||||
game.Players:GetPlayerFromCharacter(script.Parent).Backpack end y.Value=y.Value-
|
||||
r else g.Anchored=false for A=1,#z do local B=z[A]:FindFirstChild
|
||||
'RobloxBuildTool'if B then B:Remove()end z[A].Parent=game.Lighting end wait(0.2)
|
||||
for A=1,#z do local B=z[A]:FindFirstChild'InCharTag'if B then B:Remove()z[A].
|
||||
Parent=script.Parent else z[A].Parent=game.Players:GetPlayerFromCharacter(script
|
||||
.Parent).Backpack end end y:Remove()end end if t~=0 then coroutine.resume(
|
||||
coroutine.create(o),t)end end s=f.Health+t*r if s*1.01<f.MaxHealth then f.Health
|
||||
=s elseif t>0 then f.Health=f.MaxHealth end end end
|
||||
|
|
@ -1,142 +1,131 @@
|
|||
function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end function
|
||||
waitForChild(a,b)while not a:FindFirstChild(b)do a.ChildAdded:wait()end end
|
||||
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,
|
||||
'You are too far away to chat!',300,'Chat ended because you walked away',350,
|
||||
"Chat ended because you didn't reply",350,nil,nil,nil,nil,nil,{},{},nil
|
||||
waitForChild(game,'CoreGui')waitForChild(game.CoreGui,'RobloxGui')if game.
|
||||
CoreGui.RobloxGui:FindFirstChild'ControlFrame'then u=game.CoreGui.RobloxGui.
|
||||
ControlFrame else u=game.CoreGui.RobloxGui end function currentTone()if e then
|
||||
return e.Tone else return Enum.DialogTone.Neutral end end function
|
||||
createChatNotificationGui()o=Instance.new'BillboardGui'o.Name=
|
||||
'ChatNotificationGui'o.ExtentsOffset=Vector3.new(0,1,0)o.Size=UDim2.new(4,0,
|
||||
5.42857122,0)o.SizeOffset=Vector2.new(0,0)o.StudsOffset=Vector3.new(0.4,4.3,0)o.
|
||||
Enabled=true o.RobloxLocked=true o.Active=true local v=Instance.new'ImageLabel'v
|
||||
.Name='Image'v.Active=false v.BackgroundTransparency=1 v.Position=UDim2.new(0,0,
|
||||
0,0)v.Size=UDim2.new(1,0,1,0)v.Image=''v.RobloxLocked=true v.Parent=o local w=
|
||||
Instance.new'ImageButton'w.Name='Button'w.AutoButtonColor=false w.Position=UDim2
|
||||
.new(0.0879999995,0,0.0529999994,0)w.Size=UDim2.new(0.829999983,0,0.460000008,0)
|
||||
w.Image=''w.BackgroundTransparency=1 w.RobloxLocked=true w.Parent=v end function
|
||||
getChatColor(v)if v==Enum.DialogTone.Neutral then return Enum.ChatColor.Blue
|
||||
elseif v==Enum.DialogTone.Friendly then return Enum.ChatColor.Green elseif v==
|
||||
Enum.DialogTone.Enemy then return Enum.ChatColor.Red end end function
|
||||
styleChoices(v)for w,x in pairs(b)do resetColor(x,v)end resetColor(c,v)end
|
||||
function styleMainFrame(v)if v==Enum.DialogTone.Neutral then a.Style=Enum.
|
||||
FrameStyle.ChatBlue a.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botBlue_tailRight.png'elseif v==Enum.DialogTone.
|
||||
Friendly then a.Style=Enum.FrameStyle.ChatGreen a.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botGreen_tailRight.png'elseif v==Enum.DialogTone
|
||||
.Enemy then a.Style=Enum.FrameStyle.ChatRed a.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botRed_tailRight.png'end styleChoices(v)end
|
||||
function setChatNotificationTone(v,w,x)if x==Enum.DialogTone.Neutral then v.
|
||||
Image.Image='rbxasset://textures/chatBubble_botBlue_notify_bkg.png'elseif x==
|
||||
Enum.DialogTone.Friendly then v.Image.Image=
|
||||
'rbxasset://textures/chatBubble_botGreen_notify_bkg.png'elseif x==Enum.
|
||||
DialogTone.Enemy then v.Image.Image=
|
||||
'rbxasset://textures/chatBubble_botRed_notify_bkg.png'end if w==Enum.
|
||||
DialogPurpose.Quest then v.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_bang.png'elseif w==Enum.DialogPurpose
|
||||
.Help then v.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_question.png'elseif w==Enum.
|
||||
DialogPurpose.Shop then v.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_money.png'end end function
|
||||
createMessageDialog()p=Instance.new'Frame'p.Name='DialogScriptMessage'p.Style=
|
||||
Enum.FrameStyle.RobloxRound p.Visible=false local v=Instance.new'TextLabel'v.
|
||||
Name='Text'v.Position=UDim2.new(0,0,0,-1)v.Size=UDim2.new(1,0,1,0)v.FontSize=
|
||||
Enum.FontSize.Size14 v.BackgroundTransparency=1 v.TextColor3=Color3.new(1,1,1)v.
|
||||
RobloxLocked=true v.Parent=p end function showMessage(v,w)p.Text.Text=v p.Size=
|
||||
UDim2.new(0,w,0,40)p.Position=UDim2.new(0.5,-w/2,0.5,-40)p.Visible=true wait(2)p
|
||||
.Visible=false end function variableDelay(v)local w=math.min(string.len(v),100)
|
||||
wait(0.75+((w/75)*1.5))end function resetColor(v,w)if w==Enum.DialogTone.Neutral
|
||||
then v.BackgroundColor3=Color3.new(0,0,0.7019607843137254)v.Number.TextColor3=
|
||||
Color3.new(0.17647058823529413,0.5568627450980392,0.9607843137254902)elseif w==
|
||||
Enum.DialogTone.Friendly then v.BackgroundColor3=Color3.new(0,
|
||||
0.30196078431372547,0)v.Number.TextColor3=Color3.new(0,0.7450980392156863,0)
|
||||
elseif w==Enum.DialogTone.Enemy then v.BackgroundColor3=Color3.new(
|
||||
0.5490196078431373,0,0)v.Number.TextColor3=Color3.new(1,0.34509803921568627,
|
||||
0.30980392156862746)end end function highlightColor(v,w)if w==Enum.DialogTone.
|
||||
Neutral then v.BackgroundColor3=Color3.new(7.8431372549019605E-3,
|
||||
0.4235294117647059,1)v.Number.TextColor3=Color3.new(1,1,1)elseif w==Enum.
|
||||
DialogTone.Friendly then v.BackgroundColor3=Color3.new(0,0.5019607843137255,0)v.
|
||||
Number.TextColor3=Color3.new(1,1,1)elseif w==Enum.DialogTone.Enemy then v.
|
||||
BackgroundColor3=Color3.new(0.8,0,0)v.Number.TextColor3=Color3.new(1,1,1)end end
|
||||
function endDialog()if g then g:Remove()g=nil end local v=e e=nil if v and v.
|
||||
InUse then local w=r:Clone()w.archivable=false w.Disabled=false w.Parent=v end
|
||||
for w,x in pairs(s)do if w and x then x.Enabled=not w.InUse end end f=nil end
|
||||
function wanderDialog()print'Wander'a.Visible=false endDialog()showMessage(j,k)
|
||||
end function timeoutDialog()print'Timeout'a.Visible=false endDialog()
|
||||
showMessage(l,m)end function normalEndDialog()print'Done'endDialog()end function
|
||||
sanitizeMessage(w)if string.len(w)==0 then return'...'else return w end end
|
||||
function selectChoice(w)renewKillswitch(e)a.Visible=false if w==c then game.Chat
|
||||
:Chat(game.Players.LocalPlayer.Character,'Goodbye!',getChatColor(currentTone()))
|
||||
normalEndDialog()else local x=d[w]game.Chat:Chat(game.Players.LocalPlayer.
|
||||
Character,sanitizeMessage(x.UserDialog),getChatColor(currentTone()))wait(1)e:
|
||||
SignalDialogChoiceSelected(n,x)game.Chat:Chat(f,sanitizeMessage(x.ResponseDialog
|
||||
),getChatColor(currentTone()))variableDelay(x.ResponseDialog)
|
||||
presentDialogChoices(f,x:GetChildren())end end function newChoice(w)local x=
|
||||
Instance.new'TextButton'x.BackgroundColor3=Color3.new(0,0,0.7019607843137254)x.
|
||||
AutoButtonColor=false x.BorderSizePixel=0 x.Text=''x.MouseEnter:connect(function
|
||||
()highlightColor(x,currentTone())end)x.MouseLeave:connect(function()resetColor(x
|
||||
,currentTone())end)x.MouseButton1Click:connect(function()selectChoice(x)end)x.
|
||||
RobloxLocked=true local y=Instance.new'TextLabel'y.Name='Number'y.TextColor3=
|
||||
Color3.new(0.4980392156862745,0.8313725490196079,1)y.Text=w y.FontSize=Enum.
|
||||
FontSize.Size14 y.BackgroundTransparency=1 y.Position=UDim2.new(0,4,0,2)y.Size=
|
||||
UDim2.new(0,20,0,24)y.TextXAlignment=Enum.TextXAlignment.Left y.TextYAlignment=
|
||||
Enum.TextYAlignment.Top y.RobloxLocked=true y.Parent=x local z=Instance.new
|
||||
'TextLabel'z.Name='UserPrompt'z.BackgroundTransparency=1 z.TextColor3=Color3.
|
||||
new(1,1,1)z.FontSize=Enum.FontSize.Size14 z.Position=UDim2.new(0,28,0,2)z.Size=
|
||||
UDim2.new(1,-32,1,-4)z.TextXAlignment=Enum.TextXAlignment.Left z.TextYAlignment=
|
||||
Enum.TextYAlignment.Top z.TextWrap=true z.RobloxLocked=true z.Parent=x return x
|
||||
end function initialize(w)b[1]=newChoice'1)'b[2]=newChoice'2)'b[3]=newChoice'3)'
|
||||
b[4]=newChoice'4)'c=newChoice'5)'c.UserPrompt.Text='Goodbye!'c.Size=UDim2.new(1,
|
||||
0,0,28)a=Instance.new'Frame'a.Name='UserDialogArea'a.Size=UDim2.new(0,350,0,200)
|
||||
a.Style=Enum.FrameStyle.ChatBlue a.Visible=false local x=Instance.new
|
||||
'ImageLabel'x.Name='Tail'x.Size=UDim2.new(0,62,0,53)x.Position=UDim2.new(1,8,
|
||||
0.25)x.Image='rbxasset://textures/chatBubble_botBlue_tailRight.png'x.
|
||||
BackgroundTransparency=1 x.RobloxLocked=true x.Parent=a for y,z in pairs(b)do z.
|
||||
RobloxLocked=true z.Parent=a end c.RobloxLocked=true c.Parent=a a.RobloxLocked=
|
||||
true a.Parent=w end function presentDialogChoices(w,x)if not e then return end f
|
||||
=w local y={}for z,A in pairs(x)do if A:IsA'DialogChoice'then table.insert(y,A)
|
||||
end end table.sort(y,function(B,C)return B.Name<C.Name end)if#y==0 then
|
||||
normalEndDialog()return end local B,C=1,0 d={}for D,E in pairs(b)do E.Visible=
|
||||
false end for F,G in pairs(y)do if B<=#b then b[B].Size=UDim2.new(1,0,0,72)b[B].
|
||||
UserPrompt.Text=G.UserDialog local H=math.ceil(b[B].UserPrompt.TextBounds.Y/24)*
|
||||
24 b[B].Position=UDim2.new(0,0,0,C)b[B].Size=UDim2.new(1,0,0,H)b[B].Visible=true
|
||||
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
|
||||
.Size=UDim2.new(0,350,0,C+24+32)a.Position=UDim2.new(0,20,0,-a.Size.Y.Offset-20)
|
||||
styleMainFrame(currentTone())a.Visible=true end function doDialog(w)while not
|
||||
Instance.Lock(w,n)do wait()end if w.InUse then Instance.Unlock(w)return else w.
|
||||
InUse=true Instance.Unlock(w)end e=w game.Chat:Chat(w.Parent,w.InitialPrompt,
|
||||
getChatColor(w.Tone))variableDelay(w.InitialPrompt)presentDialogChoices(w.Parent
|
||||
,w:GetChildren())end function renewKillswitch(w)if g then g:Remove()g=nil end g=
|
||||
q:Clone()g.archivable=false g.Disabled=false g.Parent=w end function
|
||||
checkForLeaveArea()while e do if e.Parent and(n:DistanceFromCharacter(e.Parent.
|
||||
Position)>=e.ConversationDistance)then wanderDialog()end wait(1)end end function
|
||||
startDialog(w)if w.Parent and w.Parent:IsA'BasePart'then if n:
|
||||
DistanceFromCharacter(w.Parent.Position)>=w.ConversationDistance then
|
||||
showMessage(h,i)return end for x,y in pairs(s)do if x and y then y.Enabled=false
|
||||
end end renewKillswitch(x)delay(1,checkForLeaveArea)doDialog(x)end end function
|
||||
removeDialog(w)if s[w]then s[w]:Remove()s[w]=nil end if t[w]then t[w]:
|
||||
disconnect()t[w]=nil end end function addDialog(w)if w.Parent then if w.Parent:
|
||||
IsA'BasePart'then local x=o:clone()x.Enabled=not w.InUse x.Adornee=w.Parent x.
|
||||
RobloxLocked=true x.Parent=game.CoreGui x.Image.Button.MouseButton1Click:
|
||||
connect(function()startDialog(w)end)setChatNotificationTone(x,w.Purpose,w.Tone)s
|
||||
[w]=x t[w]=w.Changed:connect(function(y)if y=='Parent'and w.Parent then
|
||||
removeDialog(w)addDialog(w)elseif y=='InUse'then x.Enabled=not e and not w.InUse
|
||||
if w==e then timeoutDialog()end elseif y=='Tone'or y=='Purpose'then
|
||||
setChatNotificationTone(x,w.Purpose,w.Tone)end end)else t[w]=w.Changed:connect(
|
||||
function(x)if x=='Parent'and w.Parent then removeDialog(w)addDialog(w)end end)
|
||||
end end end function fetchScripts()local w=game:GetService'InsertService':
|
||||
LoadAsset(39226062)if type(w)=='string'then wait(0.1)w=game:GetService
|
||||
'InsertService':LoadAsset(39226062)end if type(w)=='string'then return end
|
||||
waitForChild(w,'TimeoutScript')q=w.TimeoutScript waitForChild(w,
|
||||
'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()
|
||||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=Instance.new(b
|
||||
)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then
|
||||
if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)==
|
||||
'userdata'then h.Parent=e end end e.Parent=f return e end local b b=function(c,d
|
||||
)while not c[d]do c.Changed:wait()end end local c c=function(d,e)while not d:
|
||||
FindFirstChild(e)do d.ChildAdded:wait()end end local d,e,f,g,h,i,j,k,l,m,n,o,p,q
|
||||
,r,s,t,u,v,w,x=nil,{},nil,{},nil,nil,nil,'You are too far away to chat!',300,
|
||||
'Chat ended because you walked away',350,"Chat ended because you didn't reply",
|
||||
350,nil,nil,nil,nil,nil,{},{},nil c(game,'CoreGui')c(game.CoreGui,'RobloxGui')if
|
||||
game.CoreGui.RobloxGui:FindFirstChild'ControlFrame'then x=game.CoreGui.RobloxGui
|
||||
.ControlFrame else x=game.CoreGui.RobloxGui end local y y=function()if h then
|
||||
return h.Tone else return Enum.DialogTone.Neutral end end local z z=function()r=
|
||||
a('BillboardGui','ChatNotificationGui',{ExtentsOffset=Vector3.new(0,1,0),Size=
|
||||
UDim2.new(4,0,5.42857122,0),SizeOffset=Vector2.new(0,0),StudsOffset=Vector3.new(
|
||||
0.4,4.3,0),Enabled=true,RobloxLocked=true,Active=true,a('ImageLabel','Image',{
|
||||
Active=false,BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.
|
||||
new(1,0,1,0),Image='',RobloxLocked=true,a('ImageButton','Button',{
|
||||
AutoButtonColor=false,Position=UDim2.new(0.088,0,0.053,0),Size=UDim2.new(0.83,0,
|
||||
0.46,0),Image='',BackgroundTransparency=1,RobloxLocked=true})})})end local A A=
|
||||
function(B)if B==Enum.DialogTone.Neutral then return Enum.ChatColor.Blue elseif
|
||||
B==Enum.DialogTone.Friendly then return Enum.ChatColor.Green elseif B==Enum.
|
||||
DialogTone.Enemy then return Enum.ChatColor.Red end end local B B=function(C,D)
|
||||
if D==Enum.DialogTone.Neutral then C.BackgroundColor3=Color3.new(0,0,
|
||||
0.7019607843137254)C.Number.TextColor3=Color3.new(0.17647058823529413,
|
||||
0.5568627450980392,0.9607843137254902)elseif D==Enum.DialogTone.Friendly then C.
|
||||
BackgroundColor3=Color3.new(0,0.30196078431372547,0)C.Number.TextColor3=Color3.
|
||||
new(0,0.7450980392156863,0)elseif D==Enum.DialogTone.Enemy then C.
|
||||
BackgroundColor3=Color3.new(0.5490196078431373,0,0)C.Number.TextColor3=Color3.
|
||||
new(1,0.34509803921568627,0.30980392156862746)end end local C C=function(D)for E
|
||||
,F in pairs(e)do B(F,D)end return B(f,D)end local D D=function(E)if E==Enum.
|
||||
DialogTone.Neutral then d.Style=Enum.FrameStyle.ChatBlue d.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botBlue_tailRight.png'elseif E==Enum.DialogTone.
|
||||
Friendly then d.Style=Enum.FrameStyle.ChatGreen d.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botGreen_tailRight.png'elseif E==Enum.DialogTone
|
||||
.Enemy then d.Style=Enum.FrameStyle.ChatRed d.Tail.Image=
|
||||
'rbxasset://textures/chatBubble_botRed_tailRight.png'end return C(E)end local E
|
||||
E=function(F,G,H)if H==Enum.DialogTone.Neutral then F.Image.Image=
|
||||
'rbxasset://textures/chatBubble_botBlue_notify_bkg.png'elseif H==Enum.DialogTone
|
||||
.Friendly then F.Image.Image=
|
||||
'rbxasset://textures/chatBubble_botGreen_notify_bkg.png'elseif H==Enum.
|
||||
DialogTone.Enemy then F.Image.Image=
|
||||
'rbxasset://textures/chatBubble_botRed_notify_bkg.png'end if G==Enum.
|
||||
DialogPurpose.Quest then F.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_bang.png'elseif G==Enum.DialogPurpose
|
||||
.Help then F.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_question.png'elseif G==Enum.
|
||||
DialogPurpose.Shop then F.Image.Button.Image=
|
||||
'rbxasset://textures/chatBubble_bot_notify_money.png'end end local F F=function(
|
||||
)s=a('Frame','DialogScriptMessage',{Style=Enum.FrameStyle.RobloxRound,Visible=
|
||||
false,a('TextLabel','Text',{Position=UDim2.new(0,0,0,-1),Size=UDim2.new(1,0,1,0)
|
||||
,FontSize=Enum.FontSize.Size14,BackgroundTransparency=1,TextColor3=Color3.new(1,
|
||||
1,1),RobloxLocked=true})})end local G G=function(H,I)s.Text.Text=H s.Size=UDim2.
|
||||
new(0,I,0,40)s.Position=UDim2.new(0.5,-I/2,0.5,-40)s.Visible=true wait(2)s.
|
||||
Visible=false return s end local H H=function(I)local J=math.min(string.len(I),
|
||||
100)return wait(0.75+(J/75)*1.5)end local I I=function(J,K)if K==Enum.DialogTone
|
||||
.Neutral then J.BackgroundColor3=Color3.new(7.8431372549019605E-3,
|
||||
0.4235294117647059,1)J.Number.TextColor3=Color3.new(1,1,1)elseif K==Enum.
|
||||
DialogTone.Friendly then J.BackgroundColor3=Color3.new(0,0.5019607843137255,0)J.
|
||||
Number.TextColor3=Color3.new(1,1,1)elseif K==Enum.DialogTone.Enemy then J.
|
||||
BackgroundColor3=Color3.new(0.8,0,0)J.Number.TextColor3=Color3.new(1,1,1)end end
|
||||
local J J=function()if j then j:Remove()j=nil end local K=h h=nil if K and K.
|
||||
InUse then local L=u:Clone()L.archivable=false L.Disabled=false L.Parent=K end
|
||||
for L,M in pairs(v)do if L and M then M.Enabled=not L.InUse end end i=nil end
|
||||
local L L=function()print'Wander'd.Visible=false J()return G(m,n)end local M M=
|
||||
function()print'Timeout'd.Visible=false J()return G(o,p)end local N N=function()
|
||||
print'Done'return J()end local O O=function(P)if string.len(P)==0 then return
|
||||
'...'else return P end end local P P=function(Q)if j then j:Remove()j=nil end j=
|
||||
t:Clone()j.archivable=false j.Disabled=false j.Parent=Q return j end local Q Q=
|
||||
function(R,S)if not h then return end i=R local T={}for U,V in pairs(S)do if V:
|
||||
IsA'DialogChoice'then table.insert(T,V)end end table.sort(T,function(W,X)return
|
||||
W.Name<X.Name end)if#T==0 then N()return end local W,X=1,0 g={}for Y,Z in pairs(
|
||||
e)do Z.Visible=false end for _,aa in pairs(T)do if W<=#e then e[W].Size=UDim2.
|
||||
new(1,0,0,72)e[W].UserPrompt.Text=aa.UserDialog local ab=math.ceil(e[W].
|
||||
UserPrompt.TextBounds.Y/24)*24 e[W].Position=UDim2.new(0,0,0,X)e[W].Size=UDim2.
|
||||
new(1,0,0,ab)e[W].Visible=true g[e[W]]=aa X=X+ab W=W+1 end end f.Position=UDim2.
|
||||
new(0,0,0,X)f.Number.Text=W..')'d.Size=UDim2.new(0,350,0,X+24+32)d.Position=
|
||||
UDim2.new(0,20,0,-d.Size.Y.Offset-20)D(y())d.Visible=true end local aa aa=
|
||||
function(ab)P(h)d.Visible=false if ab==f then game.Chat:Chat(game.Players.
|
||||
LocalPlayer.Character,'Goodbye!',A(y()))return N()else local R=g[ab]game.Chat:
|
||||
Chat(game.Players.LocalPlayer.Character,O(R.UserDialog),A(y()))wait(1)h:
|
||||
SignalDialogChoiceSelected(q,R)game.Chat:Chat(i,O(R.ResponseDialog),A(y()))H(R.
|
||||
ResponseDialog)return Q(i,R:GetChildren())end end local ab ab=function(R)local S
|
||||
=a('TextButton',{BackgroundColor3=Color3.new(0,0,0.7019607843137254),
|
||||
AutoButtonColor=false,BorderSizePixel=0,Text='',RobloxLocked=true,a('TextLabel',
|
||||
'Number',{TextColor3=Color3.new(0.4980392156862745,0.8313725490196079,1),Text=R,
|
||||
FontSize=Enum.FontSize.Size14,BackgroundTransparency=1,Position=UDim2.new(0,4,0,
|
||||
2),Size=UDim2.new(0,20,0,24),TextXAlignment=Enum.TextXAlignment.Left,
|
||||
TextYAlignment=Enum.TextYAlignment.Top,RobloxLocked=true}),a('TextLabel',
|
||||
'UserPrompt',{BackgroundTransparency=1,TextColor3=Color3.new(1,1,1),FontSize=
|
||||
Enum.FontSize.Size14,Position=UDim2.new(0,28,0,2),Size=UDim2.new(1,-32,1,-4),
|
||||
TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top,
|
||||
TextWrap=true,RobloxLocked=true})})S.MouseEnter:connect(function()return I(S,y()
|
||||
)end)S.MouseLeave:connect(function()return B(S,y())end)S.MouseButton1Click:
|
||||
connect(function()return aa(S)end)return S end local R R=function(S)e[1]=ab'1)'e
|
||||
[2]=ab'2)'e[3]=ab'3)'e[4]=ab'4)'f=ab'5)'f.UserPrompt.Text='Goodbye!'f.Size=UDim2
|
||||
.new(1,0,0,28)d=a('Frame','UserDialogArea',{Size=UDim2.new(0,350,0,200),Style=
|
||||
Enum.FrameStyle.ChatBlue,Visible=false,a('ImageLabel','Tail',{Size=UDim2.new(0,
|
||||
62,0,53),Position=UDim2.new(1,8,0.25),Image=
|
||||
'rbxasset://textures/chatBubble_botBlue_tailRight.png',BackgroundTransparency=1,
|
||||
RobloxLocked=true})})for T,W in pairs(e)do W.RobloxLocked=true W.Parent=d f.
|
||||
RobloxLocked=true end f.Parent=d d.RobloxLocked=true d.Parent=S end local S S=
|
||||
function(T)while not Instance.Lock(T,q)do wait()end if T.InUse then Instance.
|
||||
Unlock(T)return else T.InUse=true Instance.Unlock(T)end h=T game.Chat:Chat(T.
|
||||
Parent,T.InitialPrompt,A(T.Tone))H(T.InitialPrompt)return Q(T.Parent,T:
|
||||
GetChildren())end local T T=function()while h do if h.Parent and(q:
|
||||
DistanceFromCharacter(h.Parent.Position>=h.ConversationDistance))then L()end
|
||||
wait(1)end end local W W=function(X)if X.Parent and X.Parent:IsA'BasePart'then
|
||||
if q:DistanceFromCharacter(X.Parent.Position)>=X.ConversationDistance then G(k,l
|
||||
)return end for _,ac in pairs(v)do if _ and ac then ac.Enabled=false end end P(_
|
||||
)delay(1,T)return S(_)end end local ac ac=function(X)if v[X]then v[X]:Remove()v[
|
||||
X]=nil end if w[X]then w[X]:disconnect()w[X]=nil end end local X X=function(_)if
|
||||
_.Parent then if _.Parent:IsA'BasePart'then local ad=r:clone()ad.Enabled=not _.
|
||||
InUse ad.Adornee=_.Parent ad.RobloxLocked=true ad.Parent=game.CoreGui ad.Image.
|
||||
Button.MouseButton1Click:connect(function()return W(_)end)E(ad,_.Purpose,_.Tone)
|
||||
v[_]=ad w[_]=_.Changed:connect(function(ae)if ae=='Parent'and _.Parent then ac(_
|
||||
)return X(_)elseif ae=='InUse'then ad.Enabled=not h and not _.InUse if _==h then
|
||||
return M()end elseif ae=='Tone'or ae=='Purpose'then return E(ad,_.Purpose,_.Tone
|
||||
)end end)else w[_]=_.Changed:connect(function(ad)if ad=='Parent'and _.Parent
|
||||
then ac(_)return X(_)end end)end end end local ad ad=function()local ae=game:
|
||||
GetService'InsertService':LoadAsset(39226062)if type(ae)=='string'then wait(0.1)
|
||||
ae=game:GetService'InsertService':LoadAsset(39226062)end if type(ae)=='string'
|
||||
then return end c(ae,'TimeoutScript')t=ae.TimeoutScript c(ae,
|
||||
'ReenableDialogScript')u=ae.ReenableDialogScript end local ae ae=function()b(
|
||||
game.Players,'LocalPlayer')q=game.Players.LocalPlayer b(q,'Character')ad()z()F()
|
||||
s.RobloxLocked=true s.Parent=x c(x,'BottomLeftControl')local _=a('Frame',
|
||||
'DialogFrame',{Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,0,0,0),
|
||||
BackgroundTransparency=1,RobloxLocked=true,Parent=x.BottomLeftControl})R(_)game.
|
||||
CollectionService.ItemAdded:connect(function(af)if af:IsA'Dialog'then return X(
|
||||
af)end end)game.CollectionService.ItemRemoved:connect(function(af)if af:IsA
|
||||
'Dialog'then return ac(af)end end)for af,ag in pairs(game.CollectionService:
|
||||
GetCollection'Dialog')do if ag:IsA'Dialog'then X(ag)end end end return ae()
|
||||
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=
|
||||
function(b)if b=='Foo'or b==a.Foo then return
|
||||
'Function Foo. Arguments: None. Side effect: prints foo'elseif b=='Bar'or b==a
|
||||
.Bar then return'Function Bar. Arguments: None. Side effect: prints bar'end
|
||||
local a={}a.Foo=function()return print'foo'end a.Bar=function()return print'bar'
|
||||
end a.Help=function(b)if'Foo'==b or a.Foo==b then return
|
||||
'Function Foo. Arguments: None. Side effect: prints foo'elseif'Bar'==b or a.
|
||||
Bar==b then return'Function Bar. Arguments: None. Side effect: prints bar'end
|
||||
end return a
|
||||
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
|
||||
waitForChild(a,b)while not a:FindFirstChild(b)do a.ChildAdded:wait()end end
|
||||
waitForProperty(game.Players,'LocalPlayer')waitForChild(script.Parent,'Popup')
|
||||
waitForChild(script.Parent.Popup,'AcceptButton')script.Parent.Popup.AcceptButton
|
||||
.Modal=true local a,b,c,d,e=game.Players.LocalPlayer,nil,{},true,function()if
|
||||
script.Parent.Popup then script.Parent.Popup.Visible=false end end function
|
||||
makeFriend(f,g)local h=script.Parent:FindFirstChild'Popup'if h==nil then return
|
||||
end if h.Visible then return end if c[f]then return end h.PopupText.Text=
|
||||
'Accept Friend Request from '..tostring(f.Name)..'?'h.PopupImage.Image=
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(f.userId)..
|
||||
'&x=352&y=352'showTwoButtons()h.Visible=true h.AcceptButton.Text='Accept'h.
|
||||
DeclineButton.Text='Decline'h:TweenSize(UDim2.new(0,330,0,350),Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quart,1,true)local i,j i=h.AcceptButton.
|
||||
MouseButton1Click:connect(function()h.Visible=false g:RequestFriendship(f)if i
|
||||
then i:disconnect()end if j then j:disconnect()end h:TweenSize(UDim2.new(0,0,0,0
|
||||
),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,e())end)j=h.
|
||||
DeclineButton.MouseButton1Click:connect(function()h.Visible=false g:
|
||||
RevokeFriendship(f)c[f]=true print'pop up blacklist'if i then i:disconnect()end
|
||||
if j then j:disconnect()end h:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.
|
||||
Out,Enum.EasingStyle.Quart,1,true,e())end)end game.Players.FriendRequestEvent:
|
||||
connect(function(f,g,h)if f~=a and g~=a then return end if f==a then if h==Enum.
|
||||
FriendRequestEvent.Accept then game:GetService'GuiService':SendNotification(
|
||||
'You are Friends','With '..g.Name..'!',
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(g.userId)..
|
||||
'&x=48&y=48',5,function()end)end elseif g==a then if h==Enum.FriendRequestEvent.
|
||||
Issue then if c[f]then return end game:GetService'GuiService':SendNotification(
|
||||
'Friend Request','From '..f.Name,
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(f.userId)..
|
||||
'&x=48&y=48',8,function()makeFriend(f,g)end)elseif h==Enum.FriendRequestEvent.
|
||||
Accept then game:GetService'GuiService':SendNotification('You are Friends',
|
||||
'With '..f.Name..'!','http://www.roblox.com/thumbs/avatar.ashx?userId='..
|
||||
tostring(f.userId)..'&x=48&y=48',5,function()end)end end end)function
|
||||
showOneButton()local f=script.Parent:FindFirstChild'Popup'if f then f.OKButton.
|
||||
Visible=true f.DeclineButton.Visible=false f.AcceptButton.Visible=false end end
|
||||
function showTwoButtons()local f=script.Parent:FindFirstChild'Popup'if f then f.
|
||||
OKButton.Visible=false f.DeclineButton.Visible=true f.AcceptButton.Visible=true
|
||||
end end function showTeleportUI(f,g)if b~=nil then b:Remove()end waitForChild(a,
|
||||
'PlayerGui')b=Instance.new'Message'b.Text=f b.Parent=a.PlayerGui if g>0 then
|
||||
wait(g)b:Remove()end end function onTeleport(f,g,h)if game:GetService
|
||||
'TeleportService'.CustomizedTeleportUI==false then if f==Enum.TeleportState.
|
||||
Started then showTeleportUI('Teleport started...',0)elseif f==Enum.TeleportState
|
||||
.WaitingForServer then showTeleportUI('Requesting server...',0)elseif f==Enum.
|
||||
TeleportState.InProgress then showTeleportUI('Teleporting...',0)elseif f==Enum.
|
||||
TeleportState.Failed then showTeleportUI(
|
||||
[[Teleport failed. Insufficient privileges or target place does not exist.]],3)
|
||||
end end end if d then a.OnTeleport:connect(onTeleport)game:GetService
|
||||
'TeleportService'.ErrorCallback=function(f)local h=script.Parent:FindFirstChild
|
||||
'Popup'showOneButton()h.PopupText.Text=f local i i=h.OKButton.MouseButton1Click:
|
||||
connect(function()game:GetService'TeleportService':TeleportCancel()if i then i:
|
||||
local a a=function(b,c)while not b[c]do b.Changed:wait()end end local b b=
|
||||
function(c,d)while not c:FindFirstChild(d)do c.ChildAdded:wait()end end a(game.
|
||||
Players,'LocalPlayer')b(script.Parent,'Popup')b(script.Parent.Popup,
|
||||
'AcceptButton')script.Parent.Popup.AcceptButton.Modal=true local c,d,e,f,g=game.
|
||||
Players.LocalPlayer,nil,{},true,nil g=function()local h=script.Parent:
|
||||
FindFirstChild'Popup'if h then h.OKButton.Visible=true h.DeclineButton.Visible=
|
||||
false h.AcceptButton.Visible=false end return h end local h h=function()local i=
|
||||
script.Parent:FindFirstChild'Popup'if i then i.OKButton.Visible=false i.
|
||||
DeclineButton.Visible=true i.AcceptButton.Visible=true end return i end local i
|
||||
i=function()if script.Parent.Popup then script.Parent.Popup.Visible=false end
|
||||
end local j j=function(k,l)local m=script.Parent:FindFirstChild'Popup'if not(m~=
|
||||
nil)then return end if m.Visible then return end if e[k]then return end m.
|
||||
PopupText.Text='Accept Friend Request from '..tostring(k.Name)..'?'m.PopupImage.
|
||||
Image='http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||
'&x=352&y=352'h()m.Visible=true m.AcceptButton.Text='Accept'm.DeclineButton.Text
|
||||
='Decline'm:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quart,1,true)local n,o n=m.AcceptButton.MouseButton1Click:connect(
|
||||
function()m.Visible=false l:RequestFriendship(k)if n~=nil then n:disconnect()end
|
||||
if o~=nil then o:disconnect()end return m:TweenSize(UDim2.new(0,0,0,0),Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quart,1,true,i())end)o=m.DeclineButton.
|
||||
MouseButton1Click:connect(function()m.Visible=false l:RevokeFriendship(k)e[k]=
|
||||
true print'pop up blacklist'if n~=nil then n:disconnect()end if o~=nil then o:
|
||||
disconnect()end return m:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,
|
||||
Enum.EasingStyle.Quart,1,true,i())end)end game.Players.FriendRequestEvent:
|
||||
connect(function(k,l,m)if k~=c and l~=c then return end if k==c then if m==Enum.
|
||||
FriendRequestEvent.Accept then return game:GetService'GuiService':
|
||||
SendNotification('You are Friends','With '..tostring(l.Name)..'!',
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(l.userId)..
|
||||
'&x=48&y=48',5,function()end)end elseif l==c then if m==Enum.FriendRequestEvent.
|
||||
Issue then if e[k]then return end return game:GetService'GuiService':
|
||||
SendNotification('Friend Request','From '..tostring(k.Name),
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||
'&x=48&y=48',8,function()return j(k,l)end)elseif m==Enum.FriendRequestEvent.
|
||||
Accept then return game:GetService'GuiService':SendNotification(
|
||||
'You are Friends','With '..tostring(k.Name)..'!',
|
||||
'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId)..
|
||||
'&x=48&y=48',5,function()end)end end end)local k k=function(l,m)if d~=nil then d
|
||||
:Remove()end b(c,'PlayerGui')local n=Instance.new'Message'n.Text=l n.Parent=c.
|
||||
PlayerGui if m>0 then wait(m)n:Remove()end return n end local l l=function(m,n,o
|
||||
)if game:GetService'TeleportService'.CustomizedTeleportUI==false then return k((
|
||||
function()if Enum.TeleportState.Started==m then return'Teleport started...',0
|
||||
elseif Enum.TeleportState.WaitingForServer==m then return'Requesting server...',
|
||||
0 elseif Enum.TeleportState.InProgress==m then return'Teleporting...',0 elseif
|
||||
Enum.TeleportState.Failed==m then return
|
||||
[[Teleport failed. Insufficient privileges or target place does not exist.]],3
|
||||
end end)())end end if f then c.OnTeleport:connect(l)game:GetService
|
||||
'TeleportService'.ErrorCallback=function(m)local o=script.Parent:FindFirstChild
|
||||
'Popup'g()o.PopupText.Text=m local p p=o.OKButton.MouseButton1Click:connect(
|
||||
function()game:GetService'TeleportService':TeleportCancel()if p then p:
|
||||
disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild
|
||||
'Popup')h: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 h:TweenSize(UDim2.new(0,330,0,
|
||||
350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()h:
|
||||
'Popup')return o:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quart,1,true,i())end)return game.GuiService:AddCenterDialog(script.
|
||||
Parent:FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()g()
|
||||
script.Parent:FindFirstChild'Popup'.Visible=true return o:TweenSize(UDim2.new(0,
|
||||
330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()
|
||||
return o:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.
|
||||
Quart,1,true,i())end)end game:GetService'TeleportService'.ConfirmationCallback=
|
||||
function(m,o,p)local q=script.Parent:FindFirstChild'Popup'q.PopupText.Text=m q.
|
||||
PopupImage.Image=''local r,s,t t=function()if r~=nil then r:disconnect()end if s
|
||||
~=nil then s:disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:
|
||||
FindFirstChild'Popup')return q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection
|
||||
.Out,Enum.EasingStyle.Quart,1,true,i())end r=q.AcceptButton.MouseButton1Click:
|
||||
connect(function()t()local u,v u,v=pcall(function()return game:GetService
|
||||
'TeleportService':TeleportImpl(o,p)end)if not u then g()q.PopupText.Text=v local
|
||||
w w=q.OKButton.MouseButton1Click:connect(function()if w~=nil then w:disconnect()
|
||||
end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild'Popup')
|
||||
return q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.
|
||||
Quart,1,true,i())end)return game.GuiService:AddCenterDialog(script.Parent:
|
||||
FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()g()script.
|
||||
Parent:FindFirstChild'Popup'.Visible=true return q:TweenSize(UDim2.new(0,330,0,
|
||||
350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()return
|
||||
q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1
|
||||
,true,i())end)end end)s=q.DeclineButton.MouseButton1Click:connect(function()t()
|
||||
return pcall(function()return game:GetService'TeleportService':TeleportCancel()
|
||||
end)end)local u=pcall(function()return game.GuiService:AddCenterDialog(script.
|
||||
Parent:FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()h()q.
|
||||
AcceptButton.Text='Leave'q.DeclineButton.Text='Stay'script.Parent:FindFirstChild
|
||||
'Popup'.Visible=true return q:TweenSize(UDim2.new(0,330,0,350),Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()return q:
|
||||
TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,
|
||||
true,e())end)end game:GetService'TeleportService'.ConfirmationCallback=function(
|
||||
f,h,i)local j=script.Parent:FindFirstChild'Popup'j.PopupText.Text=f j.PopupImage
|
||||
.Image=''local k,l local function killCons()if k then k:disconnect()end if l
|
||||
then l: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 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
|
||||
true,i())end)end)if u==false then script.Parent:FindFirstChild'Popup'.Visible=
|
||||
true q.AcceptButton.Text='Leave'q.DeclineButton.Text='Stay'q:TweenSize(UDim2.
|
||||
new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end
|
||||
return true end end
|
||||
|
|
@ -1,20 +1,22 @@
|
|||
local a=Instance.new'Frame'a.Position=UDim2.new(0.5,-165,0.5,-175)a.Size=UDim2.
|
||||
new(0,330,0,350)a.Style=Enum.FrameStyle.RobloxRound a.ZIndex=4 a.Name='Popup'a.
|
||||
Visible=false a.Parent=script.Parent local b=a:clone()b.Size=UDim2.new(1,16,1,16
|
||||
)b.Position=UDim2.new(0,-8,0,-8)b.Name='Darken'b.ZIndex=1 b.Parent=a local c=
|
||||
Instance.new'TextButton'c.Position=UDim2.new(0,20,0,270)c.Size=UDim2.new(0,100,0
|
||||
,50)c.Font=Enum.Font.ArialBold c.FontSize=Enum.FontSize.Size24 c.Style=Enum.
|
||||
ButtonStyle.RobloxButton c.TextColor3=Color3.new(0.9725490196078431,
|
||||
0.9725490196078431,0.9725490196078431)c.Text='Yes'c.ZIndex=5 c.Name=
|
||||
'AcceptButton'c.Parent=a local d=c:clone()d.Position=UDim2.new(1,-120,0,270)d.
|
||||
Text='No'd.Name='DeclineButton'd.Parent=a local e=c:clone()e.Name='OKButton'e.
|
||||
Text='OK'e.Position=UDim2.new(0.5,-50,0,270)e.Visible=false e.Parent=a local f=
|
||||
Instance.new'ImageLabel'f.BackgroundTransparency=1 f.Position=UDim2.new(0.5,-140
|
||||
,0,0)f.Size=UDim2.new(0,280,0,280)f.ZIndex=3 f.Name='PopupImage'f.Parent=a local
|
||||
g=Instance.new'ImageLabel'g.BackgroundTransparency=1 g.Size=UDim2.new(1,0,1,0)g.
|
||||
Image='http://www.roblox.com/asset/?id=47574181'g.Name='Backing'g.ZIndex=2 g.
|
||||
Parent=f local h=Instance.new'TextLabel'h.Name='PopupText'h.Size=UDim2.new(1,0,
|
||||
0.8,0)h.Font=Enum.Font.ArialBold h.FontSize=Enum.FontSize.Size36 h.
|
||||
BackgroundTransparency=1 h.Text="Hello I'm a popup"h.TextColor3=Color3.new(
|
||||
0.9725490196078431,0.9725490196078431,0.9725490196078431)h.TextWrap=true h.
|
||||
ZIndex=5 h.Parent=a script:remove()
|
||||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=a(b)if c then
|
||||
e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then if g==
|
||||
'Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)=='userdata'
|
||||
then h.Parent=e end end e.Parent=f return e end local b=a('Frame','Popup',{
|
||||
Position=UDim2.new(0.5,-165,0.5,-175),Size=UDim2.new(0,330,0,350),Style=Enum.
|
||||
FrameStyle.RobloxRound,ZIndex=4,Visible=false,Parent=script.Parent,a('TextLabel'
|
||||
,'PopupText',{Size=UDim2.new(1,0,0.8,0),Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||
FontSize.Size36,BackgroundTransparency=1,Text="Hello I'm a popup",TextColor3=
|
||||
Color3.new(0.9725490196078431,0.9725490196078431,0.9725490196078431),TextWrap=
|
||||
true,ZIndex=5}),a('TextButton','AcceptButton',{Position=UDim2.new(0,20,0,270),
|
||||
Size=UDim2.new(0,100,0,50),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.
|
||||
Size24,Style=Enum.ButtonStyle.RobloxButton,TextColor3=Color3.new(
|
||||
0.9725490196078431,0.9725490196078431,0.9725490196078431),Text='Yes',ZIndex=5}),
|
||||
a('ImageLabel','PopupImage',{BackgroundTransparency=1,Position=UDim2.new(0.5,-
|
||||
140,0,0),Size=UDim2.new(0,280,0,280),ZIndex=3,a('ImageLabel','Backing',{
|
||||
BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),Image=
|
||||
'http://www.roblox.com/asset/?id=47574181',ZIndex=2})})})local c=b.AcceptButton
|
||||
do local d=b:clone()d.Name='Darken'd.Size=UDim2.new(1,16,1,16)d.Position=UDim2.
|
||||
new(0,-8,0,-8)d.ZIndex=1 d.Parent=b end do local d=c:clone()d.Name=
|
||||
'DeclineButton'd.Position=UDim2.new(1,-120,0,270)d.Text='No'd.Parent=b end do
|
||||
local d=c:clone()d.Name='OKButton'd.Text='OK'd.Position=UDim2.new(0.5,-50,0,270)
|
||||
d.Visible=false d.Parent=b end return script:remove()
|
||||
|
|
@ -1,264 +1,229 @@
|
|||
if game.CoreGui.Version<3 then return end local a=script.Parent local function
|
||||
waitForChild(b,c)while not b:FindFirstChild(c)do b.ChildAdded:wait()end end
|
||||
local function waitForProperty(b,c)while not b[c]do b.Changed:wait()end end
|
||||
local function IsTouchDevice()local b=false pcall(function()b=Game:GetService
|
||||
'UserInputService'.TouchEnabled end)return b end local function IsPhone()if a.
|
||||
AbsoluteSize.Y<=320 then return true end return false end waitForChild(game,
|
||||
'Players')waitForProperty(game.Players,'LocalPlayer')local b=Instance.new'Frame'
|
||||
b.Name='CurrentLoadout'b.Position=UDim2.new(0.5,-300,1,-85)b.Size=UDim2.new(0,
|
||||
600,0,54)b.BackgroundTransparency=1 b.RobloxLocked=true b.Parent=a local c=
|
||||
Instance.new'ImageLabel'c.Name='Background'c.Size=UDim2.new(1.2,0,1.2,0)c.Image=
|
||||
'http://www.roblox.com/asset/?id=96536002'c.BackgroundTransparency=1 c.Position=
|
||||
UDim2.new(-0.1,0,-0.1,0)c.ZIndex=0 c.Parent=b c.Visible=false local d=Instance.
|
||||
new'ImageLabel'd.Size=UDim2.new(1,0,0.025,1)d.Position=UDim2.new(0,0,0,0)d.Image
|
||||
='http://www.roblox.com/asset/?id=97662207'd.BackgroundTransparency=1 d.Parent=c
|
||||
local e=Instance.new'BoolValue'e.Name='Debounce'e.RobloxLocked=true e.Parent=b
|
||||
local f=Instance.new'ImageButton'f.RobloxLocked=true f.Visible=false f.Name=
|
||||
'BackpackButton'f.BackgroundTransparency=1 f.Image=
|
||||
'http://www.roblox.com/asset/?id=97617958'f.Position=UDim2.new(0.5,-60,1,-108)f.
|
||||
Size=UDim2.new(0,120,0,18)waitForChild(a,'ControlFrame')f.Parent=a.ControlFrame
|
||||
local g=9 if IsPhone()then g=3 b.Size=UDim2.new(0,180,0,54)b.Position=UDim2.new(
|
||||
0.5,-90,1,-85)end for h=0,g do local i=Instance.new'Frame'i.RobloxLocked=true i.
|
||||
BackgroundColor3=Color3.new(0,0,0)i.BackgroundTransparency=1 i.BorderColor3=
|
||||
Color3.new(1,1,1)i.Name='Slot'..tostring(h)i.ZIndex=4 if h==0 then i.Position=
|
||||
UDim2.new(0.9,0,0,0)else i.Position=UDim2.new((h-1)*0.1,(h-1)*6,0,0)end i.Size=
|
||||
UDim2.new(0,54,1,0)i.Parent=b if a.AbsoluteSize.Y<=320 then i.Position=UDim2.
|
||||
new(0,(h-1)*60,0,-50)print('Well got here',i,i.Position.X.Scale,i.Position.X.
|
||||
Offset)end if a.AbsoluteSize.Y<=320 and h==0 then i:Destroy()end end local h=
|
||||
Instance.new'ImageButton'h.Name='TempSlot'h.Active=true h.Size=UDim2.new(1,0,1,0
|
||||
)h.BackgroundTransparency=1 h.Style='Custom'h.Visible=false h.RobloxLocked=true
|
||||
h.Parent=b h.ZIndex=3 local i=Instance.new'ImageLabel'i.Name='Background'i.
|
||||
BackgroundTransparency=1 i.Image='http://www.roblox.com/asset/?id=97613075'i.
|
||||
Size=UDim2.new(1,0,1,0)i.Parent=h local j=Instance.new'ImageLabel'j.Name=
|
||||
'Highlight'j.BackgroundTransparency=1 j.Image=
|
||||
'http://www.roblox.com/asset/?id=97643886'j.Size=UDim2.new(1,0,1,0)j.Visible=
|
||||
false local k=Instance.new'ObjectValue'k.Name='GearReference'k.RobloxLocked=true
|
||||
k.Parent=h local l=Instance.new'TextLabel'l.Name='ToolTipLabel'l.RobloxLocked=
|
||||
true l.Text=''l.BackgroundTransparency=0.5 l.BorderSizePixel=0 l.Visible=false l
|
||||
.TextColor3=Color3.new(1,1,1)l.BackgroundColor3=Color3.new(0,0,0)l.
|
||||
TextStrokeTransparency=0 l.Font=Enum.Font.ArialBold l.FontSize=Enum.FontSize.
|
||||
Size14 l.Size=UDim2.new(1,60,0,20)l.Position=UDim2.new(0,-30,0,-30)l.Parent=h
|
||||
local m=Instance.new'BoolValue'm.Name='Kill'm.RobloxLocked=true m.Parent=h local
|
||||
n=Instance.new'ImageLabel'n.Name='GearImage'n.BackgroundTransparency=1 n.
|
||||
Position=UDim2.new(0,0,0,0)n.Size=UDim2.new(1,0,1,0)n.ZIndex=5 n.RobloxLocked=
|
||||
true n.Parent=h local o=Instance.new'TextLabel'o.Name='SlotNumber'o.
|
||||
BackgroundTransparency=1 o.BorderSizePixel=0 o.Font=Enum.Font.ArialBold o.
|
||||
FontSize=Enum.FontSize.Size18 o.Position=UDim2.new(0,0,0,0)o.Size=UDim2.new(0,10
|
||||
,0,15)o.TextColor3=Color3.new(1,1,1)o.TextTransparency=0 o.TextXAlignment=Enum.
|
||||
TextXAlignment.Left o.TextYAlignment=Enum.TextYAlignment.Bottom o.RobloxLocked=
|
||||
true o.Parent=h o.ZIndex=5 if IsTouchDevice()then o.Visible=false end local p=o:
|
||||
Clone()p.Name='SlotNumberDownShadow'p.TextColor3=Color3.new(0,0,0)p.Position=
|
||||
UDim2.new(0,1,0,-1)p.Parent=h p.ZIndex=2 local q=p:Clone()q.Name=
|
||||
'SlotNumberUpShadow'q.Position=UDim2.new(0,-1,0,-1)q.Parent=h local r=Instance.
|
||||
new'TextLabel'r.RobloxLocked=true r.Name='GearText'r.BackgroundTransparency=1 r.
|
||||
Font=Enum.Font.Arial r.FontSize=Enum.FontSize.Size14 r.Position=UDim2.new(0,-8,0
|
||||
,-8)r.Size=UDim2.new(1,16,1,16)r.Text=''r.TextColor3=Color3.new(1,1,1)r.TextWrap
|
||||
=true r.Parent=h r.ZIndex=5 local s=Instance.new'Frame's.RobloxLocked=true s.
|
||||
Visible=false s.Name='Backpack's.Position=UDim2.new(0.5,0,0.5,0)s.
|
||||
BackgroundColor3=Color3.new(0.12549019607843137,0.12549019607843137,
|
||||
0.12549019607843137)s.BackgroundTransparency=0 s.BorderSizePixel=0 s.Parent=a s.
|
||||
Active=true local t=Instance.new'BoolValue't.RobloxLocked=true t.Name='SwapSlot'
|
||||
t.Parent=s local u=Instance.new'IntValue'u.RobloxLocked=true u.Name='Slot'u.
|
||||
Parent=t local v=Instance.new'ObjectValue'v.RobloxLocked=true v.Name=
|
||||
'GearButton'v.Parent=t local w=Instance.new'Frame'w.Name='Tabs'w.Visible=false w
|
||||
.Active=false w.RobloxLocked=true w.BackgroundColor3=Color3.new(0,0,0)w.
|
||||
BackgroundTransparency=0.08 w.BorderSizePixel=0 w.Position=UDim2.new(0,0,-0.1,-4
|
||||
)w.Size=UDim2.new(1,0,0.1,4)w.Parent=s local x=Instance.new'Frame'x.RobloxLocked
|
||||
=true x.Name='TabLine'x.BackgroundColor3=Color3.new(0.20784313725490197,
|
||||
0.20784313725490197,0.20784313725490197)x.BorderSizePixel=0 x.Position=UDim2.
|
||||
new(0,5,1,-4)x.Size=UDim2.new(1,-10,0,4)x.ZIndex=2 x.Parent=w local y=Instance.
|
||||
new'TextButton'y.RobloxLocked=true y.Name='InventoryButton'y.Size=UDim2.new(0,60
|
||||
,0,30)y.Position=UDim2.new(0,7,1,-31)y.BackgroundColor3=Color3.new(1,1,1)y.
|
||||
BorderColor3=Color3.new(1,1,1)y.Font=Enum.Font.ArialBold y.FontSize=Enum.
|
||||
FontSize.Size18 y.Text='Gear'y.AutoButtonColor=false y.TextColor3=Color3.new(0,0
|
||||
,0)y.Selected=true y.Active=true y.ZIndex=3 y.Parent=w if game.CoreGui.Version>=
|
||||
8 then local z=Instance.new'TextButton'z.RobloxLocked=true z.Name=
|
||||
'WardrobeButton'z.Size=UDim2.new(0,90,0,30)z.Position=UDim2.new(0,77,1,-31)z.
|
||||
BackgroundColor3=Color3.new(0,0,0)z.BorderColor3=Color3.new(1,1,1)z.Font=Enum.
|
||||
Font.ArialBold z.FontSize=Enum.FontSize.Size18 z.Text='Wardrobe'z.
|
||||
AutoButtonColor=false z.TextColor3=Color3.new(1,1,1)z.Selected=false z.Active=
|
||||
true z.Parent=w end local z=Instance.new'TextButton'z.RobloxLocked=true z.Name=
|
||||
'CloseButton'z.Font=Enum.Font.ArialBold z.FontSize=Enum.FontSize.Size24 z.
|
||||
Position=UDim2.new(1,-33,0,4)z.Size=UDim2.new(0,30,0,30)z.Style=Enum.ButtonStyle
|
||||
.RobloxButton z.Text=''z.TextColor3=Color3.new(1,1,1)z.Parent=w z.Modal=true
|
||||
local A=Instance.new'ImageLabel'A.RobloxLocked=true A.Name='XImage'game:
|
||||
GetService'ContentProvider':Preload'http://www.roblox.com/asset/?id=75547445'A.
|
||||
Image='http://www.roblox.com/asset/?id=75547445'A.BackgroundTransparency=1 A.
|
||||
Position=UDim2.new(-0.25,-1,-0.25,-1)A.Size=UDim2.new(1.5,2,1.5,2)A.ZIndex=2 A.
|
||||
Parent=z local B=Instance.new'Frame'B.RobloxLocked=true B.Name='SearchFrame'B.
|
||||
BackgroundTransparency=1 B.Position=UDim2.new(1,-220,0,2)B.Size=UDim2.new(0,220,
|
||||
0,24)B.Parent=s local C=Instance.new'ImageButton'C.RobloxLocked=true C.Name=
|
||||
'SearchButton'C.Size=UDim2.new(0,25,0,25)C.BackgroundTransparency=1 C.Image=
|
||||
'rbxasset://textures/ui/SearchIcon.png'C.Parent=B local D=Instance.new
|
||||
'TextButton'D.RobloxLocked=true D.Position=UDim2.new(0,25,0,0)D.Size=UDim2.new(1
|
||||
,-28,0,26)D.Name='SearchBoxFrame'D.Text=''D.Style=Enum.ButtonStyle.RobloxButton
|
||||
D.Parent=B local E=Instance.new'TextBox'E.RobloxLocked=true E.Name='SearchBox'E.
|
||||
BackgroundTransparency=1 E.Font=Enum.Font.ArialBold E.FontSize=Enum.FontSize.
|
||||
Size12 E.Position=UDim2.new(0,-5,0,-5)E.Size=UDim2.new(1,10,1,10)E.TextColor3=
|
||||
Color3.new(1,1,1)E.TextXAlignment=Enum.TextXAlignment.Left E.ZIndex=2 E.TextWrap
|
||||
=true E.Text='Search...'E.Parent=D local F=Instance.new'TextButton'F.
|
||||
RobloxLocked=true F.Visible=false F.Name='ResetButton'F.Position=UDim2.new(1,-26
|
||||
,0,3)F.Size=UDim2.new(0,20,0,20)F.Style=Enum.ButtonStyle.RobloxButtonDefault F.
|
||||
Text='X'F.TextColor3=Color3.new(1,1,1)F.Font=Enum.Font.ArialBold F.FontSize=Enum
|
||||
.FontSize.Size18 F.ZIndex=3 F.Parent=B local G=Instance.new'Frame'G.Name='Gear'G
|
||||
.RobloxLocked=true G.BackgroundTransparency=1 G.Size=UDim2.new(1,0,1,0)G.
|
||||
ClipsDescendants=true G.Parent=s local H=Instance.new'Frame'H.RobloxLocked=true
|
||||
H.Name='AssetsList'H.BackgroundTransparency=1 H.Size=UDim2.new(0.2,0,1,0)H.Style
|
||||
=Enum.FrameStyle.RobloxSquare H.Visible=false H.Parent=G local I=Instance.new
|
||||
'Frame'I.RobloxLocked=true I.Name='GearGrid'I.Size=UDim2.new(0.95,0,1,0)I.
|
||||
BackgroundTransparency=1 I.Parent=G local J=Instance.new'ImageButton'J.
|
||||
RobloxLocked=true J.Visible=false J.Name='GearButton'J.Size=UDim2.new(0,54,0,54)
|
||||
J.Style='Custom'J.BackgroundTransparency=1 J.Parent=I local K=Instance.new
|
||||
'ImageLabel'K.Name='Background'K.BackgroundTransparency=1 K.Image=
|
||||
'http://www.roblox.com/asset/?id=97613075'K.Size=UDim2.new(1,0,1,0)K.Parent=J
|
||||
local L=Instance.new'ObjectValue'L.RobloxLocked=true L.Name='GearReference'L.
|
||||
Parent=J local M=Instance.new'Frame'M.RobloxLocked=true M.Name='GreyOutButton'M.
|
||||
BackgroundTransparency=0.5 M.Size=UDim2.new(1,0,1,0)M.Active=true M.Visible=
|
||||
false M.ZIndex=3 M.Parent=J local N=Instance.new'TextLabel'N.RobloxLocked=true N
|
||||
.Name='GearText'N.BackgroundTransparency=1 N.Font=Enum.Font.Arial N.FontSize=
|
||||
Enum.FontSize.Size14 N.Position=UDim2.new(0,-8,0,-8)N.Size=UDim2.new(1,16,1,16)N
|
||||
.Text=''N.ZIndex=2 N.TextColor3=Color3.new(1,1,1)N.TextWrap=true N.Parent=J
|
||||
local O=Instance.new'Frame'O.RobloxLocked=true O.Name='GearGridScrollingArea'O.
|
||||
Position=UDim2.new(1,-19,0,35)O.Size=UDim2.new(0,17,1,-45)O.
|
||||
BackgroundTransparency=1 O.Parent=G local P=Instance.new'Frame'P.RobloxLocked=
|
||||
true P.Name='GearLoadouts'P.BackgroundTransparency=1 P.Position=UDim2.new(0.7,23
|
||||
,0.5,1)P.Size=UDim2.new(0.3,-23,0.5,-1)P.Parent=G P.Visible=false local Q=
|
||||
Instance.new'Frame'Q.RobloxLocked=true Q.Name='GearLoadoutsHeader'Q.
|
||||
BackgroundColor3=Color3.new(0,0,0)Q.BackgroundTransparency=0.2 Q.BorderColor3=
|
||||
Color3.new(1,0,0)Q.Size=UDim2.new(1,2,0.15,-1)Q.Parent=P local R=Instance.new
|
||||
'TextLabel'R.RobloxLocked=true R.Name='LoadoutsHeaderText'R.
|
||||
BackgroundTransparency=1 R.Font=Enum.Font.ArialBold R.FontSize=Enum.FontSize.
|
||||
Size18 R.Size=UDim2.new(1,0,1,0)R.Text='Loadouts'R.TextColor3=Color3.new(1,1,1)R
|
||||
.Parent=Q local S=O:clone()S.RobloxLocked=true S.Name=
|
||||
'GearLoadoutsScrollingArea'S.Position=UDim2.new(1,-15,0.15,2)S.Size=UDim2.new(0,
|
||||
17,0.85,-2)S.Parent=P local T=Instance.new'Frame'T.RobloxLocked=true T.Name=
|
||||
'LoadoutsList'T.Position=UDim2.new(0,0,0.15,2)T.Size=UDim2.new(1,-17,0.85,-2)T.
|
||||
Style=Enum.FrameStyle.RobloxSquare T.Parent=P local U=Instance.new'Frame'U.
|
||||
RobloxLocked=true U.Name='GearPreview'U.Position=UDim2.new(0.7,23,0,0)U.Size=
|
||||
UDim2.new(0.3,-28,0.5,-1)U.BackgroundTransparency=1 U.ZIndex=7 U.Parent=G local
|
||||
V=Instance.new'Frame'V.RobloxLocked=true V.Name='GearStats'V.
|
||||
BackgroundTransparency=1 V.Position=UDim2.new(0,0,0.75,0)V.Size=UDim2.new(1,0,
|
||||
0.25,0)V.ZIndex=8 V.Parent=U local W=Instance.new'TextLabel'W.RobloxLocked=true
|
||||
W.Name='GearName'W.BackgroundTransparency=1 W.Font=Enum.Font.ArialBold W.
|
||||
FontSize=Enum.FontSize.Size18 W.Position=UDim2.new(0,-3,0,0)W.Size=UDim2.new(1,6
|
||||
,1,5)W.Text=''W.TextColor3=Color3.new(1,1,1)W.TextWrap=true W.ZIndex=9 W.Parent=
|
||||
V local X=Instance.new'ImageLabel'X.RobloxLocked=true X.Name='GearImage'X.Image=
|
||||
''X.BackgroundTransparency=1 X.Position=UDim2.new(0.125,0,0,0)X.Size=UDim2.new(
|
||||
0.75,0,0.75,0)X.ZIndex=8 X.Parent=U local Y=Instance.new'Frame'Y.
|
||||
BackgroundColor3=Color3.new(0,0,0)Y.BackgroundTransparency=0.5 Y.BorderSizePixel
|
||||
=0 Y.RobloxLocked=true Y.Name='GearIcons'Y.Position=UDim2.new(0.4,2,0.85,-2)Y.
|
||||
Size=UDim2.new(0.6,0,0.15,0)Y.Visible=false Y.ZIndex=9 Y.Parent=X local Z=
|
||||
Instance.new'ImageLabel'Z.RobloxLocked=true Z.Name='GenreImage'Z.
|
||||
BackgroundColor3=Color3.new(0.4,0.6,1)Z.BackgroundTransparency=0.5 Z.
|
||||
BorderSizePixel=0 Z.Size=UDim2.new(0.25,0,1,0)Z.Parent=Y local _=Z:clone()_.
|
||||
RobloxLocked=true _.Name='AttributeOneImage'_.BackgroundColor3=Color3.new(1,0.2,
|
||||
0)_.Position=UDim2.new(0.25,0,0,0)_.Parent=Y local aa=Z:clone()aa.RobloxLocked=
|
||||
true aa.Name='AttributeTwoImage'aa.BackgroundColor3=Color3.new(0.6,1,0.6)aa.
|
||||
Position=UDim2.new(0.5,0,0,0)aa.Parent=Y local ab=Z:clone()ab.RobloxLocked=true
|
||||
ab.Name='AttributeThreeImage'ab.BackgroundColor3=Color3.new(0,0.5,0.5)ab.
|
||||
Position=UDim2.new(0.75,0,0,0)ab.Parent=Y if game.CoreGui.Version<8 then script:
|
||||
remove()return end local function makeCharFrame(ac,ad)local ae=Instance.new
|
||||
'Frame'ae.RobloxLocked=true ae.Size=UDim2.new(1,0,1,-70)ae.Position=UDim2.new(0,
|
||||
0,0,20)ae.Name=ac ae.BackgroundTransparency=1 ae.Parent=ad ae.Visible=false
|
||||
return ae end local function makeZone(ac,ad,ae,af,ag)local ah=Instance.new
|
||||
'ImageLabel'ah.RobloxLocked=true ah.Name=ac ah.Image=ad ah.Size=ae ah.
|
||||
BackgroundTransparency=1 ah.Position=af ah.Parent=ag return ah end
|
||||
local function makeStyledButton(ac,ad,ae,af,ag)local ah=Instance.new
|
||||
'ImageButton'ah.RobloxLocked=true ah.Name=ac ah.Size=ad ah.Position=ae if ag
|
||||
then ah.Style=ag else ah.BackgroundColor3=Color3.new(0,0,0)ah.BorderColor3=
|
||||
Color3.new(1,1,1)end ah.Parent=af return ah end local function makeTextLabel(ac,
|
||||
ad,ae,af)local ag=Instance.new'TextLabel'ag.RobloxLocked=true ag.
|
||||
BackgroundTransparency=1 ag.Size=UDim2.new(0,32,0,14)ag.Name=ac ag.Font=Enum.
|
||||
Font.Arial ag.TextColor3=Color3.new(1,1,1)ag.FontSize=Enum.FontSize.Size14 ag.
|
||||
Text=ad ag.Position=ae ag.Parent=af end local ac=Instance.new'Frame'ac.Name=
|
||||
'Wardrobe'ac.RobloxLocked=true ac.BackgroundTransparency=1 ac.Visible=false ac.
|
||||
Size=UDim2.new(1,0,1,0)ac.Parent=s local ad=Instance.new'Frame'ad.RobloxLocked=
|
||||
true ad.Name='AssetList'ad.Position=UDim2.new(0,4,0,5)ad.Size=UDim2.new(0,85,1,-
|
||||
5)ad.BackgroundTransparency=1 ad.Visible=true ad.Parent=ac local ae=Instance.new
|
||||
'Frame'ae.RobloxLocked=true ae.Name='PreviewAssetFrame'ae.BackgroundTransparency
|
||||
=1 ae.Position=UDim2.new(1,-240,0,30)ae.Size=UDim2.new(0,250,0,250)ae.Parent=ac
|
||||
local af=Instance.new'TextButton'af.RobloxLocked=true af.Name=
|
||||
'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',
|
||||
if game.CoreGui.Version<3 then return end local a a=function(b,c,d)if not(d~=nil
|
||||
)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for g,
|
||||
h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h end
|
||||
elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e.Parent=
|
||||
f return e end local b,c=script.Parent,nil c=function(d,e)while not d:
|
||||
FindFirstChild(e)do d.ChildAdded:wait()end end local d d=function(e,f)while not
|
||||
e[f]do e.Changed:wait()end end local e e=function()local f=false pcall(function(
|
||||
)f=Game:GetService'UserInputService'.TouchEnabled end)return f end local f f=
|
||||
function()if b.AbsoluteSize.Y<=320 then return true else return false end end c(
|
||||
game,'Players')d(game.Players,'LocalPlayer')local g=a('Frame','CurrentLoadout',{
|
||||
Position=UDim2.new(0.5,-300,1,-85),Size=UDim2.new(0,600,0,54),
|
||||
BackgroundTransparency=1,RobloxLocked=true,Parent=b,a('BoolValue','Debounce',{
|
||||
RobloxLocked=true}),a('ImageLabel','Background',{Size=UDim2.new(1.2,0,1.2,0),
|
||||
Image='http://www.roblox.com/asset/?id=96536002',BackgroundTransparency=1,
|
||||
Position=UDim2.new(-0.1,0,-0.1,0),ZIndex=0,Visible=false,a('ImageLabel',{Size=
|
||||
UDim2.new(1,0,0.025,1),Position=UDim2.new(0,0,0,0),Image=
|
||||
'http://www.roblox.com/asset/?id=97662207',BackgroundTransparency=1})})})c(b,
|
||||
'ControlFrame')a('ImageButton','BackpackButton',{RobloxLocked=true,Visible=false
|
||||
,BackgroundTransparency=1,Image='http://www.roblox.com/asset/?id=97617958',
|
||||
Position=UDim2.new(0.5,-60,1,-108),Size=UDim2.new(0,120,0,18),Parent=b.
|
||||
ControlFrame})local h=9 if f()then h=3 g.Size=UDim2.new(0,180,0,54)g.Position=
|
||||
UDim2.new(0.5,-90,1,-85)end for i=0,h do local j=a('Frame',{Name='Slot'..
|
||||
tostring(i),RobloxLocked=true,BackgroundColor3=Color3.new(0,0,0),
|
||||
BackgroundTransparency=1,BorderColor3=Color3.new(1,1,1),ZIndex=4,Position=UDim2.
|
||||
new((function()if i==0 then return 0.9,0,0,0 else return(i-1)*0.1,(i-1)*6,0,0
|
||||
end end)()),Size=UDim2.new(0,54,1,0),Parent=g})if b.AbsoluteSize.Y<=320 then j.
|
||||
Position=UDim2.new(0,(i-1)*60,0,-50)print('Well got here',j,j.Position.X.Scale,j
|
||||
.Position.X.Offset)if i==0 then j:Destroy()end end end local i=a('ImageButton',
|
||||
'TempSlot',{Active=true,Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Style=
|
||||
'Custom',Visible=false,RobloxLocked=true,ZIndex=3,Parent=g,a('ImageLabel',
|
||||
'Background',{BackgroundTransparency=1,Image=
|
||||
'http://www.roblox.com/asset/?id=97613075',Size=UDim2.new(1,0,1,0)}),a(
|
||||
'ObjectValue','GearReference',{RobloxLocked=true}),a('TextLabel','ToolTipLabel',
|
||||
{RobloxLocked=true,Text='',BackgroundTransparency=0.5,BorderSizePixel=0,Visible=
|
||||
false,TextColor3=Color3.new(1,1,1),BackgroundColor3=Color3.new(0,0,0),
|
||||
TextStrokeTransparency=0,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size14,
|
||||
Size=UDim2.new(1,60,0,20),Position=UDim2.new(0,-30,0,-30)}),a('BoolValue','Kill'
|
||||
,{RobloxLocked=true}),a('TextLabel','GearText',{RobloxLocked=true,
|
||||
BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,
|
||||
Position=UDim2.new(0,-8,0,-8),Size=UDim2.new(1,16,1,16),Text='',TextColor3=
|
||||
Color3.new(1,1,1),TextWrap=true,ZIndex=5}),a('ImageLabel','GearImage',{
|
||||
BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0),
|
||||
ZIndex=5,RobloxLocked=true})})local j=a('TextLabel','SlotNumber',{
|
||||
BackgroundTransparency=1,BorderSizePixel=0,Font=Enum.Font.ArialBold,FontSize=
|
||||
Enum.FontSize.Size18,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,10,0,15),
|
||||
TextColor3=Color3.new(1,1,1),TextTransparency=0,TextXAlignment=Enum.
|
||||
TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Bottom,RobloxLocked=true,
|
||||
Parent=i,ZIndex=5})if e()then j.Visible=false end local k do local l=j:Clone()l.
|
||||
Name='SlotNumberDownShadow'l.TextColor3=Color3.new(0,0,0)l.Position=UDim2.new(0,
|
||||
1,0,-1)l.Parent=i l.ZIndex=2 k=l end do local l=k:Clone()l.Name=
|
||||
'SlotNumberUpShadow'l.Position=UDim2.new(0,-1,0,-1)l.Parent=i end local l=a(
|
||||
'Frame','Backpack',{RobloxLocked=true,Visible=false,Position=UDim2.new(0.5,0,0.5
|
||||
,0),BackgroundColor3=Color3.new(0.12549019607843137,0.12549019607843137,
|
||||
0.12549019607843137),BackgroundTransparency=0,BorderSizePixel=0,Parent=b,Active=
|
||||
true,a('BoolValue','SwapSlot',{RobloxLocked=true,a('IntValue','Slot',{
|
||||
RobloxLocked=true}),a('ObjectValue','GearButton',{RobloxLocked=true})}),a(
|
||||
'Frame','SearchFrame',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2
|
||||
.new(1,-220,0,2),Size=UDim2.new(0,220,0,24),a('ImageButton','SearchButton',{
|
||||
RobloxLocked=true,Size=UDim2.new(0,25,0,25),BackgroundTransparency=1,Image=
|
||||
'rbxasset://textures/ui/SearchIcon.png'}),a('TextButton','ResetButton',{
|
||||
RobloxLocked=true,Visible=false,Position=UDim2.new(1,-26,0,3),Size=UDim2.new(0,
|
||||
20,0,20),Style=Enum.ButtonStyle.RobloxButtonDefault,Text='X',TextColor3=Color3.
|
||||
new(1,1,1),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,ZIndex=3}),a(
|
||||
'TextButton','SearchBoxFrame',{RobloxLocked=true,Position=UDim2.new(0,25,0,0),
|
||||
Size=UDim2.new(1,-28,0,26),Text='',Style=Enum.ButtonStyle.RobloxButton,a(
|
||||
'TextBox','SearchBox',{RobloxLocked=true,BackgroundTransparency=1,Font=Enum.Font
|
||||
.ArialBold,FontSize=Enum.FontSize.Size12,Position=UDim2.new(0,-5,0,-5),Size=
|
||||
UDim2.new(1,10,1,10),TextColor3=Color3.new(1,1,1),TextXAlignment=Enum.
|
||||
TextXAlignment.Left,ZIndex=2,TextWrap=true,Text='Search...'})})})})local m=a(
|
||||
'Frame','Tabs',{Visible=false,Active=false,RobloxLocked=true,BackgroundColor3=
|
||||
Color3.new(0,0,0),BackgroundTransparency=0.08,BorderSizePixel=0,Position=UDim2.
|
||||
new(0,0,-0.1,-4),Size=UDim2.new(1,0,0.1,4),Parent=l,a('Frame','TabLine',{
|
||||
RobloxLocked=true,BackgroundColor3=Color3.new(0.20784313725490197,
|
||||
0.20784313725490197,0.20784313725490197),BorderSizePixel=0,Position=UDim2.new(0,
|
||||
5,1,-4),Size=UDim2.new(1,-10,0,4),ZIndex=2}),a('TextButton','InventoryButton',{
|
||||
RobloxLocked=true,Size=UDim2.new(0,60,0,30),Position=UDim2.new(0,7,1,-31),
|
||||
BackgroundColor3=Color3.new(1,1,1),BorderColor3=Color3.new(1,1,1),Font=Enum.Font
|
||||
.ArialBold,FontSize=Enum.FontSize.Size18,Text='Gear',AutoButtonColor=false,
|
||||
TextColor3=Color3.new(0,0,0),Selected=true,Active=true,ZIndex=3}),a('TextButton'
|
||||
,'CloseButton',{RobloxLocked=true,Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||
FontSize.Size24,Position=UDim2.new(1,-33,0,4),Size=UDim2.new(0,30,0,30),Style=
|
||||
Enum.ButtonStyle.RobloxButton,Text='',TextColor3=Color3.new(1,1,1),Modal=true,a(
|
||||
'ImageLabel','XImage',{RobloxLocked=true,Image=(function()game:GetService
|
||||
'ContentProvider':Preload'http://www.roblox.com/asset/?id=75547445'return
|
||||
'http://www.roblox.com/asset/?id=75547445'end)(),BackgroundTransparency=1,
|
||||
Position=UDim2.new(-0.25,-1,-0.25,-1),Size=UDim2.new(1.5,2,1.5,2),ZIndex=2})})})
|
||||
if game.CoreGui.Version>=8 then a('TextButton','WardrobeButton',{RobloxLocked=
|
||||
true,Size=UDim2.new(0,90,0,30),Position=UDim2.new(0,77,1,-31),BackgroundColor3=
|
||||
Color3.new(0,0,0),BorderColor3=Color3.new(1,1,1),Font=Enum.Font.ArialBold,
|
||||
FontSize=Enum.FontSize.Size18,Text='Wardrobe',AutoButtonColor=false,TextColor3=
|
||||
Color3.new(1,1,1),Selected=false,Active=true,Parent=m})end local n=a('Frame',
|
||||
'Gear',{RobloxLocked=true,BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),
|
||||
ClipsDescendants=true,Parent=l,a('Frame','AssetsList',{RobloxLocked=true,
|
||||
BackgroundTransparency=1,Size=UDim2.new(0.2,0,1,0),Style=Enum.FrameStyle.
|
||||
RobloxSquare,Visible=false}),a('Frame','GearGrid',{RobloxLocked=true,Size=UDim2.
|
||||
new(0.95,0,1,0),BackgroundTransparency=1,a('ImageButton','GearButton',{
|
||||
RobloxLocked=true,Visible=false,Size=UDim2.new(0,54,0,54),Style='Custom',
|
||||
BackgroundTransparency=1,a('ImageLabel','Background',{BackgroundTransparency=1,
|
||||
Image='http://www.roblox.com/asset/?id=97613075',Size=UDim2.new(1,0,1,0)}),a(
|
||||
'ObjectValue','GearReference',{RobloxLocked=true}),a('Frame','GreyOutButton',{
|
||||
RobloxLocked=true,BackgroundTransparency=0.5,Size=UDim2.new(1,0,1,0),Active=true
|
||||
,Visible=false,ZIndex=3}),a('TextLabel','GearText',{RobloxLocked=true,
|
||||
BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,
|
||||
Position=UDim2.new(0,-8,0,-8),Size=UDim2.new(1,16,1,16),Text='',ZIndex=2,
|
||||
TextColor3=Color3.new(1,1,1),TextWrap=true})})})})local o,p=a('Frame',
|
||||
'GearGridScrollingArea',{RobloxLocked=true,Position=UDim2.new(1,-19,0,35),Size=
|
||||
UDim2.new(0,17,1,-45),BackgroundTransparency=1,Parent=n}),a('Frame',
|
||||
'GearLoadouts',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2.new(
|
||||
0.7,23,0.5,1),Size=UDim2.new(0.3,-23,0.5,-1),Parent=n,Visible=false,a('Frame',
|
||||
'LoadoutsList',{RobloxLocked=true,Position=UDim2.new(0,0,0.15,2),Size=UDim2.new(
|
||||
1,-17,0.85,-2),Style=Enum.FrameStyle.RobloxSquare}),a('Frame',
|
||||
'GearLoadoutsHeader',{RobloxLocked=true,BackgroundColor3=Color3.new(0,0,0),
|
||||
BackgroundTransparency=0.2,BorderColor3=Color3.new(1,0,0),Size=UDim2.new(1,2,
|
||||
0.15,-1),a('TextLabel','LoadoutsHeaderText',{RobloxLocked=true,
|
||||
BackgroundTransparency=1,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,
|
||||
Size=UDim2.new(1,0,1,0),Text='Loadouts',TextColor3=Color3.new(1,1,1)})})})do
|
||||
local q=o:Clone()q.Name='GearLoadoutsScrollingArea'q.RobloxLocked=true q.
|
||||
Position=UDim2.new(1,-15,0.15,2)q.Size=UDim2.new(0,17,0.85,-2)q.Parent=p end
|
||||
local q,r,s=a('Frame','GearPreview',{RobloxLocked=true,Position=UDim2.new(0.7,23
|
||||
,0,0),Size=UDim2.new(0.3,-28,0.5,-1),BackgroundTransparency=1,ZIndex=7,Parent=n,
|
||||
a('Frame','GearStats',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2
|
||||
.new(0,0,0.75,0),Size=UDim2.new(1,0,0.25,0),ZIndex=8,a('TextLabel','GearName',{
|
||||
RobloxLocked=true,BackgroundTransparency=1,Font=Enum.Font.ArialBold,FontSize=
|
||||
Enum.FontSize.Size18,Position=UDim2.new(0,-3,0,0),Size=UDim2.new(1,6,1,5),Text=
|
||||
'',TextColor3=Color3.new(1,1,1),TextWrap=true,ZIndex=9})}),a('ImageLabel',
|
||||
'GearImage',{RobloxLocked=true,Image='',BackgroundTransparency=1,Position=UDim2.
|
||||
new(0.125,0,0,0),Size=UDim2.new(0.75,0,0.75,0),ZIndex=8,a('Frame','GearIcons',{
|
||||
BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,BorderSizePixel=0,
|
||||
RobloxLocked=true,Position=UDim2.new(0.4,2,0.85,-2),Size=UDim2.new(0.6,0,0.15,0)
|
||||
,Visible=false,ZIndex=9,a('ImageLabel','GenreImage',{RobloxLocked=true,
|
||||
BackgroundColor3=Color3.new(0.4,0.6,1),BackgroundTransparency=0.5,
|
||||
BorderSizePixel=0,Size=UDim2.new(0.25,0,1,0)})})})}),nil,nil do local t=q.
|
||||
GearImage r,s=t.GearIcons,t.GearIcons.GenreImage end do local t=s:Clone()t.Name=
|
||||
'AttributeOneImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(1,0.2,0)t.
|
||||
Position=UDim2.new(0.25,0,0,0)t.Parent=r end do local t=s:Clone()t.Name=
|
||||
'AttributeTwoImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(0.6,1,0.6)t
|
||||
.Position=UDim2.new(0.5,0,0,0)t.Parent=r end do local t=s:Clone()t.Name=
|
||||
'AttributeThreeImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(0,0.5,0.5
|
||||
)t.Position=UDim2.new(0.75,0,0,0)t.Parent=r end if game.CoreGui.Version<8 then
|
||||
script:remove()return end local t t=function(u,v)return a('Frame',tostring(u),{
|
||||
RobloxLocked=true,Size=UDim2.new(1,0,1,-70),Position=UDim2.new(0,0,0,20),
|
||||
BackgroundTransparency=1,Parent=v,Visible=false})end local u u=function(v,w,x,y,
|
||||
z)return a('ImageLabel',tostring(v),{RobloxLocked=true,Image=w,Size=x,
|
||||
BackgroundTransparency=1,Position=y,Parent=z})end local v v=function(w,x,y,z,A)
|
||||
local B=a('ImageButton',tostring(w),{RobloxLocked=true,Size=x,Position=y})if A
|
||||
then B.Style=A else B.BackgroundColor3=Color3.new(0,0,0)B.BorderColor3=Color3.
|
||||
new(1,1,1)end B.Parent=z return B end local w w=function(x,y,z,A)return a(
|
||||
'TextLabel',{Name=x,RobloxLocked=true,BackgroundTransparency=1,Size=UDim2.new(0,
|
||||
32,0,14),Font=Enum.Font.Arial,TextColor3=Color3.new(1,1,1),FontSize=Enum.
|
||||
FontSize.Size14,Text=y,Position=z,Parent=A})end local x=a('Frame','Wardrobe',{
|
||||
RobloxLocked=true,BackgroundTransparency=1,Visible=false,Size=UDim2.new(1,0,1,0)
|
||||
,Parent=l,a('Frame','AssetList',{RobloxLocked=true,Position=UDim2.new(0,4,0,5),
|
||||
Size=UDim2.new(0,85,1,-5),BackgroundTransparency=1,Visible=true}),a('TextButton'
|
||||
,'PreviewButton',{RobloxLocked=true,Text='Rotate',BackgroundColor3=Color3.new(0,
|
||||
0,0),BackgroundTransparency=0.5,BorderColor3=Color3.new(1,1,1),Position=UDim2.
|
||||
new(1.2,-62,1,-50),Size=UDim2.new(0,125,0,50),Font=Enum.Font.ArialBold,FontSize=
|
||||
Enum.FontSize.Size24,TextColor3=Color3.new(1,1,1),TextWrapped=true,
|
||||
TextStrokeTransparency=0})})local y=a('Frame','PreviewAssetFrame',{RobloxLocked=
|
||||
true,BackgroundTransparency=1,Position=UDim2.new(1,-240,0,30),Size=UDim2.new(0,
|
||||
250,0,250),Parent=x})local z=a('TextButton','PreviewAssetBacking',{RobloxLocked=
|
||||
true,Active=false,Text='',AutoButtonColor=false,Size=UDim2.new(1,0,1,0),Style=
|
||||
Enum.ButtonStyle.RobloxButton,Visible=false,ZIndex=9,Parent=y,a('ImageLabel',
|
||||
'PreviewAssetImage',{RobloxLocked=true,BackgroundTransparency=0.8,Position=UDim2
|
||||
.new(0.5,-100,0,0),Size=UDim2.new(0,200,0,200),BorderSizePixel=0,ZIndex=10})})
|
||||
local A=a('TextLabel','AssetNameLabel',{RobloxLocked=true,BackgroundTransparency
|
||||
=1,Position=UDim2.new(0,0,1,-20),Size=UDim2.new(0.5,0,0,24),ZIndex=10,Font=Enum.
|
||||
Font.Arial,Text='',TextColor3=Color3.new(1,1,1),TextScaled=true,Parent=z})do
|
||||
local B=A:Clone()B.Name='AssetTypeLabel'B.RobloxLocked=true B.TextScaled=false B
|
||||
.FontSize=Enum.FontSize.Size18 B.Position=UDim2.new(0.5,3,1,-20)B.Parent=z end
|
||||
local B=a('Frame','CharacterPane',{RobloxLocked=true,Position=UDim2.new(1,-220,0
|
||||
,32),Size=UDim2.new(0,220,1,-40),BackgroundTransparency=1,Visible=true,Parent=x,
|
||||
a('TextLabel','CategoryLabel',{RobloxLocked=true,BackgroundTransparency=1,Font=
|
||||
Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,Position=UDim2.new(0,0,0,-7),
|
||||
Size=UDim2.new(1,0,0,20),TextXAlignment=Enum.TextXAlignment.Center,Text='All',
|
||||
TextColor3=Color3.new(1,1,1)}),a('TextButton','SaveButton',{RobloxLocked=true,
|
||||
Size=UDim2.new(0.6,0,0,50),Position=UDim2.new(0.2,0,1,-50),Style=Enum.
|
||||
ButtonStyle.RobloxButton,Selected=false,Font=Enum.Font.ArialBold,FontSize=Enum.
|
||||
FontSize.Size18,Text='Save',TextColor3=Color3.new(1,1,1)})})local C=t(
|
||||
'FacesFrame',B)game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=75460621'u('FaceZone',
|
||||
'http://www.roblox.com/asset/?id=75460621',UDim2.new(0,157,0,137),UDim2.new(0.5,
|
||||
-78,0.5,-68),al)makeStyledButton('Face',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,
|
||||
0.5,-135),al)local am=makeCharFrame('HeadsFrame',ak)makeZone('FaceZone',
|
||||
'http://www.roblox.com/asset/?id=75460621',UDim2.new(0,157,0,137),UDim2.new(0.5,
|
||||
-78,0.5,-68),am)makeStyledButton('Head',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,
|
||||
0.5,-135),am)local an=makeCharFrame('HatsFrame',ak)game:GetService
|
||||
'ContentProvider':Preload'http://www.roblox.com/asset/?id=75457888'local ao=
|
||||
makeZone('HatsZone','http://www.roblox.com/asset/?id=75457888',UDim2.new(0,186,0
|
||||
,184),UDim2.new(0.5,-93,0.5,-100),an)makeStyledButton('Hat1Button',UDim2.new(0,
|
||||
64,0,64),UDim2.new(0,-1,0,-1),ao,Enum.ButtonStyle.RobloxButton)makeStyledButton(
|
||||
'Hat2Button',UDim2.new(0,64,0,64),UDim2.new(0,63,0,-1),ao,Enum.ButtonStyle.
|
||||
RobloxButton)makeStyledButton('Hat3Button',UDim2.new(0,64,0,64),UDim2.new(0,127,
|
||||
0,-1),ao,Enum.ButtonStyle.RobloxButton)local ap=makeCharFrame('PantsFrame',ak)
|
||||
game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=75457920'makeZone('PantsZone',
|
||||
-78,0.5,-68),C)v('Face',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),C)local
|
||||
D=t('HeadsFrame',B)u('FaceZone','http://www.roblox.com/asset/?id=75460621',UDim2
|
||||
.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),D)v('Head',UDim2.new(0,64,0,64),
|
||||
UDim2.new(0.5,-32,0.5,-135),D)local E=t('HatsFrame',B)game:GetService
|
||||
'ContentProvider':Preload'http://www.roblox.com/asset/?id=75457888'local F=u(
|
||||
'HatsZone','http://www.roblox.com/asset/?id=75457888',UDim2.new(0,186,0,184),
|
||||
UDim2.new(0.5,-93,0.5,-100),E)v('Hat1Button',UDim2.new(0,64,0,64),UDim2.new(0,-1
|
||||
,0,-1),F,Enum.ButtonStyle.RobloxButton)v('Hat2Button',UDim2.new(0,64,0,64),UDim2
|
||||
.new(0,63,0,-1),F,Enum.ButtonStyle.RobloxButton)v('Hat3Button',UDim2.new(0,64,0,
|
||||
64),UDim2.new(0,127,0,-1),F,Enum.ButtonStyle.RobloxButton)local G=t('PantsFrame'
|
||||
,B)game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=75457920'u('PantsZone',
|
||||
'http://www.roblox.com/asset/?id=75457920',UDim2.new(0,121,0,99),UDim2.new(0.5,-
|
||||
60,0.5,-100),ap)local aq=Instance.new'Frame'aq.RobloxLocked=true aq.Size=UDim2.
|
||||
new(0,25,0,56)aq.Position=UDim2.new(0.5,-26,0.5,0)aq.BackgroundColor3=Color3.
|
||||
new(0,0,0)aq.BorderColor3=Color3.new(1,1,1)aq.Name='PantFrame'aq.Parent=ap local
|
||||
ar=aq:clone()ar.Position=UDim2.new(0.5,3,0.5,0)ar.RobloxLocked=true ar.Parent=ap
|
||||
local as=Instance.new'ImageButton'as.RobloxLocked=true as.BackgroundTransparency
|
||||
=1 as.ZIndex=2 as.Name='CurrentPants'as.Position=UDim2.new(0.5,-31,0.5,-4)as.
|
||||
Size=UDim2.new(0,54,0,59)as.Parent=ap local at=makeCharFrame('PackagesFrame',ak)
|
||||
local au=makeStyledButton('TorsoMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-
|
||||
32,0.5,-110),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('TorsoLabel','Torso'
|
||||
,UDim2.new(0.5,-16,0,-25),au)local av=makeStyledButton('LeftLegMeshButton',UDim2
|
||||
.new(0,64,0,64),UDim2.new(0.5,0,0.5,-25),at,Enum.ButtonStyle.RobloxButton)
|
||||
makeTextLabel('LeftLegLabel','Left Leg',UDim2.new(0.5,-16,0,-25),av)local aw=
|
||||
makeStyledButton('RightLegMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-64,0.5
|
||||
,-25),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('RightLegLabel','Right Leg'
|
||||
,UDim2.new(0.5,-16,0,-25),aw)local ax=makeStyledButton('RightArmMeshButton',
|
||||
UDim2.new(0,64,0,64),UDim2.new(0.5,-96,0.5,-110),at,Enum.ButtonStyle.
|
||||
RobloxButton)makeTextLabel('RightArmLabel','Right Arm',UDim2.new(0.5,-16,0,-25),
|
||||
ax)local ay=makeStyledButton('LeftArmMeshButton',UDim2.new(0,64,0,64),UDim2.new(
|
||||
0.5,32,0.5,-110),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('LeftArmLabel',
|
||||
'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',
|
||||
60,0.5,-100),G)local H=a('Frame','PantFrame',{RobloxLocked=true,Size=UDim2.new(0
|
||||
,25,0,56),Position=UDim2.new(0.5,-26,0.5,0),BackgroundColor3=Color3.new(0,0,0),
|
||||
BorderColor3=Color3.new(1,1,1),Parent=G})do local I=H:Clone()I.Position=UDim2.
|
||||
new(0.5,3,0.5,0)I.RobloxLocked=true I.Parent=G end a('ImageButton',
|
||||
'CurrentPants',{RobloxLocked=true,BackgroundTransparency=1,ZIndex=2,Position=
|
||||
UDim2.new(0.5,-31,0.5,-4),Size=UDim2.new(0,54,0,59),Parent=G})local I=t(
|
||||
'PackagesFrame',B)local J=v('TorsoMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5
|
||||
,-32,0.5,-110),I,Enum.ButtonStyle.RobloxButton)w('TorsoLabel','Torso',UDim2.new(
|
||||
0.5,-16,0,-25),J)local K=v('LeftLegMeshButton',UDim2.new(0,64,0,64),UDim2.new(
|
||||
0.5,0,0.5,-25),I,Enum.ButtonStyle.RobloxButton)w('LeftLegLabel','Left Leg',UDim2
|
||||
.new(0.5,-16,0,-25),K)local L=v('RightLegMeshButton',UDim2.new(0,64,0,64),UDim2.
|
||||
new(0.5,-64,0.5,-25),I,Enum.ButtonStyle.RobloxButton)w('RightLegLabel',
|
||||
'Right Leg',UDim2.new(0.5,-16,0,-25),L)local M=v('RightArmMeshButton',UDim2.new(
|
||||
0,64,0,64),UDim2.new(0.5,-96,0.5,-110),I,Enum.ButtonStyle.RobloxButton)w(
|
||||
'RightArmLabel','Right Arm',UDim2.new(0.5,-16,0,-25),M)local N=v(
|
||||
'LeftArmMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,32,0.5,-110),I,Enum.
|
||||
ButtonStyle.RobloxButton)w('LeftArmLabel','Left Arm',UDim2.new(0.5,-16,0,-25),N)
|
||||
local O=t('T-ShirtsFrame',B)game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=75460642'u('TShirtZone',
|
||||
'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5,
|
||||
-60,0.5,-100),az)makeStyledButton('TShirtButton',UDim2.new(0,64,0,64),UDim2.new(
|
||||
0.5,-32,0.5,-64),az)local aA=makeCharFrame('ShirtsFrame',ak)makeZone('ShirtZone'
|
||||
,'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(
|
||||
0.5,-32,0.5,-64),aA)local aB=makeCharFrame('ColorFrame',ak)game:GetService
|
||||
'ContentProvider':Preload'http://www.roblox.com/asset/?id=76049888'local aC=
|
||||
makeZone('ColorZone','http://www.roblox.com/asset/?id=76049888',UDim2.new(0,120,
|
||||
0,150),UDim2.new(0.5,-60,0.5,-100),aB)makeStyledButton('Head',UDim2.new(0.26,0,
|
||||
0.19,0),UDim2.new(0.37,0,0.02,0),aC).AutoButtonColor=false makeStyledButton(
|
||||
'LeftArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26,0),aC).AutoButtonColor=
|
||||
false makeStyledButton('RightArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.025,0,
|
||||
0.26,0),aC).AutoButtonColor=false makeStyledButton('Torso',UDim2.new(0.43,0,0.36
|
||||
,0),UDim2.new(0.28,0,0.26,0),aC).AutoButtonColor=false makeStyledButton(
|
||||
'RightLeg',UDim2.new(0.19,0,0.31,0),UDim2.new(0.275,0,0.67,0),aC).
|
||||
AutoButtonColor=false makeStyledButton('LeftLeg',UDim2.new(0.19,0,0.31,0),UDim2.
|
||||
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()
|
||||
-60,0.5,-100),O)v('TShirtButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64)
|
||||
,O)local P=t('ShirtsFrame',B)u('ShirtZone',
|
||||
'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5,
|
||||
-60,0.5,-100),P)v('ShirtButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),
|
||||
P)local Q=t('ColorFrame',B)game:GetService'ContentProvider':Preload
|
||||
'http://www.roblox.com/asset/?id=76049888'local R=u('ColorZone',
|
||||
'http://www.roblox.com/asset/?id=76049888',UDim2.new(0,120,0,150),UDim2.new(0.5,
|
||||
-60,0.5,-100),Q)v('Head',UDim2.new(0.26,0,0.19,0),UDim2.new(0.37,0,0.02,0),R).
|
||||
AutoButtonColor=false v('LeftArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26
|
||||
,0),R).AutoButtonColor=false v('RightArm',UDim2.new(0.19,0,0.36,0),UDim2.new(
|
||||
0.025,0,0.26,0),R).AutoButtonColor=false v('Torso',UDim2.new(0.43,0,0.36,0),
|
||||
UDim2.new(0.28,0,0.26,0),R).AutoButtonColor=false v('RightLeg',UDim2.new(0.19,0,
|
||||
0.31,0),UDim2.new(0.275,0,0.67,0),R).AutoButtonColor=false v('LeftLeg',UDim2.
|
||||
new(0.19,0,0.31,0),UDim2.new(0.525,0,0.67,0),R).AutoButtonColor=false return
|
||||
script:Destroy()
|
||||
|
|
@ -1,240 +1,227 @@
|
|||
if game.CoreGui.Version<3 then return end local function waitForChild(a,b)while
|
||||
not a:FindFirstChild(b)do a.ChildAdded:wait()end return a:FindFirstChild(b)end
|
||||
local function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end
|
||||
local a,b,c,d=script.Parent,'gear',true,game:GetService'CoreGui':FindFirstChild
|
||||
'RobloxGui'assert(d)local e=waitForChild(d,'ControlFrame')local f,g=
|
||||
waitForChild(e,'BackpackButton'),waitForChild(d,'Backpack')waitForChild(d,
|
||||
'CurrentLoadout')waitForChild(d.CurrentLoadout,'TempSlot')waitForChild(d.
|
||||
CurrentLoadout.TempSlot,'SlotNumber')waitForChild(a,'Background')local h=a.
|
||||
Background local function IsTouchDevice()local i=false pcall(function()i=Game:
|
||||
GetService'UserInputService'.TouchEnabled end)return i end local function
|
||||
moveHealthBar(i)waitForChild(i,'HealthGUI')waitForChild(i['HealthGUI'],'tray')
|
||||
local j=i['HealthGUI']['tray']j.Position=UDim2.new(0.5,-85,1,-26)end
|
||||
local function setHealthBarVisible(i,j)waitForChild(i,'HealthGUI')waitForChild(i
|
||||
['HealthGUI'],'tray')local k=i['HealthGUI']['tray']k.Visible=j end waitForChild(
|
||||
game,'Players')waitForProperty(game.Players,'LocalPlayer')local i=game.Players.
|
||||
LocalPlayer waitForChild(i,'PlayerGui')Spawn(function()moveHealthBar(i.PlayerGui
|
||||
)end)while i.Character==nil do wait(0.03)end local j=waitForChild(i.Character,
|
||||
'Humanoid')j.Died:connect(function()f.Visible=false end)waitForChild(game,
|
||||
'LocalBackpack')game.LocalBackpack:SetOldSchoolBackpack(false)waitForChild(a.
|
||||
Parent,'Backpack')local k=a.Parent.Backpack local l=waitForChild(k,
|
||||
'CoreScripts/BackpackScripts/BackpackManager')local m,n,o,p,q=waitForChild(l,
|
||||
'BackpackOpenEvent'),waitForChild(l,'BackpackCloseEvent'),waitForChild(l,
|
||||
'TabClickedEvent'),true,10 if d.AbsoluteSize.Y<=320 then q=4 end local r,s,t,u=
|
||||
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)
|
||||
,true,0.5,false,{},{}for C=1,q do B[C]='empty'end local C=false local function
|
||||
backpackIsOpen()if k then return k.Visible end return false end local function
|
||||
kill(D,E,F)if E then E:disconnect()end if D==true and F then reorganizeLoadout(F
|
||||
,false)end end function registerNumberKeys()for D=0,9 do game:GetService
|
||||
'GuiService':AddKey(tostring(D))end end function unregisterNumberKeys()pcall(
|
||||
function()for D=0,9 do game:GetService'GuiService':RemoveKey(tostring(D))end end
|
||||
)end function characterInWorkspace()if game.Players['LocalPlayer']then if game.
|
||||
Players.LocalPlayer['Character']then if game.Players.LocalPlayer.Character~=nil
|
||||
then if game.Players.LocalPlayer.Character.Parent~=nil then return true end end
|
||||
end end return false end function removeGear(D)local E=nil for F=1,#B do if B[F]
|
||||
==D and D.Parent~=nil then E=F break end end if E then if B[E].GearReference.
|
||||
Value then if B[E].GearReference.Value.Parent==game.Players.LocalPlayer.
|
||||
Character then B[E].GearReference.Value.Parent=game.Players.LocalPlayer.Backpack
|
||||
end if B[E].GearReference.Value:IsA'HopperBin'and B[E].GearReference.Value.
|
||||
Active then B[E].GearReference.Value:Disable()B[E].GearReference.Value.Active=
|
||||
false end end B[E]='empty'delay(0,function()D:remove()end)Spawn(function()while
|
||||
backpackIsOpen()do wait(0.03)end waitForChild(i,'Backpack')local F=true for G=1,
|
||||
#B do if B[G]~='empty'then F=false end end if F then if#i.Backpack:GetChildren()
|
||||
<1 then f.Visible=false else f.Position=UDim2.new(0.5,-60,1,-44)end h.Visible=
|
||||
false end end)end end function insertGear(D,E)local F=nil if not E then for G=1,
|
||||
#B do if B[G]=='empty'then F=G break end end if F==1 and B[1]~='empty'then D:
|
||||
remove()return end else F=E local G=1 for H=1,#B do if B[H]=='empty'then G=H
|
||||
break end end for H=G,F+1,-1 do B[H]=B[H-1]if H==10 then B[H].SlotNumber.Text=
|
||||
'0'B[H].SlotNumberDownShadow.Text='0'B[H].SlotNumberUpShadow.Text='0'else B[H].
|
||||
SlotNumber.Text=H B[H].SlotNumberDownShadow.Text=H B[H].SlotNumberUpShadow.Text=
|
||||
H end end end B[F]=D if F~=q then if type(tostring(F))=='string'then local G=
|
||||
tostring(F)D.SlotNumber.Text=G D.SlotNumberDownShadow.Text=G D.
|
||||
SlotNumberUpShadow.Text=G end else D.SlotNumber.Text='0'D.SlotNumberDownShadow.
|
||||
Text='0'D.SlotNumberUpShadow.Text='0'end D.Visible=true local G=nil G=D.Kill.
|
||||
Changed:connect(function(H)kill(H,G,D)end)end function reorganizeLoadout(D,E,F,G
|
||||
)if E then insertGear(D,G)else removeGear(D)end if D~='empty'then D.ZIndex=1 end
|
||||
end function checkToolAncestry(D,E)if D:FindFirstChild'RobloxBuildTool'then
|
||||
return end if D:IsA'Tool'or D:IsA'HopperBin'then for F=1,#B do if B[F]~='empty'
|
||||
and B[F].GearReference.Value==D then if E==nil then B[F].Kill.Value=true return
|
||||
false elseif D.Parent==i.Character then B[F].Selected=true return true elseif D.
|
||||
Parent==i.Backpack then if D:IsA'Tool'or D:IsA'HopperBin'then B[F].Selected=
|
||||
false end return true end B[F].Kill.Value=true return false end end end end
|
||||
function removeAllEquippedGear(D)local E=i.Character:GetChildren()for F=1,#E do
|
||||
if(E[F]:IsA'Tool'or E[F]:IsA'HopperBin')and E[F]~=D then if E[F]:IsA'Tool'then E
|
||||
[F].Parent=i.Backpack end if E[F]:IsA'HopperBin'then E[F]:Disable()end end end
|
||||
end function hopperBinSwitcher(D,E)if not E then return end E:ToggleSelect()if B
|
||||
[D]=='empty'then return end if not E.Active then B[D].Selected=false
|
||||
normalizeButton(B[D])else B[D].Selected=true enlargeButton(B[D])end end function
|
||||
toolSwitcher(D)if not B[D]then return end local E=B[D].GearReference.Value if E
|
||||
==nil then return end removeAllEquippedGear(E)local F=D if D==0 then F=10 end
|
||||
for G=1,#B do if B[G]and B[G]~='empty'and G~=F then normalizeButton(B[G])B[G].
|
||||
Selected=false if B[G].GearReference and B[G].GearReference.Value and B[G].
|
||||
GearReference.Value:IsA'HopperBin'and B[G].GearReference.Value.Active then B[G].
|
||||
GearReference.Value:ToggleSelect()end end end if E:IsA'HopperBin'then
|
||||
hopperBinSwitcher(D,E)else if E.Parent==i.Character then E.Parent=i.Backpack if
|
||||
B[D]~='empty'then B[D].Selected=false normalizeButton(B[D])end else E.Parent=i.
|
||||
Character B[D].Selected=true enlargeButton(B[D])end end end function
|
||||
activateGear(D)local E=nil if D=='0'then E=10 else E=tonumber(D)end if E==nil
|
||||
then return end if B[E]~='empty'then toolSwitcher(E)end end enlargeButton=
|
||||
function(D)if D.Size.Y.Scale>1 then return end if not D.Parent then return end
|
||||
if not D.Selected then return end for E=1,#B do if B[E]=='empty'then break end
|
||||
if B[E]~=D then normalizeButton(B[E])end end if not x then return end if D:
|
||||
FindFirstChild'Highlight'then D.Highlight.Visible=true end if D:IsA'ImageButton'
|
||||
or D:IsA'TextButton'then D.ZIndex=5 local E,F=-(v.X.Scale-D.Size.X.Scale)/2,-(v.
|
||||
Y.Scale-D.Size.Y.Scale)/2 D:TweenSizeAndPosition(v,UDim2.new(D.Position.X.Scale+
|
||||
E,D.Position.X.Offset,D.Position.Y.Scale+F,D.Position.Y.Offset),Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quad,y/5,x)end end normalizeAllButtons=
|
||||
function()for D=1,#B do if B[D]=='empty'then break end if B[D]~=button then
|
||||
normalizeButton(B[D],0.1)end end end normalizeButton=function(D,E)if not D then
|
||||
return end if D.Size.Y.Scale<=1 then return end if D.Selected then return end if
|
||||
not D.Parent then return end local F=E if F==nil or type(F)~='number'then F=y/5
|
||||
end if D:FindFirstChild'Highlight'then D.Highlight.Visible=false end if D:IsA
|
||||
'ImageButton'or D:IsA'TextButton'then D.ZIndex=1 local G,H=-(w.X.Scale-D.Size.X.
|
||||
Scale)/2,-(w.Y.Scale-D.Size.Y.Scale)/2 D:TweenSizeAndPosition(w,UDim2.new(D.
|
||||
Position.X.Scale+G,D.Position.X.Offset,D.Position.Y.Scale+H,D.Position.Y.Offset)
|
||||
,Enum.EasingDirection.Out,Enum.EasingStyle.Quad,F,x)end end local D=function()
|
||||
while t do wait()end end function pointInRectangle(E,F,G)if E.x>F.x and E.x<(F.x
|
||||
+G.x)then if E.y>F.y and E.y<(F.y+G.y)then return true end end return false end
|
||||
function swapGear(E,F)local G=F:GetChildren()if#G==1 then if G[1]:FindFirstChild
|
||||
'SlotNumber'then local H,I=tonumber(G[1].SlotNumber.Text),tonumber(E.SlotNumber.
|
||||
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
|
||||
.Text=E.SlotNumber.Text G[1].SlotNumberDownShadow.Text=E.SlotNumber.Text G[1].
|
||||
SlotNumberUpShadow.Text=E.SlotNumber.Text local J=string.sub(F.Name,5)E.
|
||||
SlotNumber.Text=J E.SlotNumberDownShadow.Text=J E.SlotNumberUpShadow.Text=J E.
|
||||
Position=UDim2.new(E.Position.X.Scale,0,E.Position.Y.Scale,0)G[1].Position=UDim2
|
||||
.new(G[1].Position.X.Scale,0,G[1].Position.Y.Scale,0)G[1].Parent=E.Parent E.
|
||||
Parent=F end else local H=tonumber(E.SlotNumber.Text)if H==0 then H=10 end B[H]=
|
||||
'empty'local I=string.sub(F.Name,5)E.SlotNumber.Text=I E.SlotNumberDownShadow.
|
||||
Text=I E.SlotNumberUpShadow.Text=I local J=tonumber(E.SlotNumber.Text)if J==0
|
||||
then J=10 end B[J]=E E.Position=UDim2.new(E.Position.X.Scale,0,E.Position.Y.
|
||||
Scale,0)E.Parent=F end end function resolveDrag(E,F,G)local H,I=Vector2.new(F,G)
|
||||
,E.Parent local J=I.Parent:GetChildren()for K=1,#J do if J[K]:IsA'Frame'then if
|
||||
pointInRectangle(H,J[K].AbsolutePosition,J[K].AbsoluteSize)then swapGear(E,J[K])
|
||||
return true end end end if(F<I.AbsolutePosition.x or F>(I.AbsolutePosition.x+I.
|
||||
AbsoluteSize.x))or(G<I.AbsolutePosition.y or G>(I.AbsolutePosition.y+I.
|
||||
AbsoluteSize.y))then reorganizeLoadout(E,false)return false else if dragBeginPos
|
||||
then E.Position=dragBeginPos end return-1 end end function unequipAllItems(E)for
|
||||
F=1,#B do if B[F]=='empty'then break end if B[F].GearReference.Value and B[F].
|
||||
GearReference.Value~=E then if B[F].GearReference.Value:IsA'HopperBin'then B[F].
|
||||
GearReference.Value:Disable()elseif B[F].GearReference.Value:IsA'Tool'then B[F].
|
||||
GearReference.Value.Parent=game.Players.LocalPlayer.Backpack end B[F].Selected=
|
||||
false end end end function showToolTip(E,F)if E and E:FindFirstChild
|
||||
'ToolTipLabel'and E.ToolTipLabel:IsA'TextLabel'and not IsTouchDevice()then E.
|
||||
ToolTipLabel.Text=tostring(F)local G=E.ToolTipLabel.TextBounds.X+6 E.
|
||||
ToolTipLabel.Size=UDim2.new(0,G,0,20)E.ToolTipLabel.Position=UDim2.new(0.5,-G/2,
|
||||
0,-30)E.ToolTipLabel.Visible=true end end function hideToolTip(E,F)if E and E:
|
||||
FindFirstChild'ToolTipLabel'and E.ToolTipLabel:IsA'TextLabel'then E.ToolTipLabel
|
||||
.Visible=false end end local E=function(E,F,G,H)D()t=true if E:FindFirstChild
|
||||
'RobloxBuildTool'then t=false return end if not E:IsA'Tool'then if not E:IsA
|
||||
'HopperBin'then t=false return end end if not G then for I=1,#B do if B[I]~=
|
||||
'empty'and B[I].GearReference.Value==E then t=false return end end end local I=a
|
||||
.TempSlot:clone()I.Name=E.Name I.GearImage.Image=E.TextureId if I.GearImage.
|
||||
Image==''then I.GearText.Text=E.Name end I.GearReference.Value=E I.MouseEnter:
|
||||
connect(function()if I.GearReference and I.GearReference.Value['ToolTip']and I.
|
||||
GearReference.Value.ToolTip~=''then showToolTip(I,I.GearReference.Value.ToolTip)
|
||||
end end)I.MouseLeave:connect(function()if I.GearReference and I.GearReference.
|
||||
Value['ToolTip']and I.GearReference.Value.ToolTip~=''then hideToolTip(I,I.
|
||||
GearReference.Value.ToolTip)end end)I.RobloxLocked=true local J=-1 if not G then
|
||||
for K=1,#B do if B[K]=='empty'then J=K break end end else J=G end if J==-1 then
|
||||
t=false return end local K=J%10 local L=a:FindFirstChild('Slot'..tostring(K))I.
|
||||
Parent=L if H then local M,N=H.AbsolutePosition,I.AbsolutePosition local O=M-N I
|
||||
.Position=UDim2.new(I.Position.X.Scale,O.x,I.Position.Y.Scale,O.y)I.ZIndex=4 end
|
||||
if G then reorganizeLoadout(I,true,F,G)else reorganizeLoadout(I,true)end if I.
|
||||
Parent==nil then t=false return end if F then I.Selected=true unequipAllItems(E)
|
||||
delay(y+0.01,function()if I:FindFirstChild'GearReference'and((I.GearReference.
|
||||
Value:IsA'Tool'and I.GearReference.Value.Parent==i.Character)or(I.GearReference.
|
||||
Value:IsA'HopperBin'and I.GearReference.Value.Active==true))then enlargeButton(I
|
||||
)end end)end local M,N,O,P,Q,R,S=nil,nil N=I.MouseButton1Click:connect(function(
|
||||
)if characterInWorkspace()then if not I.Draggable then activateGear(I.SlotNumber
|
||||
.Text)end end end)P=I.MouseEnter:connect(function()if k.Visible then I.Draggable
|
||||
=true end end)S=I.DragBegin:connect(function(T)M=T I.ZIndex=7 local U=I:
|
||||
GetChildren()for V=1,#U do if U[V]:IsA'TextLabel'then if string.find(U[V].Name,
|
||||
'Shadow')then U[V].ZIndex=8 else U[V].ZIndex=9 end elseif U[V]:IsA'Frame'or U[V]
|
||||
:IsA'ImageLabel'then U[V].ZIndex=7 end end end)R=I.DragStopped:connect(function(
|
||||
T,U)if I.Selected then I.ZIndex=4 else I.ZIndex=3 end local V=I:GetChildren()for
|
||||
W=1,#V do if V[W]:IsA'TextLabel'then if string.find(V[W].Name,'Shadow')then V[W]
|
||||
.ZIndex=3 else V[W].ZIndex=4 end elseif V[W]:IsA'Frame'or V[W]:IsA'ImageLabel'
|
||||
then V[W].ZIndex=2 end end resolveDrag(I,T,U)end)Q=I.MouseLeave:connect(function
|
||||
()I.Draggable=false end)O=I.AncestryChanged:connect(function()if I.Parent and I.
|
||||
Parent.Parent==a then return end if N then N:disconnect()end if O then O:
|
||||
disconnect()end if P then P:disconnect()end if Q then Q:disconnect()end if R
|
||||
then R:disconnect()end if S then S:disconnect()end end)local T,U=nil,nil T=E.
|
||||
AncestryChanged:connect(function(V,W)if not checkToolAncestry(V,W)then if T then
|
||||
T:disconnect()end if U then U:disconnect()end removeFromInventory(E)elseif W==
|
||||
game.Players.LocalPlayer.Backpack then normalizeButton(I)end end)U=E.Changed:
|
||||
connect(function(V)if V=='Name'then if I and I.GearImage.Image==''then I.
|
||||
GearText.Text=E.Name end elseif V=='Active'then if E and E:IsA'HopperBin'then if
|
||||
not E.Active then I.Selected=false normalizeButton(I)end end elseif V==
|
||||
'TextureId'then I.GearImage.Image=E.TextureId end end)t=false Spawn(function()
|
||||
while backpackIsOpen()do wait(0.03)end for V=1,#B do if B[V]~='empty'then f.
|
||||
Position=UDim2.new(0.5,-60,1,-108)if c then f.Visible=true h.Visible=true end
|
||||
end end end)end function addToInventory(F)if not F:IsA'Tool'or not F:IsA
|
||||
'HopperBin'then return end local G=nil for H=1,#A do if A[H]and A[H]==F then
|
||||
return end if not A[H]then G=H end end if G then A[G]=F elseif#A<1 then A[1]=F
|
||||
else A[#A+1]=F end end function removeFromInventory(F)for G=1,#A do if A[G]==F
|
||||
then table.remove(A,G)A[G]=nil end end end local F,G=function()loadoutChildren=a
|
||||
:GetChildren()for F=1,#loadoutChildren do if loadoutChildren[F]:IsA'Frame'then
|
||||
loadoutChildren[F].BackgroundTransparency=0.5 local G=tonumber(string.sub(
|
||||
loadoutChildren[F].Name,5))if G==0 then G=10 end if d.AbsoluteSize.Y<=320 then
|
||||
loadoutChildren[F]:TweenPosition(UDim2.new(0,(G-1)*60,0,0),Enum.EasingDirection.
|
||||
Out,Enum.EasingStyle.Quad,0.25,true)else loadoutChildren[F]:TweenPosition(UDim2.
|
||||
new((G-1)/10,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end
|
||||
end end end,function()loadoutChildren=a:GetChildren()local F,G={},nil for H=1,#
|
||||
loadoutChildren do if loadoutChildren[H]:IsA'Frame'then if#loadoutChildren[H]:
|
||||
GetChildren()>0 then if loadoutChildren[H].Name=='Slot0'then G=loadoutChildren[H
|
||||
]else table.insert(F,loadoutChildren[H])end end loadoutChildren[H].
|
||||
BackgroundTransparency=1 end end if G then table.insert(F,G)end local H=(1-(#F*
|
||||
0.1))/2 for I=1,#F do if d.AbsoluteSize.Y<=320 then H=(0.5-(#F*0.333)/2)F[I]:
|
||||
TweenPosition(UDim2.new(H+(I-1)*0.33,0,0,0),Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quad,0.25,true)else F[I]:TweenPosition(UDim2.new(H+((I-1)*0.1),0,0,0
|
||||
),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end end function
|
||||
editLoadout()C=true if p then F()end end function readonlyLoadout()if not p then
|
||||
G()end end function setupBackpackListener()if s then s:disconnect()s=nil end s=i
|
||||
.Backpack.ChildAdded:connect(function(H)if not z then z=true if c then f.Visible
|
||||
=true h.Visible=true end end E(H)addToInventory(H)end)end function
|
||||
playerCharacterChildAdded(H)E(H,true)addToInventory(H)end function
|
||||
activateLoadout()a.Visible=true end function deactivateLoadout()a.Visible=false
|
||||
end function tabHandler(H)p=H if H then editLoadout()else readonlyLoadout()end
|
||||
end function coreGuiChanged(H,I)if H==Enum.CoreGuiType.Backpack or H==Enum.
|
||||
CoreGuiType.All then f.Visible=I h.Visible=I c=I if I then registerNumberKeys()
|
||||
else unregisterNumberKeys()end end if H==Enum.CoreGuiType.Health or H==Enum.
|
||||
CoreGuiType.All then setHealthBarVisible(game.Players.LocalPlayer.PlayerGui,I)
|
||||
end end registerNumberKeys()pcall(function()coreGuiChanged(Enum.CoreGuiType.
|
||||
Backpack,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))
|
||||
coreGuiChanged(Enum.CoreGuiType.Health,Game.StarterGui:GetCoreGuiEnabled(Enum.
|
||||
CoreGuiType.Health))Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
||||
end)wait()waitForChild(i,'Backpack')waitForProperty(i,'Character')delay(1,
|
||||
function()local H=i.Backpack:GetChildren()local I=math.min(10,#H)for J=1,I do if
|
||||
c then f.Visible=true h.Visible=true end E(H[J],false)end setupBackpackListener(
|
||||
)end)delay(2,function()if not C then if d.AbsoluteSize.Y<=320 then local H=a:
|
||||
GetChildren()for I=1,#H do local J=tonumber(string.sub(H[I].Name,5,string.len(H[
|
||||
I].Name)))if type(J)=='number'then H[I].Position=UDim2.new(0,(J-1)*60,0,0)end
|
||||
end end end wait(0.25)end)i.ChildAdded:connect(function(H)if H:IsA'PlayerGui'
|
||||
then moveHealthBar(H)end end)waitForProperty(i,'Character')for H,I in ipairs(i.
|
||||
Character:GetChildren())do playerCharacterChildAdded(I)end r=i.Character.
|
||||
ChildAdded:connect(function(J)playerCharacterChildAdded(J)end)waitForChild(i.
|
||||
Character,'Humanoid')humanoidDiedCon=i.Character.Humanoid.Died:connect(function(
|
||||
)if humanoidDiedCon then humanoidDiedCon:disconnect()humanoidDiedCon=nil end
|
||||
deactivateLoadout()if s then s:disconnect()s=nil end C=false end)i.
|
||||
CharacterRemoving:connect(function()for J=1,#B do if B[J]~='empty'then B[J].
|
||||
Parent=nil B[J]='empty'end end end)i.CharacterAdded:connect(function()
|
||||
waitForProperty(game.Players,'LocalPlayer')i=game.Players.LocalPlayer
|
||||
waitForChild(i,'Backpack')delay(1,function()local J=i.Backpack:GetChildren()
|
||||
local K=math.min(10,#J)for L=1,K do if c then f.Visible=true h.Visible=true end
|
||||
E(J[L],false)end setupBackpackListener()end)activateLoadout()if r then r:
|
||||
disconnect()r=nil end r=i.Character.ChildAdded:connect(function(J)E(J,true)end)
|
||||
waitForChild(i.Character,'Humanoid')if g.Visible then m:Fire()end
|
||||
humanoidDiedCon=i.Character.Humanoid.Died:connect(function()if c then f.Visible=
|
||||
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)
|
||||
if game.CoreGui.Version<3 then return end local a a=function(b,c)while not b:
|
||||
FindFirstChild(c)do b.ChildAdded:wait()end return b:FindFirstChild(c)end local b
|
||||
b=function(c,d)while not c[d]do c.Changed:wait()end end local c,d,e,f=script.
|
||||
Parent,'gear',true,game:GetService'CoreGui':FindFirstChild'RobloxGui'assert(f)
|
||||
local g=a(f,'ControlFrame')local h,i=a(g,'BackpackButton'),a(f,'Backpack')a(f,
|
||||
'CurrentLoadout')a(f.CurrentLoadout,'TempSlot')a(f.CurrentLoadout.TempSlot,
|
||||
'SlotNumber')a(c,'Background')local j,k=c.Background,nil k=function()local l=
|
||||
false pcall(function()l=Game:GetService'UserInputService'.TouchEnabled end)
|
||||
return l end local l l=function(m)a(m,'HealthGUI')a(m['HealthGUI'],'tray')local
|
||||
n=m['HealthGUI']['tray']n.Position=UDim2.new(0.5,-85,1,-26)end local m m=
|
||||
function(n,o)a(n,'HealthGUI')a(n['HealthGUI'],'tray')local p=n['HealthGUI'][
|
||||
'tray']p.Visible=o end a(game,'Players')b(game.Players,'LocalPlayer')local n=
|
||||
game.Players.LocalPlayer a(n,'PlayerGui')Spawn(function()return l(n.PlayerGui)
|
||||
end)while not(n.Character~=nil)do wait(0.03)end local o=a(n.Character,'Humanoid'
|
||||
)o.Died:connect(function()h.Visible=false end)a(game,'LocalBackpack')game.
|
||||
LocalBackpack:SetOldSchoolBackpack(false)a(c.Parent,'Backpack')local p=c.Parent.
|
||||
Backpack local q=a(p,'CoreScripts/BackpackScripts/BackpackManager')local r,s,t,u
|
||||
,v=a(q,'BackpackOpenEvent'),a(q,'BackpackCloseEvent'),a(q,'TabClickedEvent'),
|
||||
true,10 if f.AbsoluteSize.Y<=320 then v=4 end local w,x,y,z=nil,nil,false,1.18
|
||||
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,{},
|
||||
{}for H=1,v do G[H]='empty'end local H,I=false,nil I=function()if p then return
|
||||
p.Visible end return false end local J,K K=function(L,M,N)if M~=nil then M:
|
||||
disconnect()end if L==true and N then return J(N,false)end end local L L=
|
||||
function()for M=0,9 do game:GetService'GuiService':AddKey(tostring(M))end end
|
||||
local M M=function()return pcall(function()for N=0,9 do game:GetService
|
||||
'GuiService':RemoveKey(tostring(N))end end)end local N N=function()if game.
|
||||
Players['LocalPlayer']and game.Players.LocalPlayer['Character']and(game.Players.
|
||||
LocalPlayer.Character~=nil)and(game.Players.LocalPlayer.Character.Parent~=nil)
|
||||
then return true end return false end local O O=function(P)local Q for R=1,#G do
|
||||
if G[R]==P and(P.Parent~=nil)then Q=R break end end if Q then do local R=G[Q]if
|
||||
R.GearReference.Value then if R.GearReference.Value.Parent==game.Players.
|
||||
LocalPlayer.Character then R.GearReference.Value.Parent=game.Players.LocalPlayer
|
||||
.Backpack end if R.GearReference.Value:IsA'HopperBin'and R.GearReference.Value.
|
||||
Active then R.GearReference.Value:Disable()R.GearReference.Value.Active=false
|
||||
end end end G[Q]='empty'delay(0,function()return P:remove()end)return Spawn(
|
||||
function()while I()do wait(0.03)end a(n,'Backpack')local R=true for S=1,#G do if
|
||||
G[S]~='empty'then R=false end end if R then if#n.Backpack:GetChildren()<1 then h
|
||||
.Visible=false else h.Position=UDim2.new(0.5,-60,1,-44)end j.Visible=false end
|
||||
end)end end local P P=function(Q,R)local S if not R then for T=1,#G do if G[T]==
|
||||
'empty'then S=T break end end if S==1 and G[1]~='empty'then Q:remove()return end
|
||||
else S=R local T=1 for U=1,#G do if G[U]=='empty'then T=U break end end for U=T,
|
||||
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.
|
||||
Text=V G[U].SlotNumberDownShadow.Text=V G[U].SlotNumberUpShadow.Text=V end end
|
||||
end G[S]=Q if S~=v then if type(tostring(S))=='string'then local T=tostring(S)Q.
|
||||
SlotNumber.Text=T Q.SlotNumberDownShadow.Text=T Q.SlotNumberUpShadow.Text=T end
|
||||
else Q.SlotNumber.Text='0'Q.SlotNumberDownShadow.Text='0'Q.SlotNumberUpShadow.
|
||||
Text='0'end Q.Visible=true local T=Q.Kill.Changed:connect(function(T)return K(T,
|
||||
con,Q)end)end J=function(Q,R,S,T)if R then P(Q,T)else O(Q)end if Q~='empty'then
|
||||
Q.ZIndex=1 end end local Q Q=function(R,S)if R:FindFirstChild'RobloxBuildTool'
|
||||
then return end if R:IsA'Tool'or R:IsA'HopperBin'then for T=1,#G do if G[T]~=
|
||||
'empty'and G[T].GearReference.Value==R then if not(S~=nil)then G[T].Kill.Value=
|
||||
true return false elseif R.Parent==n.Character then G[T].Selected=true return
|
||||
true elseif R.Parent==n.Backpack then if R:IsA'Tool'or R:IsA'HopperBin'then G[T]
|
||||
.Selected=false end return true end G[T].Kill.Value=true return false end end
|
||||
end end local R R=function(S)local T=n.Character:GetChildren()for U=1,#T do if(T
|
||||
[U]:IsA'Tool'or T[U]:IsA'HopperBin')and T[U]~=S then if T[U]:IsA'Tool'then T[U].
|
||||
Parent=n.Backpack end if T[U]:IsA'HopperBin'then T[U]:Disable()end end end end
|
||||
local S S=function(T,U)if not T then return end if T.Size.Y.Scale<=1 then return
|
||||
end if T.Selected then return end if not T.Parent then return end local V=U if
|
||||
not(V~=nil)or type(V)~='number'then V=D/5 end if T:FindFirstChild'Highlight'then
|
||||
T.Highlight.Visible=false end if T:IsA'ImageButton'or T:IsA'TextButton'then T.
|
||||
ZIndex=1 local W,X=-(B.X.Scale-T.Size.X.Scale)/2,-(B.Y.Scale-T.Size.Y.Scale)/2
|
||||
return T:TweenSizeAndPosition(B,UDim2.new(T.Position.X.Scale+W,T.Position.X.
|
||||
Offset,T.Position.Y.Scale+X,T.Position.Y.Offset),Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quad,V,C)end end local T T=function(U)if U.Size.Y.Scale>1 then
|
||||
return end if not U.Parent then return end if not U.Selected then return end for
|
||||
V=1,#G do if G[V]=='empty'then break end if G[V]~=U then S(G[V])end end if not C
|
||||
then return end if U:FindFirstChild'Highlight'then U.Highlight.Visible=true end
|
||||
if U:IsA'ImageButton'or U:IsA'TextButton'then U.ZIndex=5 local V,W=-(A.X.Scale-U
|
||||
.Size.X.Scale)/2,-(A.Y.Scale-U.Size.Y.Scale)/2 return U:TweenSizeAndPosition(A,
|
||||
UDim2.new(U.Position.X.Scale+V,U.Position.X.Offset,U.Position.Y.Scale+W,U.
|
||||
Position.Y.Offset),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,D/5,C)end end
|
||||
local U U=function(V,W)if not W then return end W:ToggleSelect()if G[V]=='empty'
|
||||
then return end if not W.Active then G[V].Selected=false return S(G[V])else G[V]
|
||||
.Selected=true return T(G[V])end end local V V=function(W)if not G[W]then return
|
||||
end local X=G[W].GearReference.Value if not(X~=nil)then return end R(X)local Y=W
|
||||
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]
|
||||
)do local _=G[Z]_.Selected=false if _.GearReference and _.GearReference.Value
|
||||
and _.GearReference.Value:IsA'HopperBin'and _.GearReference.Value.Active then _.
|
||||
GearReference.Value:ToggleSelect()end end end end if X:IsA'HopperBin'then return
|
||||
U(W,X)else if X.Parent==n.Character then X.Parent=n.Backpack if G[W]~='empty'
|
||||
then G[W].Selected=false return S(G[W])end else X.Parent=n.Character G[W].
|
||||
Selected=true return T(G[W])end end end local W W=function(X)local Y if X=='0'
|
||||
then Y=10 else Y=tonumber(X)end if not(Y~=nil)then return end if G[Y]~='empty'
|
||||
then return V(Y)end end local X X=function()for Y=1,#G do if G[Y]=='empty'then
|
||||
break end if G[Y]~=button then S(G[Y],0.1)end end end local Y Y=function()while
|
||||
y do wait()end end local Z Z=function(_,aa,ab)if(_.x>aa.x and _.x<(aa.x+ab.x))or
|
||||
(_.y>aa.y and _.y<(aa.y+ab.y))then return true end return false end local aa aa=
|
||||
function(ab,_)local ac=_:GetChildren()if#ac==1 then if ac[1]:FindFirstChild
|
||||
'SlotNumber'then local ad,ae=tonumber(ac[1].SlotNumber.Text),tonumber(ab.
|
||||
SlotNumber.Text)if ad==0 then ad=10 end if ae==0 then ae=10 end G[ad]=ab G[ae]=
|
||||
ac[1]ac[1].SlotNumber.Text=ab.SlotNumber.Text ac[1].SlotNumberDownShadow.Text=ab
|
||||
.SlotNumber.Text ac[1].SlotNumberUpShadow.Text=ab.SlotNumber.Text local af=
|
||||
string.sub(_.Name,5)ab.SlotNumber.Text=af ab.SlotNumberDownShadow.Text=af ab.
|
||||
SlotNumberUpShadow.Text=af ab.Position=UDim2.new(ab.Position.X.Scale,0,ab.
|
||||
Position.Y.Scale,0)ac[1].Position=UDim2.new(ac[1].Position.X.Scale,0,ac[1].
|
||||
Position.Y.Scale,0)ac[1].Parent=ab.Parent ab.Parent=_ end else local ad=
|
||||
tonumber(ab.SlotNumber.Text)if ad==0 then ad=10 end G[ad]='empty'local ae=string
|
||||
.sub(_.Name,5)ab.SlotNumber.Text=ae ab.SlotNumberDownShadow.Text=ae ab.
|
||||
SlotNumberUpShadow.Text=ae local af=tonumber(ab.SlotNumber.Text)if af==0 then af
|
||||
=10 end G[af]=ab ab.Position=UDim2.new(ab.Position.X.Scale,0,ab.Position.Y.Scale
|
||||
,0)ab.Parent=_ end end local ab ab=function(ac,ad,ae)local af,_=Vector2.new(ad,
|
||||
ae),ac.Parent local ag=_.Parent:GetChildren()for ah=1,#ag do if ag[ah]:IsA
|
||||
'Frame'and Z(af,ag[ah].AbsolutePosition,ag[ah].AbsoluteSize)then aa(ac,ag[ah])
|
||||
return true end end if(ad<_.AbsolutePosition.x or ad>(_.AbsolutePosition.x+_.
|
||||
AbsoluteSize.x))or(ae<_.AbsolutePosition.y or ae>(_.AbsolutePosition.y+_.
|
||||
AbsoluteSize.y))then J(ac,false)return false else if dragBeginPos then ac.
|
||||
Position=dragBeginPos end return-1 end end local ac ac=function(ad)for ae=1,#G
|
||||
do if G[ae]=='empty'then break end do local af=G[ae]if af.GearReference.Value
|
||||
and af.GearReference.Value~=ad then if af.GearReference.Value:IsA'HopperBin'then
|
||||
af.GearReference.Value:Disable()elseif af.GearReference.Value:IsA'Tool'then af.
|
||||
GearReference.Value.Parent=game.Players.LocalPlayer.Backpack end af.Selected=
|
||||
false end end end end local ad ad=function(ae,af)if ae and ae:FindFirstChild
|
||||
'ToolTipLabel'and ae.ToolTipLabel:IsA'TextLabel'and not k()then ae.ToolTipLabel.
|
||||
Text=tostring(af)local ag=ae.ToolTipLabel.TextBounds.X+6 ae.ToolTipLabel.Size=
|
||||
UDim2.new(0,ag,0,20)ae.ToolTipLabel.Position=UDim2.new(0.5,-ag/2,0,-30)ae.
|
||||
ToolTipLabel.Visible=true end end local ae ae=function(af,ag)if af and af:
|
||||
FindFirstChild'ToolTipLabel'and af.ToolTipLabel:IsA'TextLabel'then af.
|
||||
ToolTipLabel.Visible=false end end local af af=function(ag)for ah=1,#F do if F[
|
||||
ah]==ag then table.remove(F,ah)F[ah]=nil end end end local ag ag=function(ah,_,
|
||||
ai,aj)Y()y=true if ah:FindFirstChild'RobloxBuildTool'then y=false return end if
|
||||
not ah:IsA'Tool'and not ah:IsA'HopperBin'then y=false return end if not ai then
|
||||
for ak=1,#G do if G[ak]~='empty'and G[ak].GearReference.Value==ah then y=false
|
||||
return end end end local ak=c.TempSlot:clone()ak.Name=ah.Name ak.GearImage.Image
|
||||
=ah.TextureId if ak.GearImage.Image==''then ak.GearText.Text=ah.Name end ak.
|
||||
GearReference.Value=ah ak.MouseEnter:connect(function()if ak.GearReference and
|
||||
ak.GearReference.Value['ToolTip']and ak.GearReference.Value.ToolTip~=''then
|
||||
return ad(ak,ak.GearReference.Value.ToolTip)end end)ak.MouseLeave:connect(
|
||||
function()if ak.GearReference and ak.GearReference.Value['ToolTip']and ak.
|
||||
GearReference.Value.ToolTip~=''then return ae(ak,ak.GearReference.Value.ToolTip)
|
||||
end end)ak.RobloxLocked=true local al=-1 if not ai then for am=1,#G do if G[am]
|
||||
=='empty'then al=am break end end else al=ai end if al==-1 then y=false return
|
||||
end local am=al%10 local an=c:FindFirstChild('Slot'..tostring(am))ak.Parent=an
|
||||
if aj then local ao,ap=aj.AbsolutePosition,ak.AbsolutePosition local aq=ao-ap ak
|
||||
.Position=UDim2.new(ak.Position.X.Scale,aq.x,ak.Position.Y.Scale,aq.y)ak.ZIndex=
|
||||
4 end J(ak,(function()if ai then return true,_,ai else return true end end)())if
|
||||
not(ak.Parent~=nil)then y=false return end if _ then ak.Selected=true ac(ah)
|
||||
delay(D+0.01,function()if ak:FindFirstChild'GearReference'and((ak.GearReference.
|
||||
Value:IsA'Tool'and ak.GearReference.Value.Parent==n.Character)or(ak.
|
||||
GearReference.Value:IsA'HopperBin'and ak.GearReference.Value.Active==true))then
|
||||
return T(ak)end end)end local ao,ap,aq,ar,as,at,au ap=ak.MouseButton1Click:
|
||||
connect(function()if N()then if not ak.Draggable then return W(ak.SlotNumber.
|
||||
Text)end end end)ar=ak.MouseEnter:connect(function()if p.Visible then ak.
|
||||
Draggable=true end end)au=ak.DragBegin:connect(function(av)ao=av ak.ZIndex=7
|
||||
local aw=ak:GetChildren()for ax=1,#aw do if aw[ax]:IsA'TextLabel'then if string.
|
||||
find(aw[ax].Name,'Shadow')then aw[ax].ZIndex=8 else aw[ax].ZIndex=9 end elseif
|
||||
aw[ax]:IsA'Frame'or aw[ax]:IsA'ImageLabel'then aw[ax].ZIndex=7 end end end)at=ak
|
||||
.DragStopped:connect(function(av,aw)if ak.Selected then ak.ZIndex=4 else ak.
|
||||
ZIndex=3 end local ax=ak:GetChildren()for ay=1,#ax do if ax[ay]:IsA'TextLabel'
|
||||
then if string.find(ax[ay].Name,'Shadow')then ax[ay].ZIndex=3 else ax[ay].ZIndex
|
||||
=4 end elseif ax[ay]:IsA'Frame'or ax[ay]:IsA'ImageLabel'then ax[ay].ZIndex=2 end
|
||||
end return ab(ak,av,aw)end)as=ak.MouseLeave:connect(function()ak.Draggable=false
|
||||
end)aq=ak.AncestryChanged:connect(function()if ak.Parent and ak.Parent.Parent==c
|
||||
then return end if ap~=nil then ap:disconnect()end if aq~=nil then aq:
|
||||
disconnect()end if ar~=nil then ar:disconnect()end if as~=nil then as:
|
||||
disconnect()end if at~=nil then at:disconnect()end if au~=nil then return au:
|
||||
disconnect()end return nil end)local av,aw av=ah.AncestryChanged:connect(
|
||||
function(ax,ay)if not Q(ax,ay)then if av~=nil then av:disconnect()end if aw~=nil
|
||||
then aw:disconnect()end return af(ah)elseif ay==game.Players.LocalPlayer.
|
||||
Backpack then return S(ak)end end)aw=ah.Changed:connect(function(ax)if ax==
|
||||
'Name'then if ak and ak.GearImage.Image==''then ak.GearText.Text=ah.Name end
|
||||
elseif ax=='Active'then if ah and ah:IsA'HopperBin'then if not ah.Active then ak
|
||||
.Selected=false return S(ak)end end elseif ax=='TextureId'then ak.GearImage.
|
||||
Image=ah.TextureId end end)y=false return Spawn(function()while I()do wait(0.03)
|
||||
end for ax=1,#G do if G[ax]~='empty'then h.Position=UDim2.new(0.5,-60,1,-108)if
|
||||
e then h.Visible=true j.Visible=true end end end end)end local ah ah=function(ai
|
||||
)if not ai:IsA'Tool'or not ai:IsA'HopperBin'then return end local aj for ak=1,#F
|
||||
do if F[ak]and F[ak]==ai then return end if not F[ak]then aj=ak end end if aj
|
||||
then F[aj]=ai elseif#F<1 then F[1]=ai else F[#F+1]=ai end end local ai ai=
|
||||
function()local aj=c:GetChildren()for ak=1,#aj do if aj[ak]:IsA'Frame'then aj[ak
|
||||
].BackgroundTransparency=0.5 local al=tonumber(string.sub(aj[ak].Name,5))if al==
|
||||
0 then al=10 end if f.AbsoluteSize.Y<=320 then aj[ak]:TweenPosition(UDim2.new(0,
|
||||
(al-1)*60,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)else aj[
|
||||
ak]:TweenPosition(UDim2.new((al-1)/10,0,0,0),Enum.EasingDirection.Out,Enum.
|
||||
EasingStyle.Quad,0.25,true)end end end end local aj aj=function()local ak,al,am=
|
||||
c:GetChildren(),{},nil for an=1,#ak do if ak[an]:IsA'Frame'then if#ak[an]:
|
||||
GetChildren()>0 then if ak[an].Name=='Slot0'then am=ak[an]else table.insert(al,
|
||||
ak[an])end end ak[an].BackgroundTransparency=1 end end if am then table.insert(
|
||||
al,am)end local an=(1-(#al*0.1))/2 for ao=1,#al do if f.AbsoluteSize.Y<=320 then
|
||||
an=0.5-(#al*0.333)/2 al[ao]:TweenPosition(UDim2.new(an+(ao-1)*0.33,0,0,0),Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)else al[ao]:TweenPosition(
|
||||
UDim2.new(an+((ao-1)*0.1),0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,
|
||||
0.25,true)end end end local ak ak=function()H=true if u then return ai()end end
|
||||
local al al=function()if not u then return aj()end end local am am=function()if
|
||||
x~=nil then x:disconnect()end x=nil x=n.Backpack.ChildAdded:connect(function(an)
|
||||
if not E then E=true if e then h.Visible=true j.Visible=true end end ag(an)
|
||||
return ah(an)end)end local an an=function(ao)ag(ao,true)return ah(ao)end local
|
||||
ao ao=function()c.Visible=true end local ap ap=function()c.Visible=false end
|
||||
local aq aq=function(ar)u=ar if ar then return ak()else return al()end end local
|
||||
ar ar=function(as,at)if as==Enum.CoreGuiType.Backpack or as==Enum.CoreGuiType.
|
||||
All then h.Visible=at j.Visible=at e=at if at then L()else M()end end if as==
|
||||
Enum.CoreGuiType.Health or as==Enum.CoreGuiType.All then return m(game.Players.
|
||||
LocalPlayer.PlayerGui,at)end end L()pcall(function()ar(Enum.CoreGuiType.Backpack
|
||||
,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))ar(Enum.
|
||||
CoreGuiType.Health,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health))
|
||||
return Game.StarterGui.CoreGuiChangedSignal:connect(ar)end)wait()a(n,'Backpack')
|
||||
b(n,'Character')delay(1,function()local as=n.Backpack:GetChildren()local at=math
|
||||
.min(10,#as)for au=1,at do if e then h.Visible=true j.Visible=true end ag(as[au]
|
||||
,false)end return am()end)delay(2,function()if not H then if f.AbsoluteSize.Y<=
|
||||
320 then local as=c:GetChildren()for at=1,#as do local au=tonumber(string.sub(as
|
||||
[at].Name,5,string.len(as[at].Name)))if type(au)=='number'then as[at].Position=
|
||||
UDim2.new(0,(au-1)*60,0,0)end end end end return wait(0.25)end)n.ChildAdded:
|
||||
connect(function(as)if as:IsA'PlayerGui'then return l(as)end end)b(n,'Character'
|
||||
)for as,at in ipairs(n.Character:GetChildren())do an(at)end w=n.Character.
|
||||
ChildAdded:connect(function(au)return an(au)end)a(n.Character,'Humanoid')local
|
||||
au=n.Character.Humanoid.Died:connect(function()do local au=humanoidDiedCon if au
|
||||
~=nil then au:disconnect()end end humanoidDiedCon=nil ap()if x~=nil then x:
|
||||
disconnect()end x=nil H=false end)n.CharacterRemoving:connect(function()for av=1
|
||||
,#G do if G[av]~='empty'then G[av].Parent=nil G[av]='empty'end end end)n.
|
||||
CharacterAdded:connect(function()b(game.Players,'LocalPlayer')n=game.Players.
|
||||
LocalPlayer a(n,'Backpack')delay(1,function()local av=n.Backpack:GetChildren()
|
||||
local aw=math.min(10,#av)for ax=1,aw do if e then h.Visible=true j.Visible=true
|
||||
end ag(av[ax],false)end return am()end)ao()if w~=nil then w:disconnect()end w=n.
|
||||
Character.ChildAdded:connect(function(av)return ag(av,true)end)a(n.Character,
|
||||
'Humanoid')if i.Visible then r:Fire()end au=n.Character.Humanoid.Died:connect(
|
||||
function()if e then h.Visible=false j.Visible=false end E=false ap()if au~=nil
|
||||
then au:disconnect()end au=nil if x~=nil then x:disconnect()end x=nil end)a(n,
|
||||
'PlayerGui')l(n.PlayerGui)return delay(2,function()if(not H)and(f.AbsoluteSize.Y
|
||||
<=320)then local av=c:GetChildren()for aw=1,#av do local ax=tonumber(string.sub(
|
||||
av[aw].Name,5,string.len(av[aw].Name)))if type(ax)=='number'then av[aw].Position
|
||||
=UDim2.new(0,(ax-1)*60,0,0)end end end return wait(0.25)end)end)a(p,'SwapSlot')p
|
||||
.SwapSlot.Changed:connect(function()if p.SwapSlot.Value then local av=p.SwapSlot
|
||||
local aw=av.Slot.Value if aw==0 then aw=10 end if G[aw]then J(G[aw],false)end if
|
||||
av.GearButton.Value then ag(av.GearButton.Value.GearReference.Value,false,aw)end
|
||||
p.SwapSlot.Value=false end end)game:GetService'GuiService'.KeyPressed:connect(
|
||||
function(av)if N()then return W(av)end end)r.Event:connect(ak)s.Event:connect(aj
|
||||
)return t.Event:connect(function(av)return aq(av==d)end)
|
||||
|
|
@ -1,163 +1,164 @@
|
|||
local a,b,c={},assert,{buffer={}}function c:New()local d={}setmetatable(d,self)
|
||||
self.__index=self d.buffer={}return d end function c:Append(d)self.buffer[#self.
|
||||
buffer+1]=d end function c:ToString()return table.concat(self.buffer)end local d
|
||||
={backslashes={['\b']='\\b',['\t']='\\t',['\n']='\\n',['\f']='\\f',['\r']='\\r',
|
||||
['"']='\\"',['\\']='\\\\',['/']='\\/'}}function d:New()local e={}e.writer=c:New(
|
||||
)setmetatable(e,self)self.__index=self return e end function d:Append(e)self.
|
||||
writer:Append(e)end function d:ToString()return self.writer:ToString()end
|
||||
function d:Write(e)local f=type(e)if f=='nil'then self:WriteNil()elseif f==
|
||||
'boolean'or f=='number'then self:WriteString(e)elseif f=='string'then self:
|
||||
ParseString(e)elseif f=='table'then self:WriteTable(e)elseif f=='function'then
|
||||
self:WriteFunction(e)elseif f=='thread'or f=='userdata'then self:WriteError(e)
|
||||
end end function d:WriteNil()self:Append'null'end function d:WriteString(e)self:
|
||||
Append(tostring(e))end function d:ParseString(e)self:Append'"'self:Append(string
|
||||
.gsub(e,'[%z%c\\"/]',function(f)local g=self.backslashes[f]if g then return g
|
||||
end return string.format('\\u%.4X',string.byte(f))end))self:Append'"'end
|
||||
function d:IsArray(e)local f,g=0,function(f)if type(f)=='number'and f>0 then if
|
||||
math.floor(f)==f then return true end end return false end for h,i in pairs(e)do
|
||||
if not g(h)then return false,'{','}'else f=math.max(f,h)end end return true,'[',
|
||||
']',f end function d:WriteTable(e)local f,g,h,i=self:IsArray(e)self:Append(g)if
|
||||
f then for j=1,i do self:Write(e[j])if j<i then self:Append','end end else local
|
||||
j=true for k,l in pairs(e)do if not j then self:Append','end j=false self:
|
||||
ParseString(k)self:Append':'self:Write(l)end end self:Append(h)end function d:
|
||||
WriteError(e)error(string.format('Encoding of %s unsupported',tostring(e)))end
|
||||
function d:WriteFunction(e)if e==Null then self:WriteNil()else self:WriteError(e
|
||||
)end end local e={s='',i=0}function e:New(f)local g={}setmetatable(g,self)self.
|
||||
__index=self g.s=f or g.s return g end function e:Peek()local f=self.i+1 if f<=#
|
||||
self.s then return string.sub(self.s,f,f)end return nil end function e:Next()
|
||||
self.i=self.i+1 if self.i<=#self.s then return string.sub(self.s,self.i,self.i)
|
||||
end return nil end function e:All()return self.s end local f={escapes={['t']=
|
||||
'\t',['n']='\n',['f']='\f',['r']='\r',['b']='\b'}}function f:New(g)local h={}h.
|
||||
reader=e:New(g)setmetatable(h,self)self.__index=self return h end function f:
|
||||
Read()self:SkipWhiteSpace()local g=self:Peek()if g==nil then error(string.
|
||||
format("Nil string: '%s'",self:All()))elseif g=='{'then return self:ReadObject()
|
||||
elseif g=='['then return self:ReadArray()elseif g=='"'then return self:
|
||||
ReadString()elseif string.find(g,'[%+%-%d]')then return self:ReadNumber()elseif
|
||||
g=='t'then return self:ReadTrue()elseif g=='f'then return self:ReadFalse()elseif
|
||||
g=='n'then return self:ReadNull()elseif g=='/'then self:ReadComment()return self
|
||||
:Read()else return nil end end function f:ReadTrue()self:TestReservedWord{'t',
|
||||
'r','u','e'}return true end function f:ReadFalse()self:TestReservedWord{'f','a',
|
||||
'l','s','e'}return false end function f:ReadNull()self:TestReservedWord{'n','u',
|
||||
'l','l'}return nil end function f:TestReservedWord(g)for h,i in ipairs(g)do if
|
||||
self:Next()~=i then error(string.format("Error reading '%s': %s",table.concat(g)
|
||||
,self:All()))end end end function f:ReadNumber()local g,h=self:Next(),self:Peek(
|
||||
)while h~=nil and string.find(h,'[%+%-%d%.eE]')do g=g..self:Next()h=self:Peek()
|
||||
end g=tonumber(g)if g==nil then error(string.format("Invalid number: '%s'",g))
|
||||
else return g end end function f:ReadString()local g=''b(self:Next()=='"')while
|
||||
self:Peek()~='"'do local h=self:Next()if h=='\\'then h=self:Next()if self.
|
||||
escapes[h]then h=self.escapes[h]end end g=g..h end b(self:Next()=='"')local h=
|
||||
function(h)return string.char(tonumber(h,16))end return string.gsub(g,
|
||||
'u%x%x(%x%x)',h)end function f:ReadComment()b(self:Next()=='/')local g=self:
|
||||
Next()if g=='/'then self:ReadSingleLineComment()elseif g=='*'then self:
|
||||
ReadBlockComment()else error(string.format('Invalid comment: %s',self:All()))end
|
||||
end function f:ReadBlockComment()local g=false while not g do local h=self:Next(
|
||||
)if h=='*'and self:Peek()=='/'then g=true end if not g and h=='/'and self:Peek()
|
||||
=='*'then error(string.format("Invalid comment: %s, '/*' illegal.",self:All()))
|
||||
end end self:Next()end function f:ReadSingleLineComment()local g=self:Next()
|
||||
while g~='\r'and g~='\n'do g=self:Next()end end function f:ReadArray()local g={}
|
||||
b(self:Next()=='[')local h=false if self:Peek()==']'then h=true end while not h
|
||||
do local i=self:Read()g[#g+1]=i self:SkipWhiteSpace()if self:Peek()==']'then h=
|
||||
true end if not h then local j=self:Next()if j~=','then error(string.format(
|
||||
"Invalid array: '%s' due to: '%s'",self:All(),j))end end end b(']'==self:Next())
|
||||
return g end function f:ReadObject()local g={}b(self:Next()=='{')local h=false
|
||||
if self:Peek()=='}'then h=true end while not h do local i=self:Read()if type(i)
|
||||
~='string'then error(string.format('Invalid non-string object key: %s',i))end
|
||||
self:SkipWhiteSpace()local j=self:Next()if j~=':'then error(string.format(
|
||||
"Invalid object: '%s' due to: '%s'",self:All(),j))end self:SkipWhiteSpace()local
|
||||
k=self:Read()g[i]=k self:SkipWhiteSpace()if self:Peek()=='}'then h=true end if
|
||||
not h then j=self:Next()if j~=','then error(string.format(
|
||||
"Invalid array: '%s' near: '%s'",self:All(),j))end end end b(self:Next()=='}')
|
||||
return g end function f:SkipWhiteSpace()local g=self:Peek()while g~=nil and
|
||||
string.find(g,'[%s/]')do if g=='/'then self:ReadComment()else self:Next()end g=
|
||||
self:Peek()end end function f:Peek()return self.reader:Peek()end function f:Next
|
||||
()return self.reader:Next()end function f:All()return self.reader:All()end
|
||||
function Encode(g)local h=d:New()h:Write(g)return h:ToString()end function
|
||||
Decode(g)local h=f:New(g)return h:Read()end function Null()return Null end a.
|
||||
DecodeJSON=function(g)pcall(function()warn
|
||||
[[RbxUtility.DecodeJSON is deprecated, please use Game:GetService('HttpService'):JSONDecode() instead.]]
|
||||
end)if type(g)=='string'then return Decode(g)end print
|
||||
local a,b={},nil b=function(c,d,e)if not(e~=nil)then e=d d=nil end local f=
|
||||
Instance.new(c)if d then f.Name=d end local g for h,i in pairs(e)do if type(h)==
|
||||
'string'then if h=='Parent'then g=i else f[h]=i end elseif type(h)=='number'and
|
||||
type(i)=='userdata'then i.Parent=f end end f.Parent=g return f end local c,d=
|
||||
assert,nil d=function()return d end local e={buffer={}}e.New=function(f)local g=
|
||||
setmetatable({},f)f.__index=f g.buffer={}return g end e.Append=function(f,g)do
|
||||
local h=f.buffer h[#h+1]=g end end e.ToString=function(f)return table.concat(f.
|
||||
buffer)end local f={backslashes={['\b']='\\b',['\t']='\\t',['\n']='\\n',['\f']=
|
||||
'\\f',['\r']='\\r',['"']='\\"',['\\']='\\\\',['/']='\\/'}}f.New=function(g)local
|
||||
h=setmetatable({},g)h.writer=e:New()g.__index=g return h end f.Append=function(g
|
||||
,h)return g.writer:Append(h)end f.ToString=function(g)return g.writer:ToString()
|
||||
end f.Write=function(g,h)local i=type(h)if'nil'==i then return g:WriteNil()
|
||||
elseif'boolean'==i or'number'==i then return g:WriteString(h)elseif'string'==i
|
||||
then return g:ParseString(h)elseif'table'==i then return g:WriteTable(h)elseif
|
||||
'function'==i then return g:WriteFunction(h)elseif'thread'==i or'userdata'==i
|
||||
then return g:WriteError(h)end end f.WriteNil=function(g)return g:Append'null'
|
||||
end f.WriteString=function(g,h)return g:Append(tostring(h))end f.ParseString=
|
||||
function(g,h)g:Append'"'g:Append(string.gsub(h,'[%z%c\\"/]',function(i)local j=g
|
||||
.backslashes[i]if j then return j end return string.format('\\u%.4X',string.
|
||||
byte(i))end))return g:Append'"'end f.IsArray=function(g,h)local i,j=0,nil j=
|
||||
function(k)if type(k)=='number'and k>0 and math.floor(k)==k then return true end
|
||||
return false end for k,l in pairs(h)do if not j(k)then return false,'{','}'else
|
||||
i=math.max(i,k)end end return true,'[',']',i end f.WriteTable=function(g,h)local
|
||||
i,j,k,l=g:IsArray(h)g:Append(j)if i then for m=1,l do g:Write(h[m])if m<l then g
|
||||
:Append','end end else local m=true for n,o in pairs(h)do if not m then g:Append
|
||||
','end m=false g:ParseString(n)g:Append':'g:Write(o)end end return g:Append(k)
|
||||
end f.WriteError=function(g,h)return error(string.format(
|
||||
'Encoding of %s unsupported',tostring(h)))end f.WriteFunction=function(g,h)if h
|
||||
==d then return g:WriteNil()else return g:WriteError(h)end end local g={s='',i=0
|
||||
}g.New=function(h,i)local j=setmetatable({},h)h.__index=h j.s=i or j.s return j
|
||||
end g.Peek=function(h)local i=h.i+1 if i<=#h.s then return string.sub(h.s,i,i)
|
||||
end return nil end g.Next=function(h)h.i=h.i+1 if h.i<=#h.s then return string.
|
||||
sub(h.s,h.i,h.i)end return nil end g.All=function(h)return h.s end local h={
|
||||
escapes={['t']='\t',['n']='\n',['f']='\f',['r']='\r',['b']='\b'}}h.New=function(
|
||||
i,j)local k=setmetatable({},i)k.reader=g:New(j)i.__index=i return k end h.Read=
|
||||
function(i)i:SkipWhiteSpace()local j=i:Peek()if not(j~=nil)then return error(
|
||||
string.format("Nil string: '%s'",i:All()))elseif j=='{'then return i:ReadObject(
|
||||
)elseif j=='['then return i:ReadArray()elseif j=='"'then return i:ReadString()
|
||||
elseif string.find(j,'[%+%-%d]')then return i:ReadNumber()elseif j=='t'then
|
||||
return i:ReadTrue()elseif j=='f'then return i:ReadFalse()elseif j=='n'then
|
||||
return i:ReadNull()elseif j=='/'then i:ReadComment()return i:Read()else return
|
||||
nil end end h.ReadTrue=function(i)i:TestReservedWord{'t','r','u','e'}return true
|
||||
end h.ReadFalse=function(i)i:TestReservedWord{'f','a','l','s','e'}return false
|
||||
end h.ReadNull=function(i)i:TestReservedWord{'n','u','l','l'}return nil end h.
|
||||
TestReservedWord=function(i,j)for k,l in ipairs(j)do if i:Next()~=l then error(
|
||||
string.format("Error reading '%s': %s",table.concat(j),i:All()))end end end h.
|
||||
ReadNumber=function(i)local j,k=i:Next(),i:Peek()while(k~=nil)and string.find(k,
|
||||
'[%+%-%d%.eE]')do j=j..i:Next()k=i:Peek()end j=tonumber(j)if not(j~=nil)then
|
||||
return error(string.format("Invalid number: '%s'",j))else return j end end h.
|
||||
ReadString=function(i)local j=''c(i:Next()=='"')while i:Peek()~='"'do local k=i:
|
||||
Next()if k=='\\'then k=i:Next()if i.escapes[k]then k=i.escapes[k]end end j=j..k
|
||||
end c(i:Next()=='"')local k k=function(l)return string.char(tonumber(l,16))end
|
||||
return string.gsub(j,'u%x%x(%x%x)',k)end h.ReadComment=function(i)c(i:Next()==
|
||||
'/')local j=i:Next()if j=='/'then return i:ReadSingleLineComment()elseif j=='*'
|
||||
then return i:ReadBlockComment()else return error(string.format(
|
||||
'Invalid comment: %s',i:All()))end end h.ReadBlockComment=function(i)local j=
|
||||
false while not j do local k=i:Next()if k=='*'and i:Peek()=='/'then j=true end
|
||||
if not j and k=='/'and i:Peek()=='*'then error(string.format(
|
||||
"Invalid comment: %s, '/*' illegal.",i:All()))end end return i:Next()end h.
|
||||
ReadSingleLineComment=function(i)local j=i:Next()while j~='\r'and j~='\n'do j=i:
|
||||
Next()end end h.ReadArray=function(i)local j={}c(i:Next()=='[')local k=false if
|
||||
i:Peek()==']'then k=true end while not k do local l=i:Read()j[#j+1]=l i:
|
||||
SkipWhiteSpace()if i:Peek()==']'then k=true end if not k then local m=i:Next()if
|
||||
m~=','then error(string.format("Invalid array: '%s' due to: '%s'",i:All(),m))end
|
||||
end end c(']'==i:Next())return j end h.ReadObject=function(i)local j={}c(i:Next(
|
||||
)=='{')local k=false if i:Peek()=='}'then k=true end while not k do local l=i:
|
||||
Read()if type(l)~='string'then error(string.format(
|
||||
'Invalid non-string object key: %s',l))end i:SkipWhiteSpace()local m=i:Next()if
|
||||
m~=':'then error(string.format("Invalid object: '%s' due to: '%s'",i:All(),m))
|
||||
end i:SkipWhiteSpace()local n=i:Read()j[l]=n i:SkipWhiteSpace()if i:Peek()=='}'
|
||||
then k=true end if not k then m=i:Next()if m~=','then error(string.format(
|
||||
"Invalid array: '%s' near: '%s'",i:All(),m))end end end c(i:Next()=='}')return j
|
||||
end h.SkipWhiteSpace=function(i)local j=i:Peek()while(j~=nil)and string.find(j,
|
||||
'[%s/]')do if j=='/'then i:ReadComment()else i:Next()end j=i:Peek()end end h.
|
||||
Peek=function(i)return i.reader:Peek()end h.Next=function(i)return i.reader:
|
||||
Next()end h.All=function(i)return i.reader:All()end local i i=function(j)local k
|
||||
=f:New()k:Write(j)k:ToString()return k end local j j=function(k)local l=h:New(k)
|
||||
l:Read()return l end a.DecodeJSON=function(k)pcall(function()return warn
|
||||
[[RbxUtility.DecodeJSON is deprecated, please use Game:GetService("HttpService"):JSONDecode() instead.]]
|
||||
end)if type(k)=='string'then return j(k)end print
|
||||
'RbxUtil.DecodeJSON expects string argument!'return nil end a.EncodeJSON=
|
||||
function(g)pcall(function()warn
|
||||
[[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
|
||||
'Terrain':AutoWedgeCell(g,h,i)end a.SelectTerrainRegion=function(g,h,i,j)local k
|
||||
=game.Workspace:FindFirstChild'Terrain'if not k then return end b(g)b(h)if not
|
||||
type(g)=='Region3'then error(
|
||||
[[regionToSelect (first arg), should be of type Region3, but is type]],type(g))
|
||||
end if not type(h)=='BrickColor'then error(
|
||||
[[color (second arg), should be of type BrickColor, but is type]],type(h))end
|
||||
local l,m,n,o,p=k.GetCell,k.WorldToCellPreferSolid,k.CellCenterToWorld,Enum.
|
||||
CellMaterial.Empty,Instance.new'Model'p.Name='SelectionContainer'p.Archivable=
|
||||
false if j then p.Parent=j else p.Parent=game.Workspace end local q,r,s,t,u,v,w=
|
||||
nil,nil,0,nil,{},{},Instance.new'Part'w.Name='SelectionPart'w.Transparency=1 w.
|
||||
Anchored=true w.Locked=true w.CanCollide=false w.Size=Vector3.new(4.2,4.2,4.2)
|
||||
local x=Instance.new'SelectionBox'function createAdornment(y)local z,A=nil,nil
|
||||
if#v>0 then z=v[1]['part']A=v[1]['box']table.remove(v,1)A.Visible=true else z=w:
|
||||
Clone()z.Archivable=false A=x:Clone()A.Archivable=false A.Adornee=z A.Parent=p A
|
||||
.Adornee=z A.Parent=p end if y then A.Color=y end return z,A end function
|
||||
cleanUpAdornments()for y,z in pairs(u)do if z.KeepAlive~=r then z.SelectionBox.
|
||||
Visible=false table.insert(v,{part=z.SelectionPart,box=z.SelectionBox})u[y]=nil
|
||||
end end end function incrementAliveCounter()s=s+1 if s>1000000 then s=0 end
|
||||
return s end function adornFullCellsInRegion(y,z)local A,B=y.CFrame.p-(y.Size/2)
|
||||
+Vector3.new(2,2,2),y.CFrame.p+(y.Size/2)-Vector3.new(2,2,2)local C,D=m(k,A),m(k
|
||||
,B)r=incrementAliveCounter()for E=C.y,D.y do for F=C.z,D.z do for G=C.x,D.x do
|
||||
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),
|
||||
false for L,M in pairs(u)do if L==J then M.KeepAlive=r if z then M.SelectionBox.
|
||||
Color=z end K=true break end end if not K then local N,O=createAdornment(z)N.
|
||||
Size=Vector3.new(4,4,4)N.CFrame=CFrame.new(I)local P={SelectionPart=N,
|
||||
SelectionBox=O,KeepAlive=r}u[J]=P end end end end end cleanUpAdornments()end t=g
|
||||
if i then local y,z=createAdornment(h)y.Size=g.Size y.CFrame=g.CFrame u.
|
||||
SelectionPart=y u.SelectionBox=z q=function(A,B)if A and A~=t then t=A y.Size=A.
|
||||
Size y.CFrame=A.CFrame end if B then z.Color=B end end else
|
||||
adornFullCellsInRegion(g,h)q=function(y,z)if y and y~=t then t=y
|
||||
adornFullCellsInRegion(y,z)end end end local y=function()q=nil if p then p:
|
||||
Destroy()end u=nil end return q,y end function a.CreateSignal()local g,h,i={},
|
||||
Instance.new'BindableEvent',{}function g:connect(j)if self~=g then error(
|
||||
'connect must be called with `:`, not `.`',2)end if type(j)~='function'then
|
||||
error('Argument #1 of connect must be a function, got a '..type(j),2)end local k
|
||||
=h.Event:connect(j)i[k]=true local l={}function l:disconnect()k:disconnect()i[k]
|
||||
=nil end l.Disconnect=l.disconnect return l end function g:disconnect()if self~=
|
||||
g then error('disconnect must be called with `:`, not `.`',2)end for j,k in
|
||||
pairs(i)do j:disconnect()i[j]=nil end end function g:wait()if self~=g then
|
||||
error('wait must be called with `:`, not `.`',2)end return h.Event:wait()end
|
||||
function g:fire(...)if self~=g then error(
|
||||
'fire must be called with `:`, not `.`',2)end h:Fire(...)end g.Connect=g.connect
|
||||
g.Disconnect=g.disconnect g.Wait=g.wait g.Fire=g.fire return g end
|
||||
local function Create_PrivImpl(g)if type(g)~='string'then error(
|
||||
'Argument of Create must be a string',2)end return function(h)h=h or{}local i,j,
|
||||
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)~=
|
||||
function(k)pcall(function()return warn
|
||||
[[RbxUtility.EncodeJSON is deprecated, please use Game:GetService("HttpService"):JSONEncode() instead.]]
|
||||
end)return i(k)end a.MakeWedge=function(k,l,m,n)return game:GetService'Terrain':
|
||||
AutoWedgeCell(k,l,m)end a.SelectTerrainRegion=function(k,l,m,n)local o=game.
|
||||
Workspace:FindFirstChild'Terrain'if not o then return end c(k)c(l)if not type(k)
|
||||
=='Region3'then error(
|
||||
[[regionToSelect (first arg), should be of type Region3, but is type]],type(k))
|
||||
end if not type(l)=='BrickColor'then error(
|
||||
[[color (second arg), should be of type BrickColor, but is type]],type(l))end
|
||||
local p,q,r,s,t,u,v,w,x,y,z,A,B,C=o.GetCell,o.WorldToCellPreferSolid,o.
|
||||
CellCenterToWorld,Enum.CellMaterial.Empty,b('Model','SelectionContainer',{
|
||||
Archivable=false,Parent=(function()if n then return n else return game.Workspace
|
||||
end end)()}),nil,nil,0,nil,{},{},b('Part','SelectionPart',{Transparency=1,
|
||||
Anchored=true,Locked=true,CanCollide=false,Size=Vector3.new(4.2,4.2,4.2)}),
|
||||
Instance.new'SelectionBox',nil C=function(D)local E,F if#z>0 then E=z[1]['part']
|
||||
F=z[1]['box']table.remove(z,1)F.Visible=true else E=A:Clone()E.Archivable=false
|
||||
F=B:Clone()F.Archivable=false F.Adornee=E F.Parent=t F.Adornee=E F.Parent=t end
|
||||
if D then F.Color=D end return E,F end local D D=function()for E,F in pairs(y)do
|
||||
if F.KeepAlive~=v then F.SelectionBox.Visible=false table.insert(z,{part=F.
|
||||
SelectionPart,box=F.SelectionBox})y[E]=nil end end end local E E=function()w=w+1
|
||||
if w>1000000 then w=0 end return w end local F F=function(G,H)local I,J=G.CFrame
|
||||
.p-G.Size/2+Vector3.new(2,2,2),G.CFrame.p+G.Size/2-Vector3.new(2,2,2)local K,L=
|
||||
q(o,I),q(o,J)v=E()for M=K.y,L.y do for N=K.z,L.z do for O=K.x,L.x do local P=p(o
|
||||
,O,M,N)if P~=s then local Q,R,S=r(o,O,M,N),Vector3int16.new(O,M,N),false for T,U
|
||||
in pairs(y)do if T==R then U.KeepAlive=v if H then U.SelectionBox.Color=H end S=
|
||||
true break end end if not S then local V,W V,W=C(H)V.Size=Vector3.new(4,4,4)V.
|
||||
CFrame=CFrame.new(Q)local X={SelectionPart=V,SelectionBox=W,KeepAlive=v}y[R]=X
|
||||
end end end end end return D()end x=k if m then local G,H G,H=C(l)G.Size=k.Size
|
||||
G.CFrame=k.CFrame y.SelectionPart=G y.SelectionBox=H u=function(I,J)if I and I~=
|
||||
x then x=I G.Size=I.Size G.CFrame=I.CFrame end if J then H.Color=J end end else
|
||||
F(k,l)u=function(G,H)if G and G~=x then x=G return F(G,H)end end end local G G=
|
||||
function()u=nil if t~=nil then t:Destroy()end y=nil end return u,G end a.
|
||||
CreateSignal=function()local k,l,m={},Instance.new'BindableEvent',{}k.connect=
|
||||
function(n,o)if n~=k then error('connect must be called with `:`, not `.`',2)end
|
||||
if type(o)~='function'then error(
|
||||
'Argument #1 of connect must be a function, got a '..tostring(type(o)),2)end
|
||||
local p=l.Event:connect(o)m[p]=true local q={}q.disconnect=function(r)p:
|
||||
disconnect()m[p]=nil end q.Disconnect=q.disconnect return q end k.disconnect=
|
||||
function(n)if n~=k then error('disconnect must be called with `:`, not `.`',2)
|
||||
end for o,p in pairs(m)do o:disconnect()m[o]=nil end end k.wait=function(n)if n
|
||||
~=k then error('wait must be called with `:`, not `.`',2)end return l.Event:
|
||||
wait()end k.fire=function(n,...)if n~=k then error(
|
||||
'fire must be called with `:`, not `.`',2)end return l:Fire(...)end k.Connect=k.
|
||||
connect k.Disconnect=k.disconnect k.Wait=k.wait k.Fire=k.fire return k end local
|
||||
k k=function(l)if type(l)~='string'then error(
|
||||
'Argument of Create must be a string',2)end return function(m)m=m or{}local n,o,
|
||||
p=Instance.new(l),nil,nil for q,r in pairs(m)do if type(q)=='string'then if q==
|
||||
'Parent'then o=r else n[q]=r end elseif type(q)=='number'then if type(r)~=
|
||||
'userdata'then error(
|
||||
[[Bad entry in Create body: Numeric keys must be paired with children, got a: ]]
|
||||
..type(m),2)end m.Parent=i elseif type(l)=='table'and l.__eventname then if
|
||||
type(m)~='function'then error("Bad entry in Create body: Key `[Create.E'"..l.
|
||||
__eventname.."']` must have a function value, got: "..tostring(m),2)end i[l.
|
||||
__eventname]:connect(m)elseif l==a.Create then if type(m)~='function'then error(
|
||||
..tostring(type(r)),2)end r.Parent=n elseif type(q)=='table'and q.__eventname
|
||||
then if type(r)~='function'then error(
|
||||
"Bad entry in Create body: Key `[Create.E'"..tostring(q.__eventname)..
|
||||
"']` must have a function value, got: "..tostring(r),2)end n[q.__eventname]:
|
||||
connect(r)elseif q==a.Create then if type(r)~='function'then error(
|
||||
[[Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: ]]
|
||||
..tostring(m),2)elseif k then error(
|
||||
[[Bad entry in Create body: Only one constructor function is allowed]],2)end k=m
|
||||
else error('Bad entry ('..tostring(l)..' => '..tostring(m)..') 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=
|
||||
setmetatable({},{__call=function(g,...)return Create_PrivImpl(...)end})a.Create.
|
||||
E=function(g)return{__eventname=g}end a.Help=function(g)if g=='DecodeJSON'or g==
|
||||
a.DecodeJSON then return
|
||||
..tostring(r),2)elseif p then error(
|
||||
[[Bad entry in Create body: Only one constructor function is allowed]],2)end p=r
|
||||
else error('Bad entry ('..tostring(q)..' => '..tostring(r)..') in Create body',2
|
||||
)end end if p~=nil then p(n)end if o then n.Parent=o end return n end end a.
|
||||
Create=setmetatable({},{['__call']=function(l,...)return k(...)end})a.Create.E=
|
||||
function(l)return{__eventname=l}end a.Help=function(l)if'DecodeJSON'==l or a.
|
||||
DecodeJSON==l then return
|
||||
[[Function DecodeJSON. Arguments: (string). Side effect: returns a table with all parsed JSON values]]
|
||||
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]]
|
||||
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 ]]
|
||||
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]]
|
||||
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').]]
|
||||
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|.]]
|
||||
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.]]
|
||||
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.]]
|
||||
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.]]
|
||||
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.]]
|
||||
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+
|
||||
1 b=game:GetService'ScriptContext'wait(0.2)end if b then b:RegisterLibrary(
|
||||
local a,b,c=3569749,game:GetService'ScriptContext',0 while not(b or c>2)do c=c+1
|
||||
b=game:GetService'ScriptContext'wait(0.2)end if b then b:RegisterLibrary(
|
||||
'Libraries/RbxGui','45284430')b:RegisterLibrary('Libraries/RbxGear','45374389')
|
||||
if game.PlaceId==a then b:RegisterLibrary('Libraries/RbxStatus','52177566')end b
|
||||
:RegisterLibrary('Libraries/RbxUtility','60595411')b:RegisterLibrary(
|
||||
'Libraries/RbxStamper','73157242')b:LibraryRegistrationComplete()else print
|
||||
'failed to find script context, libraries did not load'end
|
||||
'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.
|
||||
CurrentCamera local e,f,g,h=Vector3.new(d.CoordinateFrame.p.X,d.CoordinateFrame.
|
||||
p.Y,d.CoordinateFrame.p.Z),Vector3.new(b.X,b.Y,b.Z),Vector3.new(0,1,0),Vector3.
|
||||
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
|
||||
<=1 then local l=((f-e)*k)+e j=game.Workspace.Terrain:WorldToCell(l)c=true end
|
||||
end return j,c end function GetTerrainForMouse(b)local c,d=game.Workspace.
|
||||
Terrain:WorldToCellPreferSolid(Vector3.new(b.hit.x,b.hit.y,b.hit.z)),nil if 0==
|
||||
game.Workspace.Terrain:GetCell(c.X,c.Y,c.Z).Value then c=nil d,hit=
|
||||
PlaneIntersection(Vector3.new(b.hit.x,b.hit.y,b.hit.z))if hit then c=d end end
|
||||
return c end local b=Vector3.new(0.3,0.3,0.3)local function
|
||||
rotatePartAndChildren(c,d,e)if c:IsA'BasePart'then c.CFrame=(d*(c.CFrame-e))+e
|
||||
end local f=c:GetChildren()for g=1,#f do rotatePartAndChildren(f[g],d,e)end end
|
||||
local function modelRotate(c,d)local e,f=CFrame.Angles(0,d,0),c:GetModelCFrame()
|
||||
.p rotatePartAndChildren(c,e,f)end local function collectParts(c,d,e,f)if c:IsA
|
||||
'BasePart'then d[#d+1]=c elseif c:IsA'Script'then e[#e+1]=c elseif c:IsA'Decal'
|
||||
then f[#f+1]=c end for g,h in pairs(c:GetChildren())do collectParts(h,d,e,f)end
|
||||
end local function clusterPartsInRegion(c,d)local e=game.Workspace:
|
||||
FindFirstChild'Terrain'local f,g=e:WorldToCell(c),e:WorldToCell(d)local h,i,j,k,
|
||||
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
|
||||
end if i<e.MaxExtents.Min.Y then i=e.MaxExtents.Min.Y end if j<e.MaxExtents.Min.
|
||||
Z then j=e.MaxExtents.Min.Z end if k>e.MaxExtents.Max.X then k=e.MaxExtents.Max.
|
||||
X end if l>e.MaxExtents.Max.Y then l=e.MaxExtents.Max.Y end if m>e.MaxExtents.
|
||||
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:
|
||||
GetCell(n,o,p).Value>0 then return true end end end end return false end
|
||||
local function findSeatsInModel(c,d)if not c then return end if c.className==
|
||||
'Seat'or c.className=='VehicleSeat'then table.insert(d,c)end local e=c:
|
||||
GetChildren()for f=1,#e do findSeatsInModel(e[f],d)end end local function
|
||||
setSeatEnabledStatus(c,d)local e={}findSeatsInModel(c,e)if d then for f=1,#e do
|
||||
local g=e[f]:FindFirstChild'SeatWeld'while g do g:Remove()g=e[f]:FindFirstChild
|
||||
'SeatWeld'end end else for f=1,#e do local g=Instance.new'Weld'g.Name='SeatWeld'
|
||||
g.Parent=e[f]end end end local function autoAlignToFace(c)local d=c:
|
||||
FindFirstChild'AutoAlignToFace'if d then return d.Value else return false end
|
||||
end local function getClosestAlignedWorldDirection(c)local d,e,f=Vector3.new(1,0
|
||||
,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
|
||||
*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.
|
||||
abs(g)>math.abs(i)then if g>0 then return 0 else return 3 end elseif math.abs(h)
|
||||
>math.abs(g)and math.abs(h)>math.abs(i)then if h>0 then return 1 else return 4
|
||||
end else if i>0 then return 2 else return 5 end end end local function
|
||||
positionPartsAtCFrame3(c,d)local e=nil if not d then return d end if d and(d:IsA
|
||||
'Model'or d:IsA'Tool')then e=d:GetModelCFrame()d:TranslateBy(c.p-e.p)else d.
|
||||
CFrame=c end return d end local function calcRayHitTime(c,d,e)if math.abs(d)<
|
||||
0.01 then return 0 end return(e-c)/d end local function modelTargetSurface(c,d,e
|
||||
)if not c then return 0 end local f,g=nil,nil if c:IsA'Model'then f=c:
|
||||
GetModelCFrame()g=c:GetModelSize()else f=c.CFrame g=c.Size end local h,i=f:
|
||||
pointToObjectSpace(d),f:pointToObjectSpace(e)local j,k,l,m=i-h,1,1,1 if j.X>0
|
||||
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=
|
||||
calcRayHitTime(h.X,j.X,g.X/2*k),calcRayHitTime(h.Y,j.Y,g.Y/2*l),calcRayHitTime(h
|
||||
.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
|
||||
q=2*l else q=3*m end end return q end local function getBoundingBox2(c)local d,e
|
||||
=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,-math.huge,-
|
||||
math.huge)if c:IsA'Terrain'then d=Vector3.new(-2,-2,-2)e=Vector3.new(2,2,2)
|
||||
elseif c:IsA'BasePart'then d=-0.5*c.Size e=-d else e=c:GetModelSize()*0.5 d=-e
|
||||
end local f=c:FindFirstChild'Justification'if f~=nil then local g,h,i=f.Value,
|
||||
Vector3.new(2,2,2),e-d-Vector3.new(0.01,0.01,0.01)local j=Vector3.new(4*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+
|
||||
0.5*k*(h-g)end return d,e end local function getBoundingBoxInWorldCoordinates(c)
|
||||
local d,e=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,-
|
||||
math.huge,-math.huge)if c:IsA'BasePart'and not c:IsA'Terrain'then local f,g=c.
|
||||
CFrame:pointToWorldSpace(-0.5*c.Size),c.CFrame:pointToWorldSpace(0.5*c.Size)d=
|
||||
Vector3.new(math.min(f.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.max(f.Y,g.Y),math.max(f.Z,g.Z))elseif not c:IsA'Terrain'
|
||||
then local f,g=c:GetModelCFrame():pointToWorldSpace(-0.5*c:GetModelSize()),c:
|
||||
GetModelCFrame():pointToWorldSpace(0.5*c:GetModelSize())d=Vector3.new(math.min(f
|
||||
.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
|
||||
.max(f.Y,g.Y),math.max(f.Z,g.Z))end return d,e end local function
|
||||
getTargetPartBoundingBox(c)if c.Parent:FindFirstChild'RobloxModel'~=nil then
|
||||
return getBoundingBox2(c.Parent)else return getBoundingBox2(c)end end
|
||||
local function getMouseTargetCFrame(c)if c.Parent:FindFirstChild'RobloxModel'~=
|
||||
nil then if c.Parent:IsA'Tool'then return c.Parent.Handle.CFrame else return c.
|
||||
Parent:GetModelCFrame()end else return c.CFrame end end local function isBlocker
|
||||
(c)if not c then return false end if not c.Parent then return false end if c:
|
||||
FindFirstChild'Humanoid'then return false end if c:FindFirstChild'RobloxStamper'
|
||||
or c:FindFirstChild'RobloxModel'then return true end if c:IsA'Part'and not c.
|
||||
CanCollide then return false end if c==game.Lighting then return false end
|
||||
return isBlocker(c.Parent)end local function spaceAboveCharacter(c,d,e)local f=
|
||||
game.Workspace:FindPartsInRegion3(Region3.new(Vector3.new(c.Position.X,d,c.
|
||||
Position.Z)-Vector3.new(0.75,2.75,0.75),Vector3.new(c.Position.X,d,c.Position.Z)
|
||||
+Vector3.new(0.75,1.75,0.75)),c.Parent,100)for g=1,#f do if f[g].CanCollide and
|
||||
not f[g]:IsDescendantOf(e.CurrentParts)then return false end end if
|
||||
clusterPartsInRegion(Vector3.new(c.Position.X,d,c.Position.Z)-Vector3.new(0.75,
|
||||
2.75,0.75),Vector3.new(c.Position.X,d,c.Position.Z)+Vector3.new(0.75,1.75,0.75))
|
||||
then return false end return true end local function findConfigAtMouseTarget(c,d
|
||||
)if not c then return nil end if not d then error
|
||||
'findConfigAtMouseTarget: stampData is nil'return nil end if not d[
|
||||
'CurrentParts']then return nil end local e,f,g,h,i=4,false,CFrame.new(0,0,0),
|
||||
getBoundingBox2(d.CurrentParts)local j,k=i-h,nil if d.CurrentParts:IsA'Model'or
|
||||
d.CurrentParts:IsA'Tool'then k=d.CurrentParts:GetModelCFrame()else k=d.
|
||||
CurrentParts.CFrame end if c then if d.CurrentParts:IsA'Tool'then c.TargetFilter
|
||||
=d.CurrentParts.Handle else c.TargetFilter=d.CurrentParts end end local l,m=
|
||||
false,nil local n=pcall(function()m=c.Target end)if not n then return f,g end
|
||||
local o=Vector3.new(0,0,0)if c then o=Vector3.new(c.Hit.x,c.Hit.y,c.Hit.z)end
|
||||
local p=nil if nil==m then p=GetTerrainForMouse(c)if nil==p then l=false return
|
||||
f,g else m=game.Workspace.Terrain l=true p=Vector3.new(p.X-1,p.Y,p.Z)o=game.
|
||||
Workspace.Terrain:CellCenterToWorld(p.x,p.y,p.z)end end local q,r=
|
||||
getTargetPartBoundingBox(m)local s,t=r-q,getMouseTargetCFrame(m)if m:IsA
|
||||
'Terrain'then if not cluster then cluster=game.Workspace:FindFirstChild'Terrain'
|
||||
end local u=cluster:WorldToCellPreferSolid(o)if l then u=p end t=CFrame.new(game
|
||||
.Workspace.Terrain:CellCenterToWorld(u.x,u.y,u.z))end local u,v=t:
|
||||
pointToObjectSpace(o),Vector3.new(0,0,0)if c then v=m.CFrame:vectorToWorldSpace(
|
||||
Vector3.FromNormalId(c.TargetSurface))end local w,x if
|
||||
getClosestAlignedWorldDirection(v)==0 then w=t:vectorToObjectSpace(Vector3.new(1
|
||||
,-1,1))insertRefPointInInsert=k:vectorToObjectSpace(Vector3.new(-1,-1,1))x=
|
||||
Vector3.new(0,1,1)elseif getClosestAlignedWorldDirection(v)==3 then w=t:
|
||||
vectorToObjectSpace(Vector3.new(-1,-1,-1))insertRefPointInInsert=k:
|
||||
vectorToObjectSpace(Vector3.new(1,-1,-1))x=Vector3.new(0,1,1)elseif
|
||||
getClosestAlignedWorldDirection(v)==1 then w=t:vectorToObjectSpace(Vector3.new(-
|
||||
1,1,1))insertRefPointInInsert=k:vectorToObjectSpace(Vector3.new(-1,-1,1))x=
|
||||
Vector3.new(1,0,1)elseif getClosestAlignedWorldDirection(v)==4 then w=t:
|
||||
vectorToObjectSpace(Vector3.new(-1,-1,1))insertRefPointInInsert=k:
|
||||
vectorToObjectSpace(Vector3.new(-1,1,1))x=Vector3.new(1,0,1)elseif
|
||||
getClosestAlignedWorldDirection(v)==2 then w=t:vectorToObjectSpace(Vector3.new(-
|
||||
1,-1,1))insertRefPointInInsert=k:vectorToObjectSpace(Vector3.new(-1,-1,-1))x=
|
||||
Vector3.new(1,1,0)else w=t:vectorToObjectSpace(Vector3.new(1,-1,-1))
|
||||
insertRefPointInInsert=k:vectorToObjectSpace(Vector3.new(1,-1,1))x=Vector3.new(1
|
||||
,1,0)end w=w*(0.5*s)+0.5*(r+q)insertRefPointInInsert=insertRefPointInInsert*(0.5
|
||||
*j)+0.5*(i+h)local y=u-w local z=Vector3.new(e*math.modf(y.x/e),e*math.modf(y.y/
|
||||
e),e*math.modf(y.z/e))z=z*x local A=z+w local B,C=t:pointToWorldSpace(A),k:
|
||||
vectorToWorldSpace(insertRefPointInInsert)local D,E,F,G,H,I,J,K,L,M,N,O,P=B-C,k:
|
||||
components()g=CFrame.new(D.x,D.y,D.z,H,I,J,K,L,M,N,O,P)f=true return f,g,
|
||||
getClosestAlignedWorldDirection(v)end local function truncateToCircleEighth(c,d)
|
||||
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
|
||||
if c<0 then i=-1 end if d<0 then j=-1 end if h>0.382683432 then return
|
||||
0.707106781*g*i,0.707106781*g*j else return g*i,0 end end local function
|
||||
saveTheWelds(c,d,e)if c:IsA'ManualWeld'or c:IsA'Rotate'then table.insert(d,c)
|
||||
table.insert(e,c.Parent)else local f=c:GetChildren()for g=1,#f do saveTheWelds(f
|
||||
[g],d,e)end end end local function restoreTheWelds(c,d)for e=1,#c do c[e].Parent
|
||||
=d[e]end end a.CanEditRegion=function(c,d)if not d then return true,false end
|
||||
local e,f=getBoundingBoxInWorldCoordinates(c)if e.X<d.CFrame.p.X-d.Size.X/2 or e
|
||||
.Y<d.CFrame.p.Y-d.Size.Y/2 or e.Z<d.CFrame.p.Z-d.Size.Z/2 then return false,
|
||||
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
|
||||
.CFrame.p.Z+d.Size.Z/2 then return false,false end return true,false end a.
|
||||
GetStampModel=function(c,d,e)if c==0 then return nil,'No Asset'end if c<0 then
|
||||
return nil,'Negative Asset'end local function UnlockInstances(f)if f:IsA
|
||||
'BasePart'then f.Locked=false end for g,h in pairs(f:GetChildren())do
|
||||
UnlockInstances(h)end end local function getClosestColorToTerrainMaterial(f)if f
|
||||
==1 then return BrickColor.new'Bright green'elseif f==2 then return BrickColor.
|
||||
new'Bright yellow'elseif f==3 then return BrickColor.new'Bright red'elseif f==4
|
||||
then return BrickColor.new'Sand red'elseif f==5 then return BrickColor.new
|
||||
'Black'elseif f==6 then return BrickColor.new'Dark stone grey'elseif f==7 then
|
||||
return BrickColor.new'Sand blue'elseif f==8 then return BrickColor.new
|
||||
'Deep orange'elseif f==9 then return BrickColor.new'Dark orange'elseif f==10
|
||||
then return BrickColor.new'Reddish brown'elseif f==11 then return BrickColor.new
|
||||
'Light orange'elseif f==12 then return BrickColor.new'Light stone grey'elseif f
|
||||
==13 then return BrickColor.new'Sand green'elseif f==14 then return BrickColor.
|
||||
new'Medium stone grey'elseif f==15 then return BrickColor.new'Really red'elseif
|
||||
f==16 then return BrickColor.new'Really blue'elseif f==17 then return BrickColor
|
||||
.new'Bright blue'else return BrickColor.new'Bright green'end end local function
|
||||
setupFakeTerrainPart(f,g,h)local i=nil if g==1 or g==4 then i=Instance.new
|
||||
'WedgePart'i.formFactor='Custom'elseif g==2 then i=Instance.new'CornerWedgePart'
|
||||
else i=Instance.new'Part'i.formFactor='Custom'end i.Name='MegaClusterCube'i.Size
|
||||
=Vector3.new(4,4,4)i.BottomSurface='Smooth'i.TopSurface='Smooth'i.BrickColor=
|
||||
getClosestColorToTerrainMaterial(f)local j,k=0,math.pi if g==4 then j=-math.pi/2
|
||||
end if g==2 or g==3 then k=0 end i.CFrame=CFrame.Angles(0,math.pi/2*h+k,j)if g==
|
||||
3 then local l=Instance.new'SpecialMesh'l.MeshType='FileMesh'l.MeshId=
|
||||
'http://www.roblox.com/asset?id=66832495'l.Scale=Vector3.new(2,2,2)l.Parent=i
|
||||
end local l=Instance.new'Vector3Value'l.Value=Vector3.new(f,g,h)l.Name=
|
||||
'ClusterMaterial'l.Parent=i return i end local f,g,h=nil,nil,true if e then g=
|
||||
coroutine.create(function()f=game:GetService'InsertService':LoadAssetVersion(c)h
|
||||
=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
|
||||
local a,b={},nil b=function(c)local d,e,f=false,game.Workspace.CurrentCamera,nil
|
||||
do local g=e.CoordinateFrame.p f=Vector3.new(g.X,g.Y,g.Z)end local g,h,i=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
|
||||
j~=0 then a=h:Dot(i-f)/j if a>=0 and a<=1 then local l=((g-f)*a)+f k=game.
|
||||
Workspace.Terrain:WorldToCell(l)d=true end end return k,d end local c c=function
|
||||
(d)local e,f=game.Workspace.Terrain:WorldToCellPreferSolid(Vector3.new(d.hit.x,d
|
||||
.hit.y,d.hit.z)),nil if 0==game.Workspace.Terrain:GetCell(e.X,e.Y,e.Z).Value
|
||||
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
|
||||
end return e end local d,e=Vector3.new(0.3,0.3,0.3),nil e=function(f,g,h)if f:
|
||||
IsA'BasePart'then f.CFrame=(g*(f.CFrame-h))+h end local i=f:GetChildren()for j=1
|
||||
,#i do e(i[j],g,h)end end local f f=function(g,h)local i,j=CFrame.Angles(0,h,0),
|
||||
g:GetModelCFrame().p return e(g,i,j)end local g g=function(h,i,j,k)if h:IsA
|
||||
'BasePart'then i[#i+1]=h elseif h:IsA'Script'then j[#j+1]=h elseif h:IsA'Decal'
|
||||
then k[#k+1]=h end for l,m in pairs(h:GetChildren())do g(m,i,j,k)end end local h
|
||||
h=function(i,j)local k=game.Workspace:FindFirstChild'Terrain'local l,m=k:
|
||||
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.
|
||||
MaxExtents.Min.X then n=k.MaxExtents.Min.X end if o<k.MaxExtents.Min.Y then o=k.
|
||||
MaxExtents.Min.Y end if p<k.MaxExtents.Min.Z then p=k.MaxExtents.Min.Z end if q>
|
||||
k.MaxExtents.Max.X then q=k.MaxExtents.Max.X end if r>k.MaxExtents.Max.Y then r=
|
||||
k.MaxExtents.Max.Y end if s>k.MaxExtents.Max.Z then s=k.MaxExtents.Max.Z end for
|
||||
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
|
||||
end end end end return false end local i i=function(j,k)if not j then return end
|
||||
if j.className=='Seat'or j.className=='VehicleSeat'then table.insert(k,j)end
|
||||
local l=j:GetChildren()for m=1,#l do i(l[m],k)end end local j j=function(k,l)
|
||||
local m={}i(k,m)if l then for n=1,#m do local o=m[n]:FindFirstChild'SeatWeld'
|
||||
while o do o:Remove()o=m[n]:FindFirstChild'SeatWeld'end end else for n=1,#m do
|
||||
local o=Instance.new'Weld'o.Name='SeatWeld'o.Parent=m[n]end end end local k k=
|
||||
function(l)local m=l:FindFirstChild'AutoAlignToFace'if m then return m.Value
|
||||
else return false end end local l l=function(m)local n,o,p=Vector3.new(1,0,0),
|
||||
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
|
||||
+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(
|
||||
q)>math.abs(s)then if q>0 then return 0 else return 3 end elseif math.abs(r)>
|
||||
math.abs(q)and math.abs(r)>math.abs(s)then if r>0 then return 1 else return 4
|
||||
end else if s>0 then return 2 else return 5 end end end local m m=function(n,o)
|
||||
local p if not o then return o end if o and(o:IsA'Model'or o:IsA'Tool')then p=o:
|
||||
GetModelCFrame()o:TranslateBy(n.p-p.p)else o.CFrame=n end return o end local n n
|
||||
=function(o,p,q)if math.abs(p)<0.01 then return 0 end return(q-o)/p end local o
|
||||
o=function(p,q,r)if not p then return 0 end local s,t if p:IsA'Model'then s=p:
|
||||
GetModelCFrame()t=p:GetModelSize()else s=p.CFrame t=p.Size end local u,v=s:
|
||||
pointToObjectSpace(q),s:pointToObjectSpace(r)local w,x,y,z=v-u,1,1,1 if w.X>0
|
||||
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,
|
||||
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
|
||||
*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
|
||||
p=function(q)local r,s=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-
|
||||
math.huge,-math.huge,-math.huge)if q:IsA'Terrain'then r=Vector3.new(-2,-2,-2)s=
|
||||
Vector3.new(2,2,2)elseif q:IsA'BasePart'then r=-0.5*q.Size s=-r else s=q:
|
||||
GetModelSize()*0.5 r=-s end local t=q:FindFirstChild'Justification'if(t~=nil)
|
||||
then local u,v,w=t.Value,Vector3.new(2,2,2),s-r-Vector3.new(0.01,0.01,0.01)local
|
||||
x=Vector3.new(4*math.ceil(w.x/4),4*math.ceil(w.y/4),4*math.ceil(w.z/4))local y=x
|
||||
-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
|
||||
,t=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,-math.huge,
|
||||
-math.huge)if r:IsA'BasePart'and not r:IsA'Terrain'then local u,v=r.CFrame:
|
||||
pointToWorldSpace(-0.5*r.Size),r.CFrame:pointToWorldSpace(0.5*r.Size)s=Vector3.
|
||||
new(math.min(u.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.max(u.Y,v.Y),math.max(u.Z,v.Z))elseif not r:IsA'Terrain'then
|
||||
local u,v=r:GetModelCFrame():pointToWorldSpace(-0.5*r:GetModelSize()),r:
|
||||
GetModelCFrame():pointToWorldSpace(0.5*r:GetModelSize())s=Vector3.new(math.min(u
|
||||
.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
|
||||
.max(u.Y,v.Y),math.max(u.Z,v.Z))end return s,t end local r r=function(s)return
|
||||
p((function()if(s.Parent:FindFirstChild'RobloxModel'~=nil)then return s.Parent
|
||||
else return s end end)())end local s s=function(t)if(t.Parent:FindFirstChild
|
||||
'RobloxModel'~=nil)then if t.Parent:IsA'Tool'then return t.Parent.Handle.CFrame
|
||||
else return t.Parent:GetModelCFrame()end else return t.CFrame end end local t t=
|
||||
function(u)if not u then return false end if not u.Parent then return false end
|
||||
if u:FindFirstChild'Humanoid'then return false end if u:FindFirstChild
|
||||
'RobloxStamper'then return true end if u:IsA'Part'and not u.CanCollide then
|
||||
return false end if u==game.Lighting then return false end return t(u.Parent)end
|
||||
local u u=function(v,w,x)local y=game.Workspace:FindPartsInRegion3(Region3.new(
|
||||
Vector3.new(v.Position.X,w,v.Position.Z)-Vector3.new(0.75,2.75,0.75),Vector3.
|
||||
new(v.Position.X,w,v.Position.Z)+Vector3.new(0.75,1.75,0.75)),v.Parent,100)for z
|
||||
=1,#y do if y[z].CanCollide and not y[z]:IsDescendantOf(x.CurrentParts)then
|
||||
return false end end if h(Vector3.new(v.Position.X,w,v.Position.Z)-Vector3.new(
|
||||
0.75,2.75,0.75),Vector3.new(v.Position.X,w,v.Position.Z)+Vector3.new(0.75,1.75,
|
||||
0.75))then return false end return true end local v v=function(w,x)if not w then
|
||||
return end if not x then return error'findConfigAtMouseTarget: stampData is nil'
|
||||
end if not x['CurrentParts']then return end local y,z,A,B,C=4,false,CFrame.new(0
|
||||
,0,0),p(x.CurrentParts)local D,E=C-B,nil if x.CurrentParts:IsA'Model'or x.
|
||||
CurrentParts:IsA'Tool'then E=x.CurrentParts:GetModelCFrame()else E=x.
|
||||
CurrentParts.CFrame end if w then if x.CurrentParts:IsA'Tool'then w.TargetFilter
|
||||
=x.CurrentParts.Handle else w.TargetFilter=x.CurrentParts end end local F,G=
|
||||
false,nil local H=pcall(function()G=w.Target end)if not H then return z,A end
|
||||
local I=Vector3.new(0,0,0)if w then I=Vector3.new(w.Hit.x,w.Hit.y,w.Hit.z)end
|
||||
local J if nil==G then J=c(w)if nil==J then F=false return z,A else G=game.
|
||||
Workspace.Terrain F=true J=Vector3.new(J.X-1,J.Y,J.Z)I=game.Workspace.Terrain:
|
||||
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:
|
||||
IsA'Terrain'then if not cluster then cluster=game.Workspace:FindFirstChild
|
||||
'Terrain'end local O=cluster:WorldToCellPreferSolid(I)if F then O=J end N=CFrame
|
||||
.new(game.Workspace.Terrain:CellCenterToWorld(O.x,O.y,O.z))end local O,P=N:
|
||||
pointToObjectSpace(I),Vector3.new(0,0,0)if w then P=G.CFrame:vectorToWorldSpace(
|
||||
Vector3.FromNormalId(w.TargetSurface))end local Q,R,S if l(P)==0 then Q=N:
|
||||
vectorToObjectSpace(Vector3.new(1,-1,1))R=E:vectorToObjectSpace(Vector3.new(-1,-
|
||||
1,1))S=Vector3.new(0,1,1)elseif l(P)==3 then Q=N:vectorToObjectSpace(Vector3.
|
||||
new(-1,-1,-1))R=E:vectorToObjectSpace(Vector3.new(1,-1,-1))S=Vector3.new(0,1,1)
|
||||
elseif l(P)==1 then Q=N:vectorToObjectSpace(Vector3.new(-1,1,1))R=E:
|
||||
vectorToObjectSpace(Vector3.new(-1,-1,1))S=Vector3.new(1,0,1)elseif l(P)==4 then
|
||||
Q=N:vectorToObjectSpace(Vector3.new(-1,-1,1))R=E:vectorToObjectSpace(Vector3.
|
||||
new(-1,1,1))S=Vector3.new(1,0,1)elseif l(P)==2 then Q=N:vectorToObjectSpace(
|
||||
Vector3.new(-1,-1,1))R=E:vectorToObjectSpace(Vector3.new(-1,-1,-1))S=Vector3.
|
||||
new(1,1,0)else Q=N:vectorToObjectSpace(Vector3.new(1,-1,-1))R=E:
|
||||
vectorToObjectSpace(Vector3.new(1,-1,1))S=Vector3.new(1,1,0)end Q=Q*((0.5*M)+0.5
|
||||
*(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)
|
||||
,y*math.modf(T.y/y),y*math.modf(T.z/y))U=U*S local V=U+Q local W,X=N:
|
||||
pointToWorldSpace(V),E:vectorToWorldSpace(R)local Y,Z,_,aa,ab,ac,ad,ae,af,ag,ah,
|
||||
ai,aj=W-X,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil aa,aa,aa,ab,ac,ad,ae,
|
||||
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
|
||||
)z=true return z,A,l(P)end local aa aa=function(ab,ac)local ad,ae=math.abs(ab),
|
||||
math.abs(ac)local af=math.sqrt(ad*ad+ae*ae)local ag,ah,ai=ae/af,1,1 if ab<0 then
|
||||
ah=-1 end if ac<0 then ai=-1 end if ag>0.382683432 then return 0.707106781*af*ah
|
||||
,0.707106781*af*ai else return af*ah,0 end end local ab ab=function(ac,ad,ae)if
|
||||
ac:IsA'ManualWeld'or ac:IsA'Rotate'then table.insert(ad,ac)return table.insert(
|
||||
ae,ac.Parent)else local af=ac:GetChildren()for ag=1,#af do ab(af[ag],ad,ae)end
|
||||
end end local ac ac=function(ad,ae)for af=1,#ad do ad[af].Parent=ae[af]end end a
|
||||
.CanEditRegion=function(ad,ae)if not ae then return true,false end local af,ag
|
||||
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
|
||||
or af.Z<ae.CFrame.p.Z-ae.Size.Z/2 then return false,false end if ag.X>ae.CFrame.
|
||||
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.
|
||||
Z/2 then return false,false end return true,false end a.GetStampModel=function(
|
||||
ad,ae,af)if ad==0 then return nil,'No Asset'end if ad<0 then return nil,
|
||||
'Negative Asset'end local ag ag=function(ah)if ah:IsA'BasePart'then ah.Locked=
|
||||
false end for ai,aj in pairs(ah:GetChildren())do ag(aj)end end local ah ah=
|
||||
function(ai)return BrickColor.new((function()if 1==ai then return'Bright green'
|
||||
elseif 2==ai then return'Bright yellow'elseif 3==ai then return'Bright red'
|
||||
elseif 4==ai then return'Sand red'elseif 5==ai then return'Black'elseif 6==ai
|
||||
then return'Dark stone grey'elseif 7==ai then return'Sand blue'elseif 8==ai then
|
||||
return'Deep orange'elseif 9==ai then return'Dark orange'elseif 10==ai then
|
||||
return'Reddish brown'elseif 11==ai then return'Light orange'elseif 12==ai then
|
||||
return'Light stone grey'elseif 13==ai then return'Sand green'elseif 14==ai then
|
||||
return'Medium stone grey'elseif 15==ai then return'Really red'elseif 16==ai then
|
||||
return'Really blue'elseif 17==ai then return'Bright blue'else return
|
||||
'Bright green'end end)())end local ai ai=function(aj,w,x)local y if w==1 or w==4
|
||||
then y=Instance.new'WedgePart'y.formFactor='Custom'elseif w==2 then y=Instance.
|
||||
new'CornerWedgePart'else y=Instance.new'Part'y.formFactor='Custom'end y.Name=
|
||||
'MegaClusterCube'y.Size=Vector3.new(4,4,4)y.BottomSurface='Smooth'y.TopSurface=
|
||||
'Smooth'y.BrickColor=ah(aj)local z,A=0,math.pi if w==4 then z=-math.pi/2 end if
|
||||
w==2 or w==3 then A=0 end y.CFrame=CFrame.Angles(0,math.pi/2*x+A,z)if w==3 then
|
||||
local B=Instance.new'SpecialMesh'B.MeshType='FileMesh'B.MeshId=
|
||||
'http://www.roblox.com/asset?id=66832495'B.Scale=Vector3.new(2,2,2)B.Parent=y
|
||||
end local B=Instance.new'Vector3Value'B.Value=Vector3.new(aj,w,x)B.Name=
|
||||
'ClusterMaterial'B.Parent=y return y end local aj,w,x=nil,nil,true if af then w=
|
||||
coroutine.create(function()aj=game:GetService'InsertService':LoadAssetVersion(ad
|
||||
)x=false end)coroutine.resume(w)else w=coroutine.create(function()aj=game:
|
||||
GetService'InsertService':LoadAsset(ad)x=false end)coroutine.resume(w)end local
|
||||
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
|
||||
then return nil,'Load Time Fail'end if aj==nil then return nil,'Load Asset Fail'
|
||||
end if not aj:IsA'Model'then return nil,'Load Type Fail'end local B=aj:
|
||||
GetChildren()if#B==0 then return nil,'Empty Model Fail'end ag(aj)aj=aj:
|
||||
GetChildren()[1]for C,D in pairs(B)do if D:IsA'Team'then D.Parent=game:
|
||||
GetService'Teams'elseif D:IsA'Sky'then local E=game:GetService'Lighting'for F,G
|
||||
in pairs(E:GetChildren())do if G:IsA'Sky'then G:Remove()end end D.Parent=E
|
||||
return end end if not(aj:FindFirstChild'RobloxModel'~=nil)then local E=Instance.
|
||||
new'BoolValue'E.Name='RobloxModel'E.Parent=aj if not(aj:FindFirstChild
|
||||
'RobloxStamper'~=nil)then local F=Instance.new'BoolValue'F.Name='RobloxStamper'F
|
||||
.Parent=aj end end if ae then if aj.Name=='MegaClusterCube'then if ae==6 then
|
||||
local E=Instance.new'BoolValue'E.Name='AutoWedge'E.Parent=aj else local E=aj:
|
||||
FindFirstChild'ClusterMaterial'if E then if E:IsA'Vector3Value'then aj=ai(E.
|
||||
Value.X,ae,E.Value.Z)else aj=ai(E.Value,ae,0)end else aj=ai(1,ae,0)end end end
|
||||
end return aj end a.SetupStamperDragger=function(ad,ae,af,ag,ah)if not ad then
|
||||
error
|
||||
[[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!]]
|
||||
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]]
|
||||
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
|
||||
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']]
|
||||
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]]
|
||||
return nil end j=g h=e i=f end local k,l,m,n=0,nil,nil,Instance.new
|
||||
'SelectionBox'n.Color=BrickColor.new'Bright red'n.Transparency=0 n.Archivable=
|
||||
false local o=Instance.new'Part'o.Parent=nil o.formFactor='Custom'o.Size=Vector3
|
||||
.new(4,4,4)o.CFrame=CFrame.new()o.Archivable=false local p=Instance.new
|
||||
'SelectionBox'p.Color=BrickColor.new'Toothpaste'p.Adornee=o p.Visible=true p.
|
||||
Transparency=0 p.Name='HighScalabilityStamperLine'p.Archivable=false local q={}q
|
||||
.Start=nil q.End=nil q.Adorn=p q.AdornPart=o q.InternalLine=nil q.NewHint=true q
|
||||
.MorePoints={nil,nil}q.MoreLines={nil,nil}q.Dimensions=1 local r,s,t,u,v,w,x={},
|
||||
false,false,false,{},nil,Instance.new'BoolValue'x.Archivable=false x.Value=false
|
||||
local y={}y.TerrainOrientation=0 y.CFrame=0 local z={}z.Material=1 z.clusterType
|
||||
=0 z.clusterOrientation=0 local function isMegaClusterPart()if not l then return
|
||||
false end if not l.CurrentParts then return false end return(l.CurrentParts:
|
||||
FindFirstChild('ClusterMaterial',true)or(l.CurrentParts.Name=='MegaClusterCube')
|
||||
)end local function DoHighScalabilityRegionSelect()local A=l.CurrentParts:
|
||||
FindFirstChild'MegaClusterCube'if not A then if not l.CurrentParts.Name==
|
||||
'MegaClusterCube'then return else A=l.CurrentParts end end q.End=A.CFrame.p
|
||||
local B,C,D=nil,Vector3.new(0,0,0),Vector3.new(0,0,0)if q.Dimensions==1 then B=(
|
||||
q.End-q.Start)if math.abs(B.X)<math.abs(B.Y)then if math.abs(B.X)<math.abs(B.Z)
|
||||
then local G,H if math.abs(B.Y)>math.abs(B.Z)then G,H=truncateToCircleEighth(B.Y
|
||||
,B.Z)else H,G=truncateToCircleEighth(B.Z,B.Y)end B=Vector3.new(0,G,H)else local
|
||||
G,H=truncateToCircleEighth(B.Y,B.X)B=Vector3.new(H,G,0)end else if math.abs(B.Y)
|
||||
<math.abs(B.Z)then local G,H if math.abs(B.X)>math.abs(B.Z)then G,H=
|
||||
truncateToCircleEighth(B.X,B.Z)else H,G=truncateToCircleEighth(B.Z,B.X)end B=
|
||||
Vector3.new(G,0,H)else local G,H=truncateToCircleEighth(B.X,B.Y)B=Vector3.new(G,
|
||||
H,0)end end q.InternalLine=B elseif q.Dimensions==2 then B=q.MoreLines[1]C=q.End
|
||||
-q.MorePoints[1]C=C-B.unit*B.unit:Dot(C)tempCFrame=CFrame.new(q.Start,q.Start+B)
|
||||
local G,H=tempCFrame:vectorToWorldSpace(Vector3.new(0,1,0)),tempCFrame:
|
||||
vectorToWorldSpace(Vector3.new(1,0,0))local I,J=H:Dot(C),G:Dot(C)if math.abs(J)>
|
||||
math.abs(I)then C=C-H*I else C=C-G*J end q.InternalLine=C elseif q.Dimensions==3
|
||||
then B=q.MoreLines[1]C=q.MoreLines[2]D=q.End-q.MorePoints[2]D=D-B.unit*B.unit:
|
||||
Dot(D)D=D-C.unit*C.unit:Dot(D)q.InternalLine=D end tempCFrame=CFrame.new(q.Start
|
||||
,q.Start+B)if q.Dimensions==1 then q.AdornPart.Size=Vector3.new(4,4,B.magnitude+
|
||||
4)q.AdornPart.CFrame=tempCFrame+tempCFrame:vectorToWorldSpace(Vector3.new(2,2,2)
|
||||
-q.AdornPart.Size/2)else local G=tempCFrame:vectorToObjectSpace(B+C+D)q.
|
||||
AdornPart.Size=Vector3.new(4,4,4)+Vector3.new(math.abs(G.X),math.abs(G.Y),math.
|
||||
abs(G.Z))q.AdornPart.CFrame=tempCFrame+tempCFrame:vectorToWorldSpace(G/2)end
|
||||
local G=nil if game.Players['LocalPlayer']then G=game.Players.LocalPlayer:
|
||||
FindFirstChild'PlayerGui'if G and G:IsA'PlayerGui'then if(q.Dimensions==1 and B.
|
||||
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
|
||||
return nil end w=ah ai=af aj=ag end local x,y,z,A=0,nil,nil,Instance.new
|
||||
'SelectionBox'A.Color=BrickColor.new'Bright red'A.Transparency=0 A.Archivable=
|
||||
false local B=Instance.new'Part'B.Parent=nil B.formFactor='Custom'B.Size=Vector3
|
||||
.new(4,4,4)B.CFrame=CFrame.new()B.Archivable=false local C=Instance.new
|
||||
'SelectionBox'C.Color=BrickColor.new'Toothpaste'C.Adornee=B C.Visible=true C.
|
||||
Transparency=0 C.Name='HighScalabilityStamperLine'C.Archivable=false local D={}D
|
||||
.Start=nil D.End=nil D.Adorn=C D.AdornPart=B D.InternalLine=nil D.NewHint=true D
|
||||
.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'K.Archivable=false K.Value=false
|
||||
local L={}L.TerrainOrientation=0 L.CFrame=0 local M={}M.Material=1 M.clusterType
|
||||
=0 M.clusterOrientation=0 local N N=function()if not y then return false end if
|
||||
not y.CurrentParts then return false end return y.CurrentParts:FindFirstChild(
|
||||
'ClusterMaterial',true)or(y.CurrentParts.Name=='MegaClusterCube')end local O O=
|
||||
function()local P=y.CurrentParts:FindFirstChild'MegaClusterCube'if not P then if
|
||||
not y.CurrentParts.Name=='MegaClusterCube'then return else P=y.CurrentParts end
|
||||
end D.End=P.CFrame.p local Q,R,S=nil,Vector3.new(0,0,0),Vector3.new(0,0,0)if D.
|
||||
Dimensions==1 then Q=(D.End-D.Start)if math.abs(Q.X)<math.abs(Q.Y)then if math.
|
||||
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
|
||||
.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
|
||||
)Q=Vector3.new(U,T,0)end else if math.abs(Q.Y)<math.abs(Q.Z)then local T,U if
|
||||
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
|
||||
.new(T,0,U)else local T,U T,U=aa(Q.X,Q.Y)Q=Vector3.new(T,U,0)end end D.
|
||||
InternalLine=Q elseif D.Dimensions==2 then Q=D.MoreLines[1]R=D.End-D.MorePoints[
|
||||
1]R=R-(Q.unit*Q.unit:Dot(R))local T=CFrame.new(D.Start,D.Start+Q)local U,V=T:
|
||||
vectorToWorldSpace(Vector3.new(0,1,0)),T:vectorToWorldSpace(Vector3.new(1,0,0))
|
||||
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
|
||||
)end D.InternalLine=R elseif D.Dimensions==3 then Q=D.MoreLines[1]R=D.MoreLines[
|
||||
2]S=D.End-D.MorePoints[2]S=S-(Q.unit*Q.unit:Dot(S))S=S-(R.unit*R.unit:Dot(S))D.
|
||||
InternalLine=S end local T=CFrame.new(D.Start,D.Start+Q)if D.Dimensions==1 then
|
||||
D.AdornPart.Size=Vector3.new(4,4,Q.magnitude+4)D.AdornPart.CFrame=T+T:
|
||||
vectorToWorldSpace(Vector3.new(2,2,2)-D.AdornPart.Size/2)else local U=T:
|
||||
vectorToObjectSpace(Q+R+S)D.AdornPart.Size=Vector3.new(4,4,4)+Vector3.new(math.
|
||||
abs(U.X),math.abs(U.Y),math.abs(U.Z))D.AdornPart.CFrame=T+T:vectorToWorldSpace(U
|
||||
/2)end local U if game.Players['LocalPlayer']then U=game.Players.LocalPlayer:
|
||||
FindFirstChild'PlayerGui'if U and U:IsA'PlayerGui'then if(D.Dimensions==1 and Q.
|
||||
magnitude>3)or D.Dimensions>1 then D.Adorn.Parent=U end end end if not(U~=nil)
|
||||
then U=game:GetService'CoreGui'if(D.Dimensions==1 and Q.magnitude>3)or D.
|
||||
Dimensions>1 then D.Adorn.Parent=U end end end local P P=function(Q)if not Q
|
||||
then error'Error: RbxStamper.DoStamperMouseMove: Mouse is nil'return end if not
|
||||
A: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=
|
||||
GetTerrainForMouse(A)if nil==B then return end end if not l then return end
|
||||
configFound,targetCFrame,targetSurface=findConfigAtMouseTarget(A,l)if not
|
||||
configFound then error'RbxStamper.DoStamperMouseMove No configFound, returning'
|
||||
return end local B=0 if autoAlignToFace(l.CurrentParts)and targetSurface~=1 and
|
||||
targetSurface~=4 then if targetSurface==3 then B=0-k+autoAlignToFace(l.
|
||||
CurrentParts)elseif targetSurface==0 then B=2-k+autoAlignToFace(l.CurrentParts)
|
||||
elseif targetSurface==5 then B=3-k+autoAlignToFace(l.CurrentParts)elseif
|
||||
targetSurface==2 then B=1-k+autoAlignToFace(l.CurrentParts)end end local C=math.
|
||||
pi/2 k=k+B if l.CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then
|
||||
modelRotate(l.CurrentParts,C*B)else l.CurrentParts.CFrame=CFrame.
|
||||
fromEulerAnglesXYZ(0,C*B,0)*l.CurrentParts.CFrame end local D,G=
|
||||
getBoundingBoxInWorldCoordinates(l.CurrentParts)local H=nil if l.CurrentParts:
|
||||
IsA'Model'then H=l.CurrentParts:GetModelCFrame()else H=l.CurrentParts.CFrame end
|
||||
D=D+targetCFrame.p-H.p G=G+targetCFrame.p-H.p if clusterPartsInRegion(D+b,G-b)
|
||||
then if y.CFrame then if l.CurrentParts:FindFirstChild('ClusterMaterial',true)
|
||||
then local I=l.CurrentParts:FindFirstChild('ClusterMaterial',true)if I:IsA
|
||||
'Vector3Value'then local J=l.CurrentParts:FindFirstChild('ClusterMaterial',true)
|
||||
if J then J=clusterMat end end end end return end if isMegaClusterPart()then
|
||||
local I=game.Workspace.Terrain:WorldToCell(targetCFrame.p)local J,K,L,M,N,O,P,Q,
|
||||
R,S,T,U,V=game.Workspace.Terrain:CellCenterToWorld(I.X,I.Y,I.Z),targetCFrame:
|
||||
components()targetCFrame=CFrame.new(J.X,J.Y,J.Z,N,O,P,Q,R,S,T,U,V)end
|
||||
positionPartsAtCFrame3(targetCFrame,l.CurrentParts)y.CFrame=targetCFrame if l.
|
||||
CurrentParts:FindFirstChild('ClusterMaterial',true)then local I=l.CurrentParts:
|
||||
FindFirstChild('ClusterMaterial',true)if I:IsA'Vector3Value'then y.
|
||||
TerrainOrientation=I.Value.Z end end if A and A.Target and A.Target.Parent then
|
||||
local I=A.Target:FindFirstChild'RobloxModel'if not I then I=A.Target.Parent:
|
||||
FindFirstChild'RobloxModel'end local J=l.CurrentParts:FindFirstChild
|
||||
'UnstampableFaces'do local M,N='',''if I and I.Parent:FindFirstChild
|
||||
'UnstampableFaces'then M=I.Parent.UnstampableFaces.Value end if J then N=J.Value
|
||||
end local O=0 if I then O=modelTargetSurface(I.Parent,game.Workspace.
|
||||
CurrentCamera.CoordinateFrame.p,A.Hit.p)end for P in string.gmatch(M,'[^,]+')do
|
||||
if O==tonumber(P)then u=true game.JointsService:ClearJoinAfterMoveJoints()return
|
||||
end end O=modelTargetSurface(l.CurrentParts,A.Hit.p,game.Workspace.CurrentCamera
|
||||
.CoordinateFrame.p)for Q in string.gmatch(N,'[^,]+')do if O==tonumber(Q)then u=
|
||||
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
|
||||
Q:IsA'Mouse'then error('Error: RbxStamper.DoStamperMouseMove: Mouse is of type',
|
||||
Q.className,'should be of type Mouse')return end if not Q.Target then local R=c(
|
||||
Q)if nil==R then return end end if not y then return end local R,S,T=v(Q,y)if
|
||||
not R then error'RbxStamper.DoStamperMouseMove No configFound, returning'return
|
||||
end local U=0 if k(y.CurrentParts)and T~=1 and T~=4 then if T==3 then U=0-x+k(y.
|
||||
CurrentParts)elseif T==0 then U=2-x+k(y.CurrentParts)elseif T==5 then U=3-x+k(y.
|
||||
CurrentParts)elseif T==2 then U=1-x+k(y.CurrentParts)end end local V=math.pi/2 x
|
||||
=x+U if y.CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool'then f(y.
|
||||
CurrentParts,V*U)else y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,V*U,0){y
|
||||
.CurrentParts.CFrame}end local W,X W,X=q(y.CurrentParts)local Y if y.
|
||||
CurrentParts:IsA'Model'then Y=y.CurrentParts:GetModelCFrame()else Y=y.
|
||||
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
|
||||
then if y.CurrentParts:FindFirstChild('ClusterMaterial',true)then local ak=y.
|
||||
CurrentParts:FindFirstChild('ClusterMaterial',true)if ak:IsA'Vector3Value'then
|
||||
local al=y.CurrentParts:FindFirstChild('ClusterMaterial',true)if al then al=
|
||||
clusterMat end end end end return end if N()then local ak=game.Workspace.Terrain
|
||||
:WorldToCell(S.p)local al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax=game.Workspace.
|
||||
Terrain:CellCenterToWorld(ak.X,ak.Y,ak.Z),nil,nil,nil,nil,nil,nil,nil,nil,nil,
|
||||
nil,nil,nil ao,ao,ao,ap,aq,ar,as,at,au,av,aw,ax=S:components()S=CFrame.new(al.X,
|
||||
al.Y,al.Z,ap,aq,ar,as,at,au,av,aw,ax)end m(S,y.CurrentParts)L.CFrame=S if y.
|
||||
CurrentParts:FindFirstChild('ClusterMaterial',true)then local ak=y.CurrentParts:
|
||||
FindFirstChild('ClusterMaterial',true)if ak:IsA'Vector3Value'then L.
|
||||
TerrainOrientation=ak.Value.Z end end if Q and Q.Target and Q.Target.Parent then
|
||||
local ak=Q.Target:FindFirstChild'RobloxModel'if not ak then ak=Q.Target.Parent:
|
||||
FindFirstChild'RobloxModel'end local al=y.CurrentParts:FindFirstChild
|
||||
'UnstampableFaces'do local ao,ap='',''if ak and ak.Parent:FindFirstChild
|
||||
'UnstampableFaces'then ao=ak.Parent.UnstampableFaces.Value end if al then ap=al.
|
||||
Value end local aq=0 if ak then aq=o(ak.Parent,game.Workspace.CurrentCamera.
|
||||
CoordinateFrame.p,Q.Hit.p)end for ar in string.gmatch(ao,'[^,]+')do if aq==
|
||||
tonumber(ar)then H=true game.JointsService:ClearJoinAfterMoveJoints()return end
|
||||
end aq=o(y.CurrentParts,Q.Hit.p,game.Workspace.CurrentCamera.CoordinateFrame.p)
|
||||
for as in string.gmatch(ap,'[^,]+')do if aq==tonumber(as)then H=true game.
|
||||
JointsService:ClearJoinAfterMoveJoints()return end end end end H=false game.
|
||||
JointsService:SetJoinAfterMoveInstance(y.CurrentParts)if(not pcall(function()if
|
||||
Q and Q.Target and not(Q.Target.Parent:FindFirstChild'RobloxModel'~=nil)then
|
||||
return else return end end))then error
|
||||
[[Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check]]game.
|
||||
JointsService:ClearJoinAfterMoveJoints()A=nil return end if A and A.Target and A
|
||||
.Target.Parent:FindFirstChild'RobloxModel'==nil then game.JointsService:
|
||||
SetJoinAfterMoveTarget(A.Target)else game.JointsService:SetJoinAfterMoveTarget(
|
||||
nil)end game.JointsService:ShowPermissibleJoints()if isMegaClusterPart()and q
|
||||
and q.Start then DoHighScalabilityRegionSelect()end end local function
|
||||
setupKeyListener(A,B)if r and r['Paused']then return end A=string.lower(A)if A==
|
||||
'r'and not autoAlignToFace(l.CurrentParts)then k=k+1 local C=l.CurrentParts:
|
||||
FindFirstChild('ClusterMaterial',true)if C and C:IsA'Vector3Value'then C.Value=
|
||||
Vector3.new(C.Value.X,C.Value.Y,(C.Value.Z+1)%4)end local D=math.pi/2 if l.
|
||||
CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then modelRotate(l.
|
||||
CurrentParts,D)else l.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,D,0)*l.
|
||||
CurrentParts.CFrame end configFound,targetCFrame=findConfigAtMouseTarget(B,l)if
|
||||
configFound then positionPartsAtCFrame3(targetCFrame,l.CurrentParts)
|
||||
DoStamperMouseMove(B)end elseif A=='c'then if q.InternalLine and q.InternalLine.
|
||||
magnitude>0 and q.Dimensions<3 then q.MorePoints[q.Dimensions]=q.End q.MoreLines
|
||||
[q.Dimensions]=q.InternalLine q.Dimensions=q.Dimensions+1 q.NewHint=true end end
|
||||
end w=d.KeyDown:connect(function(A)setupKeyListener(A,d)end)local function
|
||||
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:
|
||||
JointsService:ClearJoinAfterMoveJoints()Q=nil return end if Q and Q.Target and
|
||||
not(Q.Target.Parent:FindFirstChild'RobloxModel'~=nil)then game.JointsService:
|
||||
SetJoinAfterMoveTarget(Q.Target)else game.JointsService:SetJoinAfterMoveTarget(
|
||||
nil)end game.JointsService:ShowPermissibleJoints()if N()and D and D.Start then
|
||||
return O()end end local ak ak=function(al,ao)if E and E['Paused']then return end
|
||||
al=string.lower(al)if al=='r'and not k(y.CurrentParts)then x=x+1 local ap=y.
|
||||
CurrentParts:FindFirstChild('ClusterMaterial',true)if ap and ap:IsA
|
||||
'Vector3Value'then ap.Value=Vector3.new(ap.Value.X,ap.Value.Y,(ap.Value.Z+1)%4)
|
||||
end local aq=math.pi/2 if y.CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool'
|
||||
then f(y.CurrentParts,aq)else y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,
|
||||
aq,0)*y.CurrentParts.CFrame end local as,at=v(ao,y)if as then m(at,y.
|
||||
CurrentParts)return P(ao)end elseif al=='c'then if D.InternalLine and D.
|
||||
InternalLine.magnitude>0 and D.Dimensions<3 then D.MorePoints[D.Dimensions]=D.
|
||||
End D.MoreLines[D.Dimensions]=D.InternalLine D.Dimensions=D.Dimensions+1 D.
|
||||
NewHint=true end end end J=ae.KeyDown:connect(function(al)return ak(al,ae)end)
|
||||
local al al=function()if D then D.Start=nil D.End=nil D.InternalLine=nil D.
|
||||
NewHint=true end end local ao ao=function()local ap=game.CoreGui if game:
|
||||
FindFirstChild'Players'then if game.Players['LocalPlayer']then if game.Players.
|
||||
LocalPlayer:FindFirstChild'PlayerGui'then A=game.Players.LocalPlayer.PlayerGui
|
||||
end end end if not l['ErrorBox']then return end l.ErrorBox.Parent=A if l.
|
||||
CurrentParts:IsA'Tool'then l.ErrorBox.Adornee=l.CurrentParts.Handle else l.
|
||||
ErrorBox.Adornee=l.CurrentParts end delay(0,function()for B=1,3 do if l[
|
||||
'ErrorBox']then l.ErrorBox.Visible=true end wait(0.13)if l['ErrorBox']then l.
|
||||
ErrorBox.Visible=false end wait(0.13)end if l['ErrorBox']then l.ErrorBox.Adornee
|
||||
=nil l.ErrorBox.Parent=Tool end end)end local function DoStamperMouseDown(A)if
|
||||
not A then error'Error: RbxStamper.DoStamperMouseDown: Mouse is nil'return end
|
||||
if not A:IsA'Mouse'then error(
|
||||
'Error: RbxStamper.DoStamperMouseDown: Mouse is of type',A.className,
|
||||
'should be of type Mouse')return end if not l then return end if
|
||||
isMegaClusterPart()then if A and q then local B,C=l.CurrentParts:FindFirstChild(
|
||||
'MegaClusterCube',true),game.Workspace.Terrain if B then q.Dimensions=1 local D=
|
||||
C:WorldToCell(B.CFrame.p)q.Start=C:CellCenterToWorld(D.X,D.Y,D.Z)return else q.
|
||||
Dimensions=1 local D=C:WorldToCell(l.CurrentParts.CFrame.p)q.Start=C:
|
||||
CellCenterToWorld(D.X,D.Y,D.Z)return end end end end local function
|
||||
loadSurfaceTypes(A,B)A.TopSurface=B[1]A.BottomSurface=B[2]A.LeftSurface=B[3]A.
|
||||
RightSurface=B[4]A.FrontSurface=B[5]A.BackSurface=B[6]end local function
|
||||
saveSurfaceTypes(A,B)local C={}C[1]=A.TopSurface C[2]=A.BottomSurface C[3]=A.
|
||||
LeftSurface C[4]=A.RightSurface C[5]=A.FrontSurface C[6]=A.BackSurface B[A]=C
|
||||
end local function prepareModel(A)if not A then return nil end local B,C,D,G,H,I
|
||||
=0.7,1,A:Clone(),{},{},{}l={}l.DisabledScripts={}l.TransparencyTable={}l.
|
||||
MaterialTable={}l.CanCollideTable={}l.AnchoredTable={}l.ArchivableTable={}l.
|
||||
DecalTransparencyTable={}l.SurfaceTypeTable={}collectParts(D,H,G,I)if#H<=0 then
|
||||
return nil,'no parts found in modelToStamp'end for J,M in pairs(G)do if not M.
|
||||
Disabled then M.Disabled=true l.DisabledScripts[#l.DisabledScripts+1]=M end end
|
||||
for N,O in pairs(H)do l.TransparencyTable[O]=O.Transparency O.Transparency=C+(1-
|
||||
C)*O.Transparency l.MaterialTable[O]=O.Material O.Material=Enum.Material.Plastic
|
||||
l.CanCollideTable[O]=O.CanCollide O.CanCollide=false l.AnchoredTable[O]=O.
|
||||
Anchored O.Anchored=true l.ArchivableTable[O]=O.Archivable O.Archivable=false
|
||||
saveSurfaceTypes(O,l.SurfaceTypeTable)local Q,R=0.5,0.5 delay(0,function()wait(Q
|
||||
)local S=tick()local T=S while(T-S)<R and O and O:IsA'BasePart'and O.
|
||||
Transparency>B do local U=1-(((T-S)/R)*(C-B))if l['TransparencyTable']and l.
|
||||
TransparencyTable[O]then O.Transparency=U+(1-U)*l.TransparencyTable[O]end wait(
|
||||
0.03)T=tick()end if O and O:IsA'BasePart'then if l['TransparencyTable']and l.
|
||||
TransparencyTable[O]then O.Transparency=B+(1-B)*l.TransparencyTable[O]end end
|
||||
end)end for Q,R in pairs(I)do l.DecalTransparencyTable[R]=R.Transparency R.
|
||||
Transparency=B+(1-B)*R.Transparency end setSeatEnabledStatus(D,true)
|
||||
setSeatEnabledStatus(D,false)l.CurrentParts=D if autoAlignToFace(D)then l.
|
||||
CurrentParts:ResetOrientationToIdentity()k=0 else local S=k*math.pi/2 if l.
|
||||
CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then modelRotate(l.
|
||||
CurrentParts,S)else l.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,S,0)*l.
|
||||
CurrentParts.CFrame end end local S=l.CurrentParts:FindFirstChild(
|
||||
'ClusterMaterial',true)if S and S:IsA'Vector3Value'then S.Value=Vector3.new(S.
|
||||
Value.X,S.Value.Y,(S.Value.Z+k)%4)end local T,U=findConfigAtMouseTarget(d,l)if T
|
||||
then l.CurrentParts=positionPartsAtCFrame3(U,l.CurrentParts)end game.
|
||||
JointsService:SetJoinAfterMoveInstance(l.CurrentParts)return D,H end
|
||||
local function checkTerrainBlockCollisions(A,B)local C=game.Workspace.Terrain.
|
||||
CellCenterToWorld local D=C(game.Workspace.Terrain,A.X,A.Y,A.Z)local G,H=game.
|
||||
Workspace:FindPartsInRegion3(Region3.new(D-Vector3.new(2,2,2)+b,D+Vector3.new(2,
|
||||
2,2)-b),l.CurrentParts,100),false for I=1,#G do if isBlocker(G[I])then H=true
|
||||
break end end if not H then local I={}for M=1,#G do if G[M].Parent and not I[G[M
|
||||
].Parent]and G[M].Parent:FindFirstChild'Humanoid'and G[M].Parent:FindFirstChild
|
||||
'Humanoid':IsA'Humanoid'then local O=G[M].Parent:FindFirstChild'Torso'I[G[M].
|
||||
Parent]=true if O then local Q=D.Y+5 if spaceAboveCharacter(O,Q,l)then O.CFrame=
|
||||
O.CFrame+Vector3.new(0,Q-O.CFrame.p.Y,0)else H=true break end end end end end if
|
||||
not H then local I=true if B then if i then local M=C(game.Workspace.Terrain,A.X
|
||||
,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.
|
||||
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
|
||||
.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
|
||||
end return false end local function ResolveMegaClusterStamp(A)local B,C,D,G,H,I,
|
||||
M,O,Q=false,game.Workspace.Terrain,q.InternalLine,game.Workspace.Terrain.
|
||||
MaxExtents.Max,game.Workspace.Terrain.MaxExtents.Min,1,0,0,false if l.
|
||||
CurrentParts:FindFirstChild'AutoWedge'then Q=true end if l.CurrentParts:
|
||||
FindFirstChild('ClusterMaterial',true)then I=l.CurrentParts:FindFirstChild(
|
||||
'ClusterMaterial',true)if I:IsA'Vector3Value'then M=I.Value.Y O=I.Value.Z I=I.
|
||||
Value.X elseif I:IsA'IntValue'then I=I.Value end end if q.Adorn.Parent and q.
|
||||
Start and((q.Dimensions>1)or(D and D.magnitude>0))then local R,S,T,U,V,W,X,Y=
|
||||
game.Workspace.Terrain:WorldToCell(q.Start),{0,0,0},{0,0,0},{0,0,0},{nil,nil,nil
|
||||
},{Vector3.new(0,0,0),Vector3.new(0,0,0),Vector3.new(0,0,0)},{Vector3.new(1,0,0)
|
||||
,Vector3.new(0,1,0),Vector3.new(0,0,1)},{}if q.Dimensions>1 then table.insert(Y,
|
||||
q.MoreLines[1])end if D and D.magnitude>0 then table.insert(Y,D)end if q.
|
||||
Dimensions>2 then table.insert(Y,q.MoreLines[2])end for Z=1,#Y do Y[Z]=Vector3.
|
||||
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]
|
||||
.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
|
||||
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
|
||||
end V[Z]=Vector3.new(S[Z],T[Z],U[Z])if V[Z].magnitude<0.9 then V[Z]=nil end end
|
||||
if not Y[2]then Y[2]=Vector3.new(0,0,0)end if not Y[3]then Y[3]=Vector3.new(0,0,
|
||||
0)end local Z,_=l.CurrentParts:FindFirstChild('WaterForceTag',true),l.
|
||||
CurrentParts:FindFirstChild('WaterForceDirectionTag',true)while W[3].magnitude*4
|
||||
<=Y[3].magnitude do local aa=1 while aa<4 do W[2]=Vector3.new(0,0,0)while W[2].
|
||||
magnitude*4<=Y[2].magnitude do local ab=1 while ab<4 do W[1]=Vector3.new(0,0,0)
|
||||
while W[1].magnitude*4<=Y[1].magnitude do local ac=W[1]+W[2]+W[3]local ad=
|
||||
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
|
||||
>=H.Z and ad.X<G.X and ad.Y<G.Y and ad.Z<G.Z then local ae=
|
||||
checkTerrainBlockCollisions(ad,A)if ae then if Z then C:SetWaterCell(ad.X,ad.Y,
|
||||
ad.Z,Enum.WaterForce[Z.Value],Enum.WaterDirection[_.Value])else C:SetCell(ad.X,
|
||||
ad.Y,ad.Z,I,M,O)end B=true if Q then game.Workspace.Terrain:AutowedgeCells(
|
||||
Region3int16.new(Vector3int16.new(ad.x-1,ad.y-1,ad.z-1),Vector3int16.new(ad.x+1,
|
||||
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]:
|
||||
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=
|
||||
ab+1 else W[2]=Vector3.new(1,0,0)ab=4 end if W[2].magnitude*4>Y[2].magnitude
|
||||
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 if aa<4 then W[3]=W[3]+X[aa]*X[aa]:Dot(V[3])end aa=aa+1 else W[3]=Vector3.
|
||||
new(1,0,0)aa=4 end if W[3].magnitude*4>Y[3].magnitude then aa=4 end end end end
|
||||
q.Start=nil q.Adorn.Parent=nil if B then l.CurrentParts.Parent=nil pcall(
|
||||
function()game:GetService'ChangeHistoryService':SetWaypoint'StamperMulti'end)end
|
||||
return B end local function DoStamperMouseUp(aa)if not aa 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
|
||||
LocalPlayer:FindFirstChild'PlayerGui'then ap=game.Players.LocalPlayer.PlayerGui
|
||||
end end end if not y['ErrorBox']then return end y.ErrorBox.Parent=ap if y.
|
||||
CurrentParts:IsA'Tool'then y.ErrorBox.Adornee=y.CurrentParts.Handle else y.
|
||||
ErrorBox.Adornee=y.CurrentParts end return delay(0,function()for aq=1,3 do if y[
|
||||
'ErrorBox']then y.ErrorBox.Visible=true end wait(0.13)if y['ErrorBox']then y.
|
||||
ErrorBox.Visible=false end wait(0.13)end if y['ErrorBox']then y.ErrorBox.Adornee
|
||||
=nil y.ErrorBox.Parent=Tool end end)end local ap ap=function(aq)if not aq then
|
||||
error'Error: RbxStamper.DoStamperMouseDown: Mouse is nil'return end if not aq:
|
||||
IsA'Mouse'then error('Error: RbxStamper.DoStamperMouseDown: Mouse is of type',aq
|
||||
.className,'should be of type Mouse')return end if not y then return end if N()
|
||||
then if aq and D then local as,at=y.CurrentParts:FindFirstChild(
|
||||
'MegaClusterCube',true),game.Workspace.Terrain if as then D.Dimensions=1 local
|
||||
au=at:WorldToCell(as.CFrame.p)D.Start=at:CellCenterToWorld(au.X,au.Y,au.Z)return
|
||||
else D.Dimensions=1 local au=at:WorldToCell(y.CurrentParts.CFrame.p)D.Start=at:
|
||||
CellCenterToWorld(au.X,au.Y,au.Z)return end end end end local aq aq=function(as,
|
||||
at)as.TopSurface=at[1]as.BottomSurface=at[2]as.LeftSurface=at[3]as.RightSurface=
|
||||
at[4]as.FrontSurface=at[5]as.BackSurface=at[6]return as end local as as=function
|
||||
(at,au)local av={}av[1]=at.TopSurface av[2]=at.BottomSurface av[3]=at.
|
||||
LeftSurface av[4]=at.RightSurface av[5]=at.FrontSurface av[6]=at.BackSurface au[
|
||||
at]=av end local at at=function(au)if not au then return nil end local av,aw,ax,
|
||||
Q,R,S=0.7,1,au:Clone(),{},{},{}y={}y.DisabledScripts={}y.TransparencyTable={}y.
|
||||
MaterialTable={}y.CanCollideTable={}y.AnchoredTable={}y.ArchivableTable={}y.
|
||||
DecalTransparencyTable={}y.SurfaceTypeTable={}g(ax,R,Q,S)if#R<=0 then return nil
|
||||
,'no parts found in modelToStamp'end for T,U in pairs(Q)do if not U.Disabled
|
||||
then U.Disabled=true y.DisabledScripts[#y.DisabledScripts+1]=U end end for V,W
|
||||
in pairs(R)do y.TransparencyTable[W]=W.Transparency W.Transparency=aw+(1-aw)*W.
|
||||
Transparency y.MaterialTable[W]=W.Material W.Material=Enum.Material.Plastic y.
|
||||
CanCollideTable[W]=W.CanCollide W.CanCollide=false y.AnchoredTable[W]=W.Anchored
|
||||
W.Anchored=true y.ArchivableTable[W]=W.Archivable W.Archivable=false as(W,y.
|
||||
SurfaceTypeTable)local X,Y=0.5,0.5 delay(0,function()wait(X)local ay=tick()local
|
||||
az=ay while(az-ay)<Y and W and W:IsA'BasePart'and W.Transparency>av do local aA=
|
||||
1-(((az-ay)/Y)*(aw-av))if y['TransparencyTable']and y.TransparencyTable[W]then W
|
||||
.Transparency=aA+(1-aA)*y.TransparencyTable[W]end wait(0.03)az=tick()end if W
|
||||
and W:IsA'BasePart'then if y['TransparencyTable']and y.TransparencyTable[W]then
|
||||
W.Transparency=av+(1-av)*y.TransparencyTable[W]end end end)end for ay,az in
|
||||
pairs(S)do y.DecalTransparencyTable[az]=az.Transparency az.Transparency=av+(1-av
|
||||
)*az.Transparency end j(ax,true)j(ax,false)y.CurrentParts=ax if k(ax)then y.
|
||||
CurrentParts:ResetOrientationToIdentity()x=0 else local aA=x*math.pi/2 if y.
|
||||
CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool'then f(y.CurrentParts,aA)else
|
||||
y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,aA,0)*y.CurrentParts.CFrame
|
||||
end end local aA=y.CurrentParts:FindFirstChild('ClusterMaterial',true)if aA and
|
||||
aA:IsA'Vector3Value'then aA.Value=Vector3.new(aA.Value.X,aA.Value.Y,(aA.Value.Z+
|
||||
x)%4)end local X,Y X,Y=v(ae,y)if X then y.CurrentParts=m(Y,y.CurrentParts)end
|
||||
game.JointsService:SetJoinAfterMoveInstance(y.CurrentParts)return ax,R end local
|
||||
au au=function(av,aw)local ax=game.Workspace.Terrain.CellCenterToWorld local ay=
|
||||
ax(game.Workspace.Terrain,av.X,av.Y,av.Z)local az,aA=game.Workspace:
|
||||
FindPartsInRegion3(Region3.new(ay-Vector3.new(2,2,2)+d,ay+Vector3.new(2,2,2)-d),
|
||||
y.CurrentParts,100),false for Q=1,#az do if t(az[Q])then aA=true break end end
|
||||
if not aA then local Q={}for R=1,#az do if az[R].Parent and not Q[az[R].Parent]
|
||||
and az[R].Parent:FindFirstChild(az[R].Parent:FindFirstChild'Humanoid':IsA
|
||||
'Humanoid')then local S=az[R].Parent:FindFirstChild'Torso'Q[az[R].Parent]=true
|
||||
if S then local U=ay.Y+5 if u(S,U,y)then S.CFrame=S.CFrame+Vector3.new(0,U-S.
|
||||
CFrame.p.Y,0)else aA=true break end end end end end if not aA then local Q=true
|
||||
if aw then if aj then av=ax(game.Workspace.Terrain,av.X,av.Y,av.Z)if(av.X+2>aj.
|
||||
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
|
||||
.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.
|
||||
Size.Z/2)or(av.Z-2<aj.CFrame.p.Z-aj.Size.Z/2)then Q=false end end end return Q
|
||||
end return false end local av av=function(aw)local ax,ay,az,aA,Q,R,S,U,W=false,
|
||||
game.Workspace.Terrain,D.InternalLine,game.Workspace.Terrain.MaxExtents.Max,game
|
||||
.Workspace.Terrain.MaxExtents.Min,1,0,0,false if y.CurrentParts:FindFirstChild
|
||||
'AutoWedge'then W=true end if y.CurrentParts:FindFirstChild('ClusterMaterial',
|
||||
true)then R=y.CurrentParts:FindFirstChild('ClusterMaterial',true)if R:IsA
|
||||
'Vector3Value'then S=R.Value.Y U=R.Value.Z R=R.Value.X elseif R:IsA'IntValue'
|
||||
then R=R.Value end end if D.Adorn.Parent and D.Start and((D.Dimensions>1)or(az
|
||||
and az.magnitude>0))then local X,Y,aB,aC,aD,aE,aF,aG=game.Workspace.Terrain:
|
||||
WorldToCell(D.Start),{0,0,0},{0,0,0},{0,0,0},{nil,nil,nil},{Vector3.new(0,0,0),
|
||||
Vector3.new(0,0,0),Vector3.new(0,0,0)},{Vector3.new(1,0,0),Vector3.new(0,1,0),
|
||||
Vector3.new(0,0,1)},{}if D.Dimensions>1 then table.insert(aG,D.MoreLines[1])end
|
||||
if az and az.magnitude>0 then table.insert(aG,az)end if D.Dimensions>2 then
|
||||
table.insert(aG,D.MoreLines[2])end for aH=1,#aG do aG[aH]=Vector3.new(math.
|
||||
floor(aG[aH].X+0.5),math.floor(aG[aH].Y+0.5),math.floor(aG[aH].Z+0.5))if aG[aH].
|
||||
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
|
||||
elseif aG[aH].Y<0 then aB[aH]=-1 end if aG[aH].Z>0 then aC[aH]=1 elseif aG[aH].Z
|
||||
<0 then aC[aH]=-1 end aD[aH]=Vector3.new(Y[aH],aB[aH],aC[aH])if aD[aH].magnitude
|
||||
<0.9 then aD[aH]=nil end end if not aG[2]then aG[2]=Vector3.new(0,0,0)end if not
|
||||
aG[3]then aG[3]=Vector3.new(0,0,0)end local aH,aI=y.CurrentParts:FindFirstChild(
|
||||
'WaterForceTag',true),y.CurrentParts:FindFirstChild('WaterForceDirectionTag',
|
||||
true)while aE[3].magnitude*4<=aG[3].magnitude do local aJ=1 while aJ<4 do aE[2]=
|
||||
Vector3.new(0,0,0)while aE[2].magnitude*4<=aG[2].magnitude do local aK=1 while
|
||||
aK<4 do aE[1]=Vector3.new(0,0,0)while aE[1].magnitude*4<=aG[1].magnitude do
|
||||
local aL=aE[1]+aE[2]+aE[3]local aM=Vector3int16.new(X.X+aL.X,X.Y+aL.Y,X.Z+aL.Z)
|
||||
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
|
||||
.Z then local aN=au(aM,aw)if aN then if aH then ay:SetWaterCell(aM.X,aM.Y,aM.Z,
|
||||
Enum.WaterForce[aH.Value],Enum.WaterDirection[aI.Value])else ay:SetCell(aM.X,aM.
|
||||
Y,aM.Z,R,S,U)end ax=true if W then game.Workspace.Terrain:AutowedgeCells(
|
||||
Region3int16.new(Vector3int16.new(aM.x-1,aM.y-1,aM.z-1),Vector3int16.new(aM.x+1,
|
||||
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[
|
||||
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
|
||||
])end aK=aK+1 else aE[2]=Vector3.new(1,0,0)aK=4 end if aE[2].magnitude*4>aG[2].
|
||||
magnitude then aK=4 end end end if aD[3]then while aJ<4 and aF[aJ]:Dot(aD[3])==0
|
||||
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
|
||||
aE[3]=Vector3.new(1,0,0)aJ=4 end if aE[3].magnitude*4>aG[3].magnitude then aJ=4
|
||||
end end end end D.Start=nil D.Adorn.Parent=nil if ax then y.CurrentParts.Parent=
|
||||
nil pcall(function()return game:GetService'ChangeHistoryService':SetWaypoint
|
||||
'StamperMulti'end)end return ax end local aw aw=function(ax)if not ax then error
|
||||
'Error: RbxStamper.DoStamperMouseUp: Mouse is nil'return false end if not ax:IsA
|
||||
'Mouse'then error('Error: RbxStamper.DoStamperMouseUp: Mouse is of type',ax.
|
||||
className,'should be of type Mouse')return false end if not y.Dragger then error
|
||||
[[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,
|
||||
isMegaClusterPart()if ad and q and q.Start and q.InternalLine and q.InternalLine
|
||||
.magnitude>0 then ac=true ab=true else ac,ab=a.CanEditRegion(l.CurrentParts,i)
|
||||
end if not ac then if j then j()end return false end end if u then flashRedBox()
|
||||
return false end canStamp,ab=a.CanEditRegion(l.CurrentParts,i)if not canStamp
|
||||
then if j then j()end return false end local ac,ad=
|
||||
getBoundingBoxInWorldCoordinates(l.CurrentParts)configFound,targetCFrame=
|
||||
findConfigAtMouseTarget(aa,l)if configFound and not q.Adorn.Parent then if
|
||||
clusterPartsInRegion(ac+b,ad-b)then flashRedBox()return false end local ae=game.
|
||||
Workspace:FindPartsInRegion3(Region3.new(ac+b,ad-b),l.CurrentParts,100)for A=1,#
|
||||
ae do if isBlocker(ae[A])then flashRedBox()return false end end local A={}for B=
|
||||
1,#ae do if ae[B].Parent and not A[ae[B].Parent]and ae[B].Parent:FindFirstChild
|
||||
'Humanoid'and ae[B].Parent:FindFirstChild'Humanoid':IsA'Humanoid'then local C=ae
|
||||
[B].Parent:FindFirstChild'Torso'A[ae[B].Parent]=true if C then local D=ad.Y+3 if
|
||||
spaceAboveCharacter(C,D,l)then C.CFrame=C.CFrame+Vector3.new(0,D-C.CFrame.p.Y,0)
|
||||
else flashRedBox()return false end end end end elseif(not configFound)and not(q.
|
||||
Start and q.Adorn.Parent)then resetHighScalabilityLine()return false end if game
|
||||
:FindFirstChild'Players'then if game.Players['LocalPlayer']then if game.Players.
|
||||
LocalPlayer['Character']then local ae=game.Players.LocalPlayer.Character local A
|
||||
=ae:FindFirstChild'StampTracker'if A and not A.Value then A.Value=true end end
|
||||
end end if q.Start and q.Adorn.Parent and isMegaClusterPart()then if
|
||||
ResolveMegaClusterStamp(ab)or ab then l.CurrentParts.Parent=nil return true end
|
||||
end q.Start=nil q.Adorn.Parent=nil local ae=game.Workspace.Terrain if
|
||||
isMegaClusterPart()then local A if l.CurrentParts:IsA'Model'then A=ae:
|
||||
WorldToCell(l.CurrentParts:GetModelCFrame().p)else A=ae:WorldToCell(l.
|
||||
CurrentParts.CFrame.p)end local B,C=game.Workspace.Terrain.MaxExtents.Max,game.
|
||||
Workspace.Terrain.MaxExtents.Min if checkTerrainBlockCollisions(A,false)then
|
||||
local D,G,H=l.CurrentParts:FindFirstChild('ClusterMaterial',true),l.CurrentParts
|
||||
:FindFirstChild('WaterForceTag',true),l.CurrentParts:FindFirstChild(
|
||||
'WaterForceDirectionTag',true)if A.X>=C.X and A.Y>=C.Y and A.Z>=C.Z and A.X<B.X
|
||||
and A.Y<B.Y and A.Z<B.Z then if G then ae:SetWaterCell(A.X,A.Y,A.Z,Enum.
|
||||
WaterForce[G.Value],Enum.WaterDirection[H.Value])elseif not D then ae:SetCell(A.
|
||||
X,A.Y,A.Z,z.Material,z.clusterType,k%4)elseif D:IsA'Vector3Value'then ae:
|
||||
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.
|
||||
Value,0,0)end local I=false if l.CurrentParts:FindFirstChild'AutoWedge'then I=
|
||||
true end if I then game.Workspace.Terrain:AutowedgeCells(Region3int16.new(
|
||||
Vector3int16.new(A.x-1,A.y-1,A.z-1),Vector3int16.new(A.x+1,A.y+1,A.z+1)))end l.
|
||||
CurrentParts.Parent=nil pcall(function()game:GetService'ChangeHistoryService':
|
||||
SetWaypoint'StamperSingle'end)return true end else flashRedBox()return false end
|
||||
end local function getPlayer()if game:FindFirstChild'Players'then if game.
|
||||
Players['LocalPlayer']then return game.Players.LocalPlayer end end return nil
|
||||
end if l.CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then if l.
|
||||
CurrentParts:IsA'Model'then local A,B={},{}saveTheWelds(l.CurrentParts,A,B)l.
|
||||
CurrentParts:BreakJoints()l.CurrentParts:MakeJoints()restoreTheWelds(A,B)end
|
||||
playerIdTag=l.CurrentParts:FindFirstChild'PlayerIdTag'playerNameTag=l.
|
||||
CurrentParts:FindFirstChild'PlayerNameTag'if playerIdTag~=nil then
|
||||
tempPlayerValue=getPlayer()if tempPlayerValue~=nil then playerIdTag.Value=
|
||||
tempPlayerValue.userId end end if playerNameTag~=nil then if game:FindFirstChild
|
||||
'Players'and game.Players['LocalPlayer']then tempPlayerValue=game.Players.
|
||||
LocalPlayer if tempPlayerValue~=nil then playerNameTag.Value=tempPlayerValue.
|
||||
Name end end end if l.CurrentParts:FindFirstChild'RobloxModel'==nil then local A
|
||||
=Instance.new'BoolValue'A.Name='RobloxModel'A.Parent=l.CurrentParts if l.
|
||||
CurrentParts:FindFirstChild'RobloxStamper'==nil then local B=Instance.new
|
||||
'BoolValue'B.Name='RobloxStamper'B.Parent=l.CurrentParts end end else l.
|
||||
CurrentParts:BreakJoints()if l.CurrentParts:FindFirstChild'RobloxStamper'==nil
|
||||
then local A=Instance.new'BoolValue'A.Name='RobloxStamper'A.Parent=l.
|
||||
CurrentParts end end if not createJoints then game.JointsService:
|
||||
CreateJoinAfterMoveJoints()end for A,B in pairs(l.TransparencyTable)do A.
|
||||
Transparency=B end for C,D in pairs(l.ArchivableTable)do C.Archivable=D end for
|
||||
G,H in pairs(l.MaterialTable)do G.Material=H end for I,M in pairs(l.
|
||||
CanCollideTable)do I.CanCollide=M end for O,Q in pairs(l.AnchoredTable)do O.
|
||||
Anchored=Q end for R,S in pairs(l.DecalTransparencyTable)do R.Transparency=S end
|
||||
for T,U in pairs(l.SurfaceTypeTable)do loadSurfaceTypes(T,U)end if
|
||||
isMegaClusterPart()then l.CurrentParts.Transparency=0 end setSeatEnabledStatus(l
|
||||
.CurrentParts,true)l.TransparencyTable=nil l.ArchivableTable=nil l.MaterialTable
|
||||
=nil l.CanCollideTable=nil l.AnchoredTable=nil l.SurfaceTypeTable=nil if l.
|
||||
CurrentParts:FindFirstChild'RobloxModel'==nil then local V=Instance.new
|
||||
'BoolValue'V.Name='RobloxModel'V.Parent=l.CurrentParts end if ghostRemovalScript
|
||||
then ghostRemovalScript.Parent=nil end for V,W in pairs(l.DisabledScripts)do W.
|
||||
Disabled=false end for X,Y in pairs(l.DisabledScripts)do local Z=Y.Parent Y.
|
||||
Parent=nil Y:Clone().Parent=Z end l.DisabledScripts=nil l.Dragger=nil l.
|
||||
CurrentParts=nil pcall(function()game:GetService'ChangeHistoryService':
|
||||
SetWaypoint'StampedObject'end)return true end local function pauseStamper()for
|
||||
aa=1,#v do v[aa]:disconnect()v[aa]=nil end v={}if l and l.CurrentParts then l.
|
||||
CurrentParts.Parent=nil l.CurrentParts:Remove()end resetHighScalabilityLine()
|
||||
game.JointsService:ClearJoinAfterMoveJoints()end local function
|
||||
prepareUnjoinableSurfaces(aa,ab,ac)local ad,ae={Vector3.new(1,0,0),Vector3.new(0
|
||||
,1,0),Vector3.new(0,0,1)},1 if ac<0 then ae=ae*-1 ac=ac*-1 end local D=ae*aa:
|
||||
vectorToWorldSpace(ad[ac])for H=1,#ab do local M=ab[H]local Q=M.CFrame:
|
||||
vectorToObjectSpace(D)if math.abs(Q.X)>math.abs(Q.Y)then if math.abs(Q.X)>math.
|
||||
abs(Q.Z)then if Q.X>0 then M.RightSurface='Unjoinable'else M.LeftSurface=
|
||||
'Unjoinable'end else if Q.Z>0 then M.BackSurface='Unjoinable'else M.FrontSurface
|
||||
='Unjoinable'end end else if math.abs(Q.Y)>math.abs(Q.Z)then if Q.Y>0 then M.
|
||||
TopSurface='Unjoinable'else M.BottomSurface='Unjoinable'end else if Q.Z>0 then M
|
||||
.BackSurface='Unjoinable'else M.FrontSurface='Unjoinable'end end end end end
|
||||
local function resumeStamper()clone,parts=prepareModel(c)if not clone or not
|
||||
parts then return end local aa=clone:FindFirstChild('UnjoinableFaces',true)if aa
|
||||
then for ab in string.gmatch(aa.Value,'[^,]*')do if tonumber(ab)then if clone:
|
||||
IsA'Model'then prepareUnjoinableSurfaces(clone:GetModelCFrame(),parts,tonumber(
|
||||
ab))else prepareUnjoinableSurfaces(clone.CFrame,parts,tonumber(ab))end end end
|
||||
end l.ErrorBox=n if h then clone.Parent=h else clone.Parent=game.Workspace end
|
||||
if clone:FindFirstChild('ClusterMaterial',true)then clusterMaterial=clone:
|
||||
FindFirstChild('ClusterMaterial',true)if clusterMaterial:IsA'Vector3Value'then z
|
||||
.Material=clusterMaterial.Value.X z.clusterType=clusterMaterial.Value.Y z.
|
||||
clusterOrientation=clusterMaterial.Value.Z elseif clusterMaterial:IsA'IntValue'
|
||||
then z.Material=clusterMaterial.Value end end pcall(function()m=d.Target end)if
|
||||
m and m.Parent:FindFirstChild'RobloxModel'==nil then game.JointsService:
|
||||
SetJoinAfterMoveTarget(m)else game.JointsService:SetJoinAfterMoveTarget(nil)end
|
||||
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
|
||||
if not D then return false end local ay if ai then local az,aA=nil,N()if aA and
|
||||
D and D.Start and D.InternalLine and D.InternalLine.magnitude>0 then az=true ay=
|
||||
true else az,ay=a.CanEditRegion(y.CurrentParts,aj)end if not az then if w then
|
||||
w()end return false end end if H then ao()return false end local az az,ay=a.
|
||||
CanEditRegion(y.CurrentParts,aj)if not az then if w then w()end return false end
|
||||
local aA,aB aA,aB=q(y.CurrentParts)local aC,aD=v(ax,y)if aC and not D.Adorn.
|
||||
Parent then if h(aA+d,aB-d)then ao()return false end local aE=game.Workspace:
|
||||
FindPartsInRegion3(Region3.new(aA+d,aB-d),y.CurrentParts,100)for aF=1,#aE do if
|
||||
t(aE[aF])then ao()return false end end local aF={}for aG=1,#aE do if aE[aG].
|
||||
Parent and not aF[aE[aG].Parent]and aE[aG].Parent:FindFirstChild'Humanoid'and aE
|
||||
[aG].Parent:FindFirstChild'Humanoid':IsA'Humanoid'then local aH=aE[aG].Parent:
|
||||
FindFirstChild'Torso'aF[aE[aG].Parent]=true if aH then local aI=aB.Y+3 if u(aH,
|
||||
aI,y)then aH.CFrame=aH.CFrame+Vector3.new(0,aI-aH.CFrame.p.Y,0)else ao()return
|
||||
false end end end end elseif(not aC)and not(D.Start and D.Adorn.Parent)then al()
|
||||
return false end if game:FindFirstChild'Players'then if game.Players[
|
||||
'LocalPlayer']then if game.Players.LocalPlayer['Character']then local aE=game.
|
||||
Players.LocalPlayer.Character local aF=aE:FindFirstChild'StampTracker'if aF and
|
||||
not aF.Value then aF.Value=true end end end end if D.Start and D.Adorn.Parent
|
||||
and N()then if av(ay)or ay then y.CurrentParts.Parent=nil return true end end D.
|
||||
Start=nil D.Adorn.Parent=nil local aE=game.Workspace.Terrain if N()then local aF
|
||||
if y.CurrentParts:IsA'Model'then aF=aE:WorldToCell(y.CurrentParts:
|
||||
GetModelCFrame().p)else aF=aE:WorldToCell(y.CurrentParts.CFrame.p)end local aG,
|
||||
aH=game.Workspace.Terrain.MaxExtents.Max,game.Workspace.Terrain.MaxExtents.Min
|
||||
if au(aF,false)then local aI,aJ,aK=y.CurrentParts:FindFirstChild(
|
||||
'ClusterMaterial',true),y.CurrentParts:FindFirstChild('WaterForceTag',true),y.
|
||||
CurrentParts:FindFirstChild('WaterForceDirectionTag',true)if aF.X>=aH.X and aF.Y
|
||||
>=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
|
||||
aE:SetWaterCell(aF.X,aF.Y,aF.Z,Enum.WaterForce[aJ.Value],Enum.WaterDirection[aK.
|
||||
Value])elseif not aI then aE:SetCell(aF.X,aF.Y,aF.Z,M.Material,M.clusterType,x%4
|
||||
)elseif aI:IsA'Vector3Value'then aE:SetCell(aF.X,aF.Y,aF.Z,aI.Value.X,aI.Value.Y
|
||||
,aI.Value.Z)else aE:SetCell(aF.X,aF.Y,aF.Z,aI.Value,0,0)end local aL=false if y.
|
||||
CurrentParts:FindFirstChild'AutoWedge'then aL=true end if aL then game.Workspace
|
||||
.Terrain:AutowedgeCells(Region3int16.new(Vector3int16.new(aF.x-1,aF.y-1,aF.z-1),
|
||||
Vector3int16.new(aF.x+1,aF.y+1,aF.z+1)))end y.CurrentParts.Parent=nil pcall(
|
||||
function()return game:GetService'ChangeHistoryService':SetWaypoint
|
||||
'StamperSingle'end)return true end else ao()return false end end local aF aF=
|
||||
function()if game:FindFirstChild'Players'then if game.Players['LocalPlayer']then
|
||||
return game.Players.LocalPlayer end end return nil end if y.CurrentParts:IsA
|
||||
'Model'or y.CurrentParts:IsA'Tool'then if y.CurrentParts:IsA'Model'then local aG
|
||||
,aH={},{}ab(y.CurrentParts,aG,aH)y.CurrentParts:BreakJoints()y.CurrentParts:
|
||||
MakeJoints()ac(aG,aH)end local aG,aH=y.CurrentParts:FindFirstChild'PlayerIdTag',
|
||||
y.CurrentParts:FindFirstChild'PlayerNameTag'if(aG~=nil)then local aI=aF()if(aI~=
|
||||
nil)then aG.Value=aI.userId end end if(aH~=nil)then if game:FindFirstChild(game.
|
||||
Players['LocalPlayer'])then local aI=game.Players.LocalPlayer if(aI~=nil)then aH
|
||||
.Value=aI.Name end end end if not(y.CurrentParts:FindFirstChild'RobloxModel'~=
|
||||
nil)then local aI=Instance.new'BoolValue'aI.Name='RobloxModel'aI.Parent=y.
|
||||
CurrentParts if not(y.CurrentParts:FindFirstChild'RobloxStamper'~=nil)then local
|
||||
aJ=Instance.new'BoolValue'aJ.Name='RobloxStamper'aJ.Parent=y.CurrentParts end
|
||||
end else y.CurrentParts:BreakJoints()if not(y.CurrentParts:FindFirstChild
|
||||
'RobloxStamper'~=nil)then local aG=Instance.new'BoolValue'aG.Name=
|
||||
'RobloxStamper'aG.Parent=y.CurrentParts end end if not createJoints then game.
|
||||
JointsService:CreateJoinAfterMoveJoints()end for aG,aH in pairs(y.
|
||||
TransparencyTable)do aG.Transparency=aH end for aI,aJ in pairs(y.ArchivableTable
|
||||
)do aI.Archivable=aJ end for aK,aL in pairs(y.MaterialTable)do aK.Material=aL
|
||||
end for aM,aN in pairs(y.CanCollideTable)do aM.CanCollide=aN end for Q,R in
|
||||
pairs(y.AnchoredTable)do Q.Anchored=R end for S,U in pairs(y.
|
||||
DecalTransparencyTable)do S.Transparency=U end for W,X in pairs(y.
|
||||
SurfaceTypeTable)do aq(W,X)end if N()then y.CurrentParts.Transparency=0 end j(y.
|
||||
CurrentParts,true)y.TransparencyTable=nil y.ArchivableTable=nil y.MaterialTable=
|
||||
nil y.CanCollideTable=nil y.AnchoredTable=nil y.SurfaceTypeTable=nil if not(y.
|
||||
CurrentParts:FindFirstChild'RobloxModel'~=nil)then local Y=Instance.new
|
||||
'BoolValue'Y.Name='RobloxModel'Y.Parent=y.CurrentParts end if ghostRemovalScript
|
||||
then ghostRemovalScript.Parent=nil end for Y,aO in pairs(y.DisabledScripts)do aO
|
||||
.Disabled=false end for aP,aQ in pairs(y.DisabledScripts)do local aR=aQ.Parent
|
||||
aQ.Parent=nil aQ:Clone().Parent=aR end y.DisabledScripts=nil y.Dragger=nil y.
|
||||
CurrentParts=nil pcall(function()return game:GetService'ChangeHistoryService':
|
||||
SetWaypoint'StampedObject'end)return true end local ax ax=function()for ay=1,#I
|
||||
do I[ay]:disconnect()I[ay]=nil end I={}if y and y.CurrentParts then y.
|
||||
CurrentParts.Parent=nil y.CurrentParts:Remove()end al()return game.JointsService
|
||||
:ClearJoinAfterMoveJoints()end local ay ay=function(az,aA,aB)local aC,aD={
|
||||
Vector3.new(1,0,0),Vector3.new(0,1,0),Vector3.new(0,0,1)},1 if aB<0 then aD=aD*(
|
||||
-1)aB=aB*(-1)end local aE=aD*az:vectorToWorldSpace(aC[aB])for aF=1,#aA do local
|
||||
aJ=aA[aF]local aL=aJ.CFrame:vectorToObjectSpace(aE)if math.abs(aL.X)>math.abs(aL
|
||||
.Y)then if math.abs(aL.X)>math.abs(aL.Z)then if aL.X>0 then aJ.RightSurface=
|
||||
'Unjoinable'else aJ.LeftSurface='Unjoinable'end else if aL.Z>0 then aJ.
|
||||
BackSurface='Unjoinable'else aJ.FrontSurface='Unjoinable'end end else if math.
|
||||
abs(aL.Y)>math.abs(aL.Z)then if aL.Y>0 then aJ.TopSurface='Unjoinable'else aJ.
|
||||
BottomSurface='Unjoinable'end else if aL.Z>0 then aJ.BackSurface='Unjoinable'
|
||||
else aJ.FrontSurface='Unjoinable'end end end end end local az az=function()local
|
||||
aA,aB=at(ad)if not aA or not aB then return end local aC=aA:FindFirstChild(
|
||||
'UnjoinableFaces',true)if aC then for aD in string.gmatch(aC.Value,'[^,]*')do if
|
||||
tonumber(aD)then if aA:IsA'Model'then ay(aA:GetModelCFrame(),aB,tonumber(aD))
|
||||
else ay(aA.CFrame,aB,tonumber(aD))end end end end y.ErrorBox=A if ai then aA.
|
||||
Parent=ai else aA.Parent=game.Workspace end if aA:FindFirstChild(
|
||||
'ClusterMaterial',true)then local aD=aA:FindFirstChild('ClusterMaterial',true)if
|
||||
aD:IsA'Vector3Value'then M.Material=aD.Value.X M.clusterType=aD.Value.Y M.
|
||||
clusterOrientation=aD.Value.Z elseif aD:IsA'IntValue'then M.Material=aD.Value
|
||||
end end pcall(function()z=ae.Target end)if z and not(z.Parent:FindFirstChild
|
||||
'RobloxModel'~=nil)then game.JointsService:SetJoinAfterMoveTarget(z)else game.
|
||||
JointsService:SetJoinAfterMoveTarget(nil)end game.JointsService:
|
||||
ShowPermissibleJoints()for aD,aE in pairs(y.DisabledScripts)do if aE.Name==
|
||||
'GhostRemovalScript'then aE.Parent=y.CurrentParts end end y.Dragger=Instance.new
|
||||
'Dragger'y.Dragger:MouseDown(aB[1],Vector3.new(0,0,0,aB))y.Dragger:MouseUp()P(ae
|
||||
)table.insert(I,ae.Move:connect(function()if F or G then return end F=true P(ae)
|
||||
F=false end))table.insert(I,ae.Button1Down:connect(function()return ap(ae)end))
|
||||
table.insert(I,ae.Button1Up:connect(function()G=true while F do wait()end K.
|
||||
Value=aw(ae)al()G=false end))K.Value=false end local aA aA=function(aB)if aB
|
||||
then if not aB:IsA'Model'and not aB:IsA'BasePart'then error
|
||||
[[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.
|
||||
Paused=false r.LoadNewModel=function(aa)if aa and not aa:IsA'Model'and not aa:
|
||||
IsA'BasePart'then error
|
||||
end ad=aB end ax()return az()end aA()E.Stamped=K E.Paused=false E.LoadNewModel=
|
||||
function(aB)if aB and not aB:IsA'Model'and not aB:IsA'BasePart'then error
|
||||
[[Control.LoadNewModel: newStampModel (first arg) is not a Model or Part!]]
|
||||
return nil end resetStamperState(aa)end r.ReloadModel=function()
|
||||
resetStamperState()end r.Pause=function()if not r.Paused then pauseStamper()r.
|
||||
Paused=true else print
|
||||
[[RbxStamper Warning: Tried to call Control.Pause() when already paused]]end end
|
||||
r.Resume=function()if r.Paused then resumeStamper()r.Paused=false else print
|
||||
[[RbxStamper Warning: Tried to call Control.Resume() without Pausing First]]end
|
||||
end r.ResetRotation=function()end r.Destroy=function()for aa=1,#v do v[aa]:
|
||||
disconnect()v[aa]=nil end if w then w:disconnect()end game.JointsService:
|
||||
ClearJoinAfterMoveJoints()if p then p:Destroy()end if o then o:Destroy()end if n
|
||||
then n:Destroy()end if l then if l['Dragger']then l.Dragger:Destroy()end if l.
|
||||
CurrentParts then l.CurrentParts:Destroy()end end if r and r['Stamped']then r.
|
||||
Stamped:Destroy()end r=nil end return r end a.Help=function(aa)if aa==
|
||||
'GetStampModel'or aa==a.GetStampModel then return
|
||||
return nil end return aA(aB)end E.ReloadModel=function()return aA()end E.Pause=
|
||||
function()if not E.Paused then ax()E.Paused=true else return print
|
||||
[[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
|
||||
[[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]:
|
||||
disconnect()I[aB]=nil end if J~=nil then J:disconnect()end game.JointsService:
|
||||
ClearJoinAfterMoveJoints()if C~=nil then C:Destroy()end if B~=nil then B:
|
||||
Destroy()end if A~=nil then A:Destroy()end if y~=nil then do local aB=y.Dragger
|
||||
if aB~=nil then aB:Destroy()end end end if y~=nil then do local aB=y.
|
||||
CurrentParts if aB~=nil then aB:Destroy()end end end if E and E['Stamped']then E
|
||||
.Stamped:Destroy()end E=nil end return E end a.Help=function(ad)if
|
||||
'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]]
|
||||
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.]]
|
||||
end end return a
|
||||
|
|
@ -1,189 +1,181 @@
|
|||
local function waitForChild(a,b)assert(a)assert(b)while not a:FindFirstChild(b)
|
||||
do print('Waiting for ...',a,b)a.ChildAdded:wait()end return a:FindFirstChild(b)
|
||||
end local function waitForProperty(a,b)assert(a)assert(b)while not a[b]do a.
|
||||
Changed:wait()end end local function IsTouchDevice()local a=false pcall(function
|
||||
()a=Game:GetService'UserInputService'.TouchEnabled end)return a end
|
||||
waitForChild(game,'Players')waitForProperty(game.Players,'LocalPlayer')local a,b
|
||||
,c=game.Players.LocalPlayer,LoadLibrary'RbxGui'if not b then print
|
||||
'could not find RbxGui!'return end local d,e,f,g,h,i,j,k,l,m,n,o='gear',script.
|
||||
Parent,{},{},false,false,{},{},nil,nil,nil,waitForChild(a,'Backpack')
|
||||
waitForChild(e,'Tabs')waitForChild(e,'Gear')local p,q,r,s=waitForChild(e.Gear,
|
||||
'GearPreview'),waitForChild(e.Gear,'GearGridScrollingArea'),waitForChild(e.
|
||||
Parent,'CurrentLoadout'),waitForChild(e.Gear,'GearGrid')local t,u,v=
|
||||
waitForChild(s,'GearButton'),waitForChild(script.Parent,'SwapSlot'),
|
||||
waitForChild(script.Parent,'CoreScripts/BackpackScripts/BackpackManager')local w
|
||||
,x,y,z,A,B,C,D,E,F=waitForChild(v,'BackpackOpenEvent'),waitForChild(v,
|
||||
'BackpackCloseEvent'),waitForChild(v,'TabClickedEvent'),waitForChild(v,
|
||||
'ResizeEvent'),waitForChild(v,'SearchRequestedEvent'),waitForChild(v,
|
||||
'BackpackReady'),b.CreateScrollingFrame(nil,'grid',Vector2.new(6,6))C.Position=
|
||||
UDim2.new(0,0,0,30)C.Size=UDim2.new(1,0,1,-30)C.Parent=e.Gear.GearGrid local G=
|
||||
Instance.new'Frame'G.Name='ScrollBar'G.BackgroundTransparency=0.9 G.
|
||||
BackgroundColor3=Color3.new(1,1,1)G.BorderSizePixel=0 G.Size=UDim2.new(0,17,1,-
|
||||
36)G.Position=UDim2.new(0,0,0,18)G.Parent=q E.Position=UDim2.new(0,0,1,-17)D.
|
||||
Parent=q E.Parent=q local H,I,J,K=b.CreateScrollingFrame()H.Position=UDim2.new(0
|
||||
,0,0,0)H.Size=UDim2.new(1,0,1,0)H.Parent=e.Gear.GearLoadouts.LoadoutsList local
|
||||
L=Instance.new'TextButton'L.RobloxLocked=true L.Name='LoadoutButton'L.Font=Enum.
|
||||
Font.ArialBold L.FontSize=Enum.FontSize.Size14 L.Position=UDim2.new(0,0,0,0)L.
|
||||
Size=UDim2.new(1,0,0,32)L.Style=Enum.ButtonStyle.RobloxButton L.Text=
|
||||
'Loadout #1'L.TextColor3=Color3.new(1,1,1)L.Parent=H local M=L:clone()M.Text=
|
||||
'Loadout #2'M.Parent=H local N=L:clone()N.Text='Loadout #3'N.Parent=H local O=L:
|
||||
clone()O.Text='Loadout #4'O.Parent=H local P=Instance.new'Frame'P.Name=
|
||||
'ScrollBarLoadout'P.BackgroundTransparency=0.9 P.BackgroundColor3=Color3.new(1,1
|
||||
,1)P.BorderSizePixel=0 P.Size=UDim2.new(0,17,1,-36)P.Position=UDim2.new(0,0,0,18
|
||||
)P.Parent=e.Gear.GearLoadouts.GearLoadoutsScrollingArea J.Position=UDim2.new(0,0
|
||||
,1,-17)I.Parent=e.Gear.GearLoadouts.GearLoadoutsScrollingArea J.Parent=e.Gear.
|
||||
GearLoadouts.GearLoadoutsScrollingArea function removeFromMap(Q,R)for S=1,#Q do
|
||||
if Q[S]==R then table.remove(Q,S)break end end end function robloxLock(Q)Q.
|
||||
RobloxLocked=true children=Q:GetChildren()if children then for R,S in ipairs(
|
||||
children)do robloxLock(S)end end end function resize()local Q=0 if p.
|
||||
AbsoluteSize.Y>p.AbsoluteSize.X then Q=p.AbsoluteSize.X*0.75 else Q=p.
|
||||
AbsoluteSize.Y*0.75 end waitForChild(p,'GearImage')p.GearImage.Size=UDim2.new(0,
|
||||
Q,0,Q)p.GearImage.Position=UDim2.new(0,p.AbsoluteSize.X/2-Q/2,0.75,-Q)
|
||||
resizeGrid()end function addToGrid(Q)if not Q:IsA'Tool'then if not Q:IsA
|
||||
'HopperBin'then return end end if Q:FindFirstChild'RobloxBuildTool'then return
|
||||
end for R,S in pairs(f)do if S==Q then return end end table.insert(f,Q)local T,U
|
||||
=Q.Changed:connect(function(T)if T=='Name'then if g[Q]then if g[Q].Image==''then
|
||||
g[Q].GearText.Text=Q.Name end end end end),nil U=Q.AncestryChanged:connect(
|
||||
function(V,W)local X=nil for Y,Z in pairs(f)do if Z==Q then X=Z break end end
|
||||
waitForProperty(a,'Character')waitForChild(a,'Backpack')if Q.Parent~=a.Backpack
|
||||
and Q.Parent~=a.Character then if U then U:disconnect()end if T then T:
|
||||
disconnect()end for _,aa in pairs(f)do if aa==X then if j[g[aa]]then j[g[aa]]:
|
||||
disconnect()end if k[g[aa]]then k[g[aa]]:disconnect()end g[aa].Parent=nil g[aa]=
|
||||
nil break end end removeFromMap(f,X)resizeGrid()else resizeGrid()end
|
||||
updateGridActive()end)resizeGrid()end function buttonClick(aa)if aa:
|
||||
FindFirstChild'UnequipContextMenu'and not aa.Active then aa.UnequipContextMenu.
|
||||
Visible=true i=true end end function previewGear(aa)if not i then p.Visible=
|
||||
false p.GearImage.Image=aa.Image p.GearStats.GearName.Text=aa.GearReference.
|
||||
Value.Name end end function findEmptySlot()local aa,Q=nil,r:GetChildren()for R=1
|
||||
,#Q do if Q[R]:IsA'Frame'and#Q[R]:GetChildren()<=0 then local S=tonumber(string.
|
||||
sub(Q[R].Name,5))if S==0 then S=10 end if not aa or(aa>S)then aa=S end end end
|
||||
if aa==10 then aa=0 end return aa end function checkForSwap(aa,Q,R)local S=r:
|
||||
GetChildren()for T=1,#S do if S[T]:IsA'Frame'and string.find(S[T].Name,'Slot')
|
||||
then if Q>=S[T].AbsolutePosition.x and Q<=(S[T].AbsolutePosition.x+S[T].
|
||||
AbsoluteSize.x)then if R>=S[T].AbsolutePosition.y and R<=(S[T].AbsolutePosition.
|
||||
y+S[T].AbsoluteSize.y)then local U=tonumber(string.sub(S[T].Name,5))
|
||||
swapGearSlot(U,aa)return true end end end end return false end function
|
||||
resizeGrid()for aa,Q in pairs(f)do if not Q:FindFirstChild'RobloxBuildTool'then
|
||||
if not g[Q]then local R=t:clone()R.Parent=s.ScrollingFrame R.Visible=true R.
|
||||
Image=Q.TextureId if R.Image==''then R.GearText.Text=Q.Name end R.GearReference.
|
||||
Value=Q R.Draggable=true g[Q]=R if not IsTouchDevice()then local S=
|
||||
getGearContextMenu()S.Visible=false S.Parent=R end local S=nil R.DragBegin:
|
||||
connect(function(T)waitForChild(R,'Background')R['Background'].ZIndex=10 R.
|
||||
ZIndex=10 S=T end)R.DragStopped:connect(function(T,U)waitForChild(R,'Background'
|
||||
)R['Background'].ZIndex=1 R.ZIndex=2 if S~=R.Position then if not checkForSwap(R
|
||||
,T,U)then R:TweenPosition(S,Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.5,
|
||||
true)R.Draggable=false delay(0.5,function()R.Draggable=true end)else R.Position=
|
||||
S end end end)local T=tick()j[R]=R.MouseEnter:connect(function()previewGear(R)
|
||||
end)k[R]=R.MouseButton1Click:connect(function()local U=tick()if R.Active and(U-T
|
||||
)<0.5 then local W=findEmptySlot()if W then R.ZIndex=1 swapGearSlot(W,R)end else
|
||||
buttonClick(R)end T=U end)end end end F()end function showPartialGrid(aa)for Q,R
|
||||
in pairs(g)do R.Parent=nil end if aa then for S,T in pairs(aa)do T.Parent=s.
|
||||
ScrollingFrame end end F()end function showEntireGrid()for aa,Q in pairs(g)do Q.
|
||||
Parent=s.ScrollingFrame end F()end function inLoadout(aa)local Q=r:GetChildren()
|
||||
for R=1,#Q do if Q[R]:IsA'Frame'then local S=Q[R]:GetChildren()if#S>0 then if S[
|
||||
1].GearReference.Value and S[1].GearReference.Value==aa then return true end end
|
||||
end end return false end function updateGridActive()for aa,Q in pairs(f)do if g[
|
||||
Q]then local R,S=nil,g[Q]:FindFirstChild'GearReference'if S then R=S.Value end
|
||||
if(not R)or inLoadout(R)then g[Q].Active=false else g[Q].Active=true end end end
|
||||
end function centerGear(aa)local Q,R={},nil for S=1,#aa do if aa[S]:IsA'Frame'
|
||||
and#aa[S]:GetChildren()>0 then if aa[S].Name=='Slot0'then R=aa[S]else table.
|
||||
insert(Q,aa[S])end end end if R then table.insert(Q,R)end local S=(1-(#Q*0.1))/2
|
||||
for T=1,#Q do Q[T]:TweenPosition(UDim2.new(S+((T-1)*0.1),0,0,0),Enum.
|
||||
EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end function
|
||||
tabClickHandler(aa)if aa==d then backpackOpenHandler(aa)else
|
||||
backpackCloseHandler(aa)end end function backpackOpenHandler(aa)if aa and aa~=d
|
||||
then e.Gear.Visible=false return end e.Gear.Visible=true updateGridActive()
|
||||
resizeGrid()resize()B:Invoke()end function backpackCloseHandler(aa)if aa and aa
|
||||
~=d then e.Gear.Visible=false return end e.Gear.Visible=false resizeGrid()
|
||||
resize()B:Invoke()end function loadoutCheck(aa,Q)if not aa:IsA'ImageButton'then
|
||||
return end for R,S in pairs(f)do if g[S]then if aa:FindFirstChild'GearReference'
|
||||
and g[S]:FindFirstChild'GearReference'then if g[S].GearReference.Value==aa.
|
||||
GearReference.Value then g[S].Active=Q break end end end end end function
|
||||
clearPreview()p.GearImage.Image=''p.GearStats.GearName.Text=''end function
|
||||
unequipGear(aa)aa.Parent=o updateGridActive()end function highlight(aa)aa.
|
||||
TextColor3=Color3.new(0,0,0)aa.BackgroundColor3=Color3.new(0.8,0.8,0.8)end
|
||||
function clearHighlight(aa)aa.TextColor3=Color3.new(1,1,1)aa.BackgroundColor3=
|
||||
Color3.new(0,0,0)end function swapGearSlot(aa,Q)if not u.Value then u.Slot.Value
|
||||
=aa u.GearButton.Value=Q u.Value=true updateGridActive()end end local aa=
|
||||
function(aa,Q)if type(aa.Action)~='number'then return end local R=aa.Action if R
|
||||
==1 then unequipGear(Q.Parent.GearReference.Value)local S=Q.Parent local T,U,W=S
|
||||
.GearReference.Value,r:GetChildren(),-1 for X=1,#U do if U[X]:IsA'Frame'then
|
||||
local Y=U[X]:GetChildren()if Y[1]and Y[1].GearReference.Value==T then W=Y[1].
|
||||
SlotNumber.Text break end end end swapGearSlot(W,nil)end end function
|
||||
setupCharacterConnections()if n then n:disconnect()end n=game.Players.
|
||||
LocalPlayer.Backpack.ChildAdded:connect(function(Q)addToGrid(Q)end)local Q=game.
|
||||
Players.LocalPlayer.Backpack:GetChildren()for R=1,#Q do addToGrid(Q[R])end if l
|
||||
then l:disconnect()end l=game.Players.LocalPlayer.Character.ChildAdded:connect(
|
||||
function(R)addToGrid(R)updateGridActive()end)if m then m:disconnect()end m=game.
|
||||
Players.LocalPlayer.Character.ChildRemoved:connect(function(R)updateGridActive()
|
||||
end)wait()centerGear(r:GetChildren())end function removeCharacterConnections()if
|
||||
l then l:disconnect()end if m then m:disconnect()end if n then n:disconnect()end
|
||||
end function trim(Q)return(Q:gsub('^%s*(.-)%s*$','%1'))end function filterGear(Q
|
||||
)local R={}for S,T in pairs(f)do if g[T]then local U=string.lower(g[T].
|
||||
GearReference.Value.Name)U=trim(U)for W=1,#Q do if string.match(U,Q[W])then
|
||||
table.insert(R,g[T])break end end end end return R end function
|
||||
splitByWhitespace(Q)if type(Q)~='string'then return nil end local R={}for S in
|
||||
string.gmatch(Q,'[^%s]+')do if string.len(S)>0 then table.insert(R,S)end end
|
||||
return R end function showSearchGear(Q)if not e.Gear.Visible then return end
|
||||
local R,S=splitByWhitespace(Q),nil if R and(#R>0)then S=R else S=nil end if R==
|
||||
nil then showEntireGrid()return end local T=filterGear(S)showPartialGrid(T)end
|
||||
function nukeBackpack()while#g>0 do table.remove(g)end g={}while#f>0 do table.
|
||||
remove(f)end f={}local Q=s.ScrollingFrame:GetChildren()for R=1,#Q do Q[R]:
|
||||
remove()end end function getGearContextMenu()local Q=Instance.new'Frame'Q.Active
|
||||
=true Q.Name='UnequipContextMenu'Q.Size=UDim2.new(0,115,0,70)Q.Position=UDim2.
|
||||
new(0,-16,0,-16)Q.BackgroundTransparency=1 Q.Visible=false local R=Instance.new
|
||||
'TextButton'R.Name='UnequipContextMenuButton'R.Text=''R.Style=Enum.ButtonStyle.
|
||||
RobloxButtonDefault R.ZIndex=8 R.Size=UDim2.new(1,0,1,-20)R.Visible=true R.
|
||||
Parent=Q local S,T,U=12,{},{'Remove Hotkey'}for W=1,#U do local X={}X.Type=
|
||||
'Button'X.Text=U[W]X.Action=W X.DoIt=aa table.insert(T,X)end for W,X in ipairs(T
|
||||
)do local Y=X if Y.Type=='Button'then local Z=Instance.new'TextButton'Z.Name=
|
||||
'UnequipContextButton'..W Z.BackgroundColor3=Color3.new(0,0,0)Z.BorderSizePixel=
|
||||
0 Z.TextXAlignment=Enum.TextXAlignment.Left Z.Text=' '..X.Text Z.Font=Enum.Font.
|
||||
Arial Z.FontSize=Enum.FontSize.Size14 Z.Size=UDim2.new(1,8,0,S)Z.Position=UDim2.
|
||||
new(0,0,0,S*W)Z.TextColor3=Color3.new(1,1,1)Z.ZIndex=9 Z.Parent=R if not
|
||||
IsTouchDevice()then Z.MouseButton1Click:connect(function()if Z.Active and not Q.
|
||||
Parent.Active then pcall(function()Y.DoIt(Y,Q)end)i=false Q.Visible=false
|
||||
clearHighlight(Z)clearPreview()end end)Z.MouseEnter:connect(function()if Z.
|
||||
Active and Q.Parent.Active then highlight(Z)end end)Z.MouseLeave:connect(
|
||||
function()if Z.Active and Q.Parent.Active then clearHighlight(Z)end end)end X.
|
||||
Button=Z X.Element=Z elseif Y.Type=='Label'then local Z=Instance.new'Frame'Z.
|
||||
Name='ContextLabel'..W Z.BackgroundTransparency=1 Z.Size=UDim2.new(1,8,0,S)local
|
||||
_=Instance.new'TextLabel'_.Name='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 _.Parent=Z Y.Label1=_ if Y.GetText2 then _=Instance.new
|
||||
'TextLabel'_.Name='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=Z Y.
|
||||
Label2=_ end Z.Parent=R Y.Label=Z Y.Element=Z end end Q.ZIndex=4 Q.MouseLeave:
|
||||
connect(function()i=false Q.Visible=false clearPreview()end)robloxLock(Q)return
|
||||
Q end function coreGuiChanged(Q,R)if Q==Enum.CoreGuiType.Backpack or Q==Enum.
|
||||
CoreGuiType.All then if not R then e.Gear.Visible=false end end end local Q=a.
|
||||
Backpack:GetChildren()for R=1,#Q do addToGrid(Q[R])end z.Event:connect(function(
|
||||
R)if h then return end h=true wait()resize()resizeGrid()h=false end)r.ChildAdded
|
||||
:connect(function(R)loadoutCheck(R,false)end)r.ChildRemoved:connect(function(R)
|
||||
loadoutCheck(R,true)end)r.DescendantAdded:connect(function(R)if not e.Visible
|
||||
and(R:IsA'ImageButton'or R:IsA'TextButton')then centerGear(r:GetChildren())end
|
||||
end)r.DescendantRemoving:connect(function(R)if not e.Visible and(R:IsA
|
||||
'ImageButton'or R:IsA'TextButton')then wait()centerGear(r:GetChildren())end end)
|
||||
s.MouseEnter:connect(function()clearPreview()end)s.MouseLeave:connect(function()
|
||||
clearPreview()end)a.CharacterRemoving:connect(function()
|
||||
removeCharacterConnections()nukeBackpack()end)a.CharacterAdded:connect(function(
|
||||
)setupCharacterConnections()end)a.ChildAdded:connect(function(R)if R:IsA
|
||||
'Backpack'then o=R if n then n:disconnect()end n=game.Players.LocalPlayer.
|
||||
Backpack.ChildAdded:connect(function(S)addToGrid(S)end)end end)u.Changed:
|
||||
connect(function()if not u.Value then updateGridActive()end end)local R=r:
|
||||
GetChildren()for S=1,#R do if R[S]:IsA'Frame'and string.find(R[S].Name,'Slot')
|
||||
then R[S].ChildRemoved:connect(function()updateGridActive()end)R[S].ChildAdded:
|
||||
connect(function()updateGridActive()end)end end pcall(function()coreGuiChanged(
|
||||
Enum.CoreGuiType.Backpack,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.
|
||||
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()
|
||||
local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e=a(b)if c then
|
||||
e.Name=c end local f for g,h in pairs(d)do if type(g)=='string'then if g==
|
||||
'Parent'then f=h else e[g]=h end elseif type(g)=='number'and type(h)=='userdata'
|
||||
then h.Parent=e end end e.Parent=f return e end local b b=function(c,d)assert(c)
|
||||
assert(d)while not c:FindFirstChild(d)do print('Waiting for ...',c,d)c.
|
||||
ChildAdded:wait()end return c:FindFirstChild(d)end local c c=function(d,e)
|
||||
assert(d)assert(e)while not d[e]do d.Changed:wait()end end local d d=function()
|
||||
local e=false pcall(function()e=Game:GetService'UserInputService'.TouchEnabled
|
||||
end)return e end b(game,'Players')c(game.Players,'LocalPlayer')local e,f,g=game.
|
||||
Players.LocalPlayer,nil,nil f,g=LoadLibrary'RbxGui'if not f then print
|
||||
'could not find RbxGui!'return end local h,i,j,k,l,m,n,o,p,q,r,s='gear',script.
|
||||
Parent,{},{},false,false,{},{},nil,nil,nil,b(e,'Backpack')b(i,'Tabs')b(i,'Gear')
|
||||
local t,u,v,w=b(i.Gear,'GearPreview'),b(i.Gear,'GearGridScrollingArea'),b(i.
|
||||
Parent,'CurrentLoadout'),b(i.Gear,'GearGrid')local x,y,z=b(w,'GearButton'),b(
|
||||
script.Parent,'SwapSlot'),b(script.Parent,
|
||||
'CoreScripts/BackpackScripts/BackpackManager')local A,B,C,D,E,F,G,H,I,J=b(z,
|
||||
'BackpackOpenEvent'),b(z,'BackpackCloseEvent'),b(z,'TabClickedEvent'),b(z,
|
||||
'ResizeEvent'),b(z,'SearchRequestedEvent'),b(z,'BackpackReady'),nil,nil,nil,nil
|
||||
G,H,I,J=f.CreateScrollingFrame(nil,'grid',Vector2.new(6,6))G.Position=UDim2.new(
|
||||
0,0,0,30)G.Size=UDim2.new(1,0,1,-30)G.Parent=i.Gear.GearGrid local K=a('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
|
||||
=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
|
||||
.CreateScrollingFrame()L.Position=UDim2.new(0,0,0,0)L.Size=UDim2.new(1,0,1,0)L.
|
||||
Parent=i.Gear.GearLoadouts.LoadoutsList local P=a('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=L})do local Q
|
||||
=P:clone()Q.Text='Loadout #2'Q.Parent=L end do local Q=P:clone()Q.Text=
|
||||
'Loadout #3'Q.Parent=L end do local Q=P:clone()Q.Text='Loadout #4'Q.Parent=L end
|
||||
a('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=i.Gear.GearLoadouts.GearLoadoutsScrollingArea})N.Position=UDim2.
|
||||
new(0,0,1,-17)M.Parent=i.Gear.GearLoadouts.GearLoadoutsScrollingArea N.Parent=i.
|
||||
Gear.GearLoadouts.GearLoadoutsScrollingArea local Q Q=function(R,S)for T=1,#R do
|
||||
if R[T]==S then table.remove(R,T)break end end end local R R=function(S)S.
|
||||
RobloxLocked=true local T=S:GetChildren()if T then for U,V in ipairs(T)do R(V)
|
||||
end end end local S S=function()t.GearImage.Image=''t.GearStats.GearName.Text=''
|
||||
end local T T=function(U)U.TextColor3=Color3.new(1,1,1)U.BackgroundColor3=Color3
|
||||
.new(0,0,0)end local U U=function(V)local W=v:GetChildren()for X=1,#W do if W[X]
|
||||
:IsA'Frame'then local Y=W[X]:GetChildren()if#Y>0 and Y[1].GearReference.Value
|
||||
and Y[1].GearReference.Value==V then return true end end end return false end
|
||||
local V V=function()for W,X in pairs(j)do if k[X]then local Y,Z=nil,k[X]:
|
||||
FindFirstChild'GearReference'if Z then Y=Z.Value end if(not Y)or U(Y)then k[X].
|
||||
Active=false else k[X].Active=true end end end end local W W=function(X,Y)if not
|
||||
y.Value then y.Slot.Value=X y.GearButton.Value=Y y.Value=true return V()end end
|
||||
local X X=function(Y)Y.Parent=s return V()end local Y Y=function(Z,_)if type(Z.
|
||||
Action)~='number'then return end local aa=Z.Action if aa==1 then X(_.Parent.
|
||||
GearReference.Value)local ab=_.Parent local ac,ad,ae=ab.GearReference.Value,v:
|
||||
GetChildren(),-1 for af=1,#ad do if ad[af]:IsA'Frame'then local ag=ad[af]:
|
||||
GetChildren()if ag[1]and ag[1].GearReference.Value==ac then ae=ag[1].SlotNumber.
|
||||
Text break end end end return W(ae,nil)end end local aa aa=function(ab)ab.
|
||||
TextColor3=Color3.new(0,0,0)ab.BackgroundColor3=Color3.new(0.8,0.8,0.8)end local
|
||||
ab ab=function()local ac=a('Frame','UnequipContextMenu',{Active=true,Size=UDim2.
|
||||
new(0,115,0,70),Position=UDim2.new(0,-16,0,-16),BackgroundTransparency=1,Visible
|
||||
=false})local ad,ae,af,ag=a('TextButton','UnequipContextMenuButton',{Text='',
|
||||
Style=Enum.ButtonStyle.RobloxButtonDefault,ZIndex=8,Size=UDim2.new(1,0,1,-20),
|
||||
Visible=true,Parent=ac}),12,{},{'Remove Hotkey'}for Z=1,#ag do local _={}_.Type=
|
||||
'Button'_.Text=ag[Z]_.Action=Z _.DoIt=Y table.insert(af,_)end for Z,_ in ipairs(
|
||||
af)do local ah=_ if ah.Type=='Button'then local ai=a('TextButton',
|
||||
'UnequipContextButton'..tostring(Z),{BackgroundColor3=Color3.new(0,0,0),
|
||||
BorderSizePixel=0,TextXAlignment=Enum.TextXAlignment.Left,Text=' '..tostring(_.
|
||||
Text),Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,Size=UDim2.new(1,8,0,ae
|
||||
),Position=UDim2.new(0,0,0,ae*Z),TextColor3=Color3.new(1,1,1),ZIndex=9,Parent=ad
|
||||
})if not d()then ai.MouseButton1Click:connect(function()if ai.Active and not ac.
|
||||
Parent.Active then pcall(function()return ah.DoIt(ah,ac)end)m=false ac.Visible=
|
||||
false T(ai)return S()end end)ai.MouseEnter:connect(function()if ai.Active and ac
|
||||
.Parent.Active then return aa(ai)end end)ai.MouseLeave:connect(function()if ai.
|
||||
Active and ac.Parent.Active then return T(ai)end end)end _.Button=ai _.Element=
|
||||
ai elseif ah.Type=='Label'then local ai=a('Frame','ContextLabel'..tostring(Z),{
|
||||
BackgroundTransparency=1,Size=UDim2.new(1,8,0,ae),a('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})})ah.Label1=ai.Text1 if ah.GetText2 then ah.Label2=
|
||||
a('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=ai})end ai.Parent=ad
|
||||
ah.Label=ai ah.Element=ai end end ac.ZIndex=4 ac.MouseLeave:connect(function()m=
|
||||
false ac.Visible=false return S()end)R(ac)return ac end local ac ac=function()
|
||||
local ad,ae=nil,v:GetChildren()for af=1,#ae do if ae[af]:IsA'Frame'and#ae[af]:
|
||||
GetChildren()<=0 then local ag=tonumber(string.sub(ae[af].Name,5))if ag==0 then
|
||||
ag=10 end if not ad or(ad>ag)then ad=ag end end end if ad==10 then ad=0 end
|
||||
return ad end local ad ad=function(ae,af,ag)local ah=v:GetChildren()for ai=1,#ah
|
||||
do if ah[ai]:IsA'Frame'and string.find(ah[ai].Name,'Slot')then if af>=ah[ai].
|
||||
AbsolutePosition.x and af<=(ah[ai].AbsolutePosition.x+ah[ai].AbsoluteSize.x)then
|
||||
if ag>=ah[ai].AbsolutePosition.y and ag<=(ah[ai].AbsolutePosition.y+ah[ai].
|
||||
AbsoluteSize.y)then local Z=tonumber(string.sub(ah[ai].Name,5))W(Z,ae)return
|
||||
true end end end end return false end local ae ae=function(af)if not m then t.
|
||||
Visible=false t.GearImage.Image=af.Image t.GearStats.GearName.Text=af.
|
||||
GearReference.Value.Name end end local af af=function(ag)if ag:FindFirstChild(
|
||||
not ag.Active)then ag.UnequipContextMenu.Visible=true m=true end end local ag ag
|
||||
=function()for ah,ai in pairs(j)do if not ai:FindFirstChild'RobloxBuildTool'then
|
||||
if not k[ai]then local Z=x:clone()Z.Parent=w.ScrollingFrame Z.Visible=true Z.
|
||||
Image=ai.TextureId if Z.Image==''then Z.GearText.Text=ai.Name end Z.
|
||||
GearReference.Value=ai Z.Draggable=true k[ai]=Z if not d()then local _=ab()_.
|
||||
Visible=false _.Parent=Z end local _ Z.DragBegin:connect(function(aj)b(Z,
|
||||
'Background')Z['Background'].ZIndex=10 Z.ZIndex=10 _=aj end)Z.DragStopped:
|
||||
connect(function(aj,ak)b(Z,'Background')Z['Background'].ZIndex=1 Z.ZIndex=2 if _
|
||||
~=Z.Position then if not ad(Z,aj,ak)then Z:TweenPosition(_,Enum.EasingDirection.
|
||||
Out,Enum.EasingStyle.Quad,0.5,true)Z.Draggable=false return delay(0.5,function()
|
||||
Z.Draggable=true end)else Z.Position=_ end end end)local aj=tick()n[Z]=Z.
|
||||
MouseEnter:connect(function()return ae(Z)end)o[Z]=Z.MouseButton1Click:connect(
|
||||
function()local ak=tick()if Z.Active and(ak-aj)<0.5 then local al=ac()if al then
|
||||
Z.ZIndex=1 W(al,Z)end else af(Z)end aj=ak end)end end end return J()end local ah
|
||||
ah=function()local ai=0.75*(function()if t.AbsoluteSize.Y>t.AbsoluteSize.X then
|
||||
return t.AbsoluteSize.X else return t.AbsoluteSize.Y end end)()b(t,'GearImage')t
|
||||
.GearImage.Size=UDim2.new(0,ai,0,ai)t.GearImage.Position=UDim2.new(0,t.
|
||||
AbsoluteSize.X/2-ai/2,0.75,-ai)return ag()end local ai ai=function(aj)if not aj:
|
||||
IsA'Tool'and not aj:IsA'HopperBin'then return end if aj:FindFirstChild
|
||||
'RobloxBuildTool'then return end for ak,al in pairs(j)do if al==aj then return
|
||||
end end table.insert(j,aj)local Z=aj.Changed:connect(function(Z)if Z=='Name'and
|
||||
k[aj]and k[aj].Image==''then k[aj].GearText.Text=aj.Name end end)local am=aj.
|
||||
AncestryChanged:connect(function(_,am)local an for ao,ap in pairs(j)do if ap==aj
|
||||
then an=ap break end end c(e,'Character')b(e,'Backpack')if aj.Parent~=e.Backpack
|
||||
and aj.Parent~=e.Character then do local aq=ancestryCon if aq~=nil then aq:
|
||||
disconnect()end end if Z~=nil then Z:disconnect()end for aq,ar in pairs(j)do if
|
||||
ar==an then do local as=n[k[ar]]if as~=nil then as:disconnect()end end do local
|
||||
as=o[k[ar]]if as~=nil then as:disconnect()end end k[ar].Parent=nil k[ar]=nil
|
||||
break end end Q(j,an)ag()else ag()end return V()end)return ag()end local aj aj=
|
||||
function(ak)for al,am in pairs(k)do am.Parent=nil end if ak then for an,ao in
|
||||
pairs(ak)do ao.Parent=w.ScrollingFrame end end return J()end local ak ak=
|
||||
function()for al,am in pairs(k)do am.Parent=w.ScrollingFrame end return J()end
|
||||
local al al=function(am)local an,ao={},nil for ap=1,#am do if am[ap]:IsA'Frame'
|
||||
and#am[ap]:GetChildren()>0 then if am[ap].Name=='Slot0'then ao=am[ap]else table.
|
||||
insert(an,am[ap])end end end if ao then table.insert(an,ao)end local ap=(1-(#an*
|
||||
0.1))/2 for aq=1,#an do an[aq]:TweenPosition(UDim2.new(ap+((aq-1)*0.1),0,0,0),
|
||||
Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end local am am=
|
||||
function(an)if an and an~=h then i.Gear.Visible=false return end i.Gear.Visible=
|
||||
true V()ag()ah()return F:Invoke()end local an an=function(ao)if ao and ao~=h
|
||||
then i.Gear.Visible=false return end i.Gear.Visible=false ag()ah()return F:
|
||||
Invoke()end local ao ao=function(ap)if ap==h then return am(ap)else return an(ap
|
||||
)end end local ap ap=function(aq,ar)if not aq:IsA'ImageButton'then return end
|
||||
for as,Z in pairs(j)do if k[Z]then if aq:FindFirstChild(k[Z]:FindFirstChild
|
||||
'GearReference')then if k[Z].GearReference.Value==aq.GearReference.Value then k[
|
||||
Z].Active=ar break end end end end end local aq aq=function()if r~=nil then r:
|
||||
disconnect()end r=game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(
|
||||
ar)return ai(ar)end)local ar=game.Players.LocalPlayer.Backpack:GetChildren()for
|
||||
as=1,#ar do ai(ar[as])end if p~=nil then p:disconnect()end p=game.Players.
|
||||
LocalPlayer.Character.ChildAdded:connect(function(as)ai(as)return V()end)if q~=
|
||||
nil then q:disconnect()end q=game.Players.LocalPlayer.Character.ChildRemoved:
|
||||
connect(function(as)return V()end)wait()return al(v:GetChildren())end local ar
|
||||
ar=function()if p~=nil then p:disconnect()end if q~=nil then q:disconnect()end
|
||||
if r~=nil then return r:disconnect()end return nil end local as as=function(Z)
|
||||
return Z:gsub('^%s*(.-)%s*$','%1')end local Z Z=function(at)local au={}for av,aw
|
||||
in pairs(j)do if k[aw]then local ax=string.lower(k[aw].GearReference.Value.Name)
|
||||
ax=as(ax)for ay=1,#at do if string.match(ax,at[ay])then table.insert(au,k[aw])
|
||||
break end end end end return au end local at at=function(au)if type(au)~=
|
||||
'string'then return end local av={}for aw in string.gmatch(au,'[^%s]+')do if
|
||||
string.len(aw)>0 then table.insert(av,aw)end end return av end local au au=
|
||||
function(av)if not i.Gear.Visible then return end local aw,ax=at(av),nil if aw
|
||||
and(#aw>0)then ax=aw else ax=nil end if not(aw~=nil)then ak()return end local ay
|
||||
=Z(ax)return aj(ay)end local av av=function()while#k>0 do table.remove(k)end k={
|
||||
}while#j>0 do table.remove(j)end j={}local aw=w.ScrollingFrame:GetChildren()for
|
||||
ax=1,#aw do aw[ax]:remove()end end local aw aw=function(ax,ay)if ax==Enum.
|
||||
CoreGuiType.Backpack or ax==Enum.CoreGuiType.All then if not ay then i.Gear.
|
||||
Visible=false end end end local ax=e.Backpack:GetChildren()for ay=1,#ax do ai(ax
|
||||
[ay])end D.Event:connect(function(ay)if l then return end l=true wait()ah()ag()l
|
||||
=false end)v.ChildAdded:connect(function(ay)return ap(ay,false)end)v.
|
||||
ChildRemoved:connect(function(ay)return ap(ay,true)end)v.DescendantAdded:
|
||||
connect(function(ay)if not i.Visible and(ay:IsA'ImageButton'or ay:IsA
|
||||
'TextButton')then return al(v:GetChildren())end end)v.DescendantRemoving:
|
||||
connect(function(ay)if not i.Visible and(ay:IsA'ImageButton'or ay:IsA
|
||||
'TextButton')then wait()return al(v:GetChildren())end end)w.MouseEnter:connect(
|
||||
function()return S()end)w.MouseLeave:connect(function()return S()end)e.
|
||||
CharacterRemoving:connect(function()ar()return av()end)e.CharacterAdded:connect(
|
||||
function()return aq()end)e.ChildAdded:connect(function(ay)if ay:IsA'Backpack'
|
||||
then s=ay if r~=nil then r:disconnect()end r=game.Players.LocalPlayer.Backpack.
|
||||
ChildAdded:connect(function(az)return ai(az)end)end end)y.Changed:connect(
|
||||
function()if not y.Value then return V()end end)local ay=v:GetChildren()for az=1
|
||||
,#ay do if ay[az]:IsA'Frame'and string.find(ay[az].Name,'Slot')then ay[az].
|
||||
ChildRemoved:connect(function()return V()end)ay[az].ChildAdded:connect(function(
|
||||
)return V()end)end end pcall(function()aw(Enum.CoreGuiType.Backpack,Game.
|
||||
StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))return Game.StarterGui.
|
||||
CoreGuiChangedSignal:connect(aw)end)ah()ag()ay=v:GetChildren()for az=1,#ay do
|
||||
ap(ay[az],false)end if not i.Visible then al(v:GetChildren())end if not(p~=nil)
|
||||
and game.Players.LocalPlayer['Character']then aq()end if not r then r=game.
|
||||
Players.LocalPlayer.Backpack.ChildAdded:connect(function(az)return ai(az)end)end
|
||||
A.Event:connect(am)B.Event:connect(an)C.Event:connect(ao)E.Event:connect(au)
|
||||
return O()
|
||||
|
|
@ -1,97 +1,86 @@
|
|||
if game.CoreGui.Version<7 then return end local function waitForChild(a,b)while
|
||||
not a:FindFirstChild(b)do a.ChildAdded:wait()end return a:FindFirstChild(b)end
|
||||
local function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end
|
||||
waitForChild(game,'Players')if#game.Players:GetChildren()<1 then game.Players.
|
||||
ChildAdded:wait()end waitForProperty(game.Players,'LocalPlayer')local a=script.
|
||||
Parent waitForChild(a,'Gear')local b=script.Parent.Parent assert(b:IsA
|
||||
'ScreenGui')waitForChild(a,'Tabs')waitForChild(a.Tabs,'CloseButton')local c=a.
|
||||
Tabs.CloseButton waitForChild(a.Tabs,'InventoryButton')local d,e=a.Tabs.
|
||||
InventoryButton,nil if game.CoreGui.Version>=8 then waitForChild(a.Tabs,
|
||||
'WardrobeButton')e=a.Tabs.WardrobeButton end waitForChild(a.Parent,
|
||||
'ControlFrame')local f,g,h=waitForChild(a.Parent.ControlFrame,'BackpackButton'),
|
||||
'gear',waitForChild(a,'SearchFrame')waitForChild(a.SearchFrame,'SearchBoxFrame')
|
||||
local i,j,k,l=waitForChild(a.SearchFrame.SearchBoxFrame,'SearchBox'),
|
||||
waitForChild(a.SearchFrame,'SearchButton'),waitForChild(a.SearchFrame,
|
||||
'ResetButton'),waitForChild(Game.CoreGui,'RobloxGui')local m=waitForChild(l,
|
||||
'CurrentLoadout')local n,o,p,q,r,s,t,u,v,w,x,y=waitForChild(m,'Background'),true
|
||||
,true,false,true,false,nil,0.25,'Search...','~','`',UDim2.new(0,600,0,400)if l.
|
||||
AbsoluteSize.Y<=320 then y=UDim2.new(0,200,0,140)end function createPublicEvent(
|
||||
z)assert(z,'eventName is nil')assert(tostring(z),'eventName is not a string')
|
||||
local A=Instance.new'BindableEvent'A.Name=tostring(z)A.Parent=script return A
|
||||
end function createPublicFunction(z,A)assert(z,'funcName is nil')assert(
|
||||
tostring(z),'funcName is not a string')assert(A,'invokeFunc is nil')assert(type(
|
||||
A)=='function',"invokeFunc should be of type 'function'")local B=Instance.new
|
||||
'BindableFunction'B.Name=tostring(z)B.OnInvoke=A B.Parent=script return B end
|
||||
local z,A,B,C,D=createPublicEvent'ResizeEvent',createPublicEvent
|
||||
'BackpackOpenEvent',createPublicEvent'BackpackCloseEvent',createPublicEvent
|
||||
'TabClickedEvent',createPublicEvent'SearchRequestedEvent'function
|
||||
deactivateBackpack()a.Visible=false r=false end function
|
||||
initHumanoidDiedConnections()if t then t:disconnect()end waitForProperty(game.
|
||||
Players.LocalPlayer,'Character')waitForChild(game.Players.LocalPlayer.Character,
|
||||
'Humanoid')t=game.Players.LocalPlayer.Character.Humanoid.Died:connect(
|
||||
deactivateBackpack)end function activateBackpack()initHumanoidDiedConnections()r
|
||||
=true a.Visible=q if q then toggleBackpack()end end local E=function()q=false p=
|
||||
false f.Selected=false resetSearch()B:Fire(g)a.Tabs.Visible=false h.Visible=
|
||||
false a:TweenSizeAndPosition(UDim2.new(0,y.X.Offset,0,0),UDim2.new(0.5,-y.X.
|
||||
Offset/2,1,-85),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,u,true,function()
|
||||
game.GuiService:RemoveCenterDialog(a)a.Visible=false f.Selected=false end)delay(
|
||||
u,function()game.GuiService:RemoveCenterDialog(a)a.Visible=false f.Selected=
|
||||
false p=true o=true end)end function showBackpack()game.GuiService:
|
||||
AddCenterDialog(a,Enum.CenterDialogType.PlayerInitiatedDialog,function()a.
|
||||
Visible=true f.Selected=true end,function()a.Visible=false f.Selected=false end)
|
||||
a.Visible=true f.Selected=true a:TweenSizeAndPosition(y,UDim2.new(0.5,-y.X.
|
||||
Offset/2,1,-y.Y.Offset-88),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,u,true
|
||||
)delay(u,function()a.Tabs.Visible=false h.Visible=true A:Fire(g)o=true p=true f.
|
||||
Image='http://www.roblox.com/asset/?id=97644093'f.Position=UDim2.new(0.5,-60,1,-
|
||||
y.Y.Offset-103)end)end function toggleBackpack()if not game.Players.LocalPlayer
|
||||
then return end if not game.Players.LocalPlayer['Character']then return end if
|
||||
not o then return end if not p then return end p=false o=false q=not q if q then
|
||||
n.Image='http://www.roblox.com/asset/?id=97623721'n.Position=UDim2.new(-3E-2,0,-
|
||||
0.17,0)n.Size=UDim2.new(1.05,0,1.25,0)n.ZIndex=2 n.Visible=true showBackpack()
|
||||
else f.Position=UDim2.new(0.5,-60,1,-44)n.Visible=false f.Selected=false f.Image
|
||||
='http://www.roblox.com/asset/?id=97617958'n.Image=
|
||||
'http://www.roblox.com/asset/?id=96536002'n.Position=UDim2.new(-0.1,0,-0.1,0)n.
|
||||
Size=UDim2.new(1.2,0,1.2,0)E()local F=m:GetChildren()for G=1,#F do if F[G]and F[
|
||||
G]:IsA'Frame'then local H=F[G]if#H:GetChildren()>0 then f.Position=UDim2.new(0.5
|
||||
,-60,1,-108)f.Visible=true n.Visible=true if H:GetChildren()[1]:IsA'ImageButton'
|
||||
then local I=H:GetChildren()[1]I.Active=true I.Draggable=false end end end end
|
||||
end end function closeBackpack()if q then toggleBackpack()end end function
|
||||
setSelected(F)assert(F)assert(F:IsA'TextButton')F.BackgroundColor3=Color3.new(1,
|
||||
1,1)F.TextColor3=Color3.new(0,0,0)F.Selected=true F.ZIndex=3 end function
|
||||
setUnselected(F)assert(F)assert(F:IsA'TextButton')F.BackgroundColor3=Color3.new(
|
||||
0,0,0)F.TextColor3=Color3.new(1,1,1)F.Selected=false F.ZIndex=1 end function
|
||||
updateTabGui(F)assert(F)if F=='gear'then setSelected(d)setUnselected(e)elseif F
|
||||
=='wardrobe'then setSelected(e)setUnselected(d)end end function mouseLeaveTab(F)
|
||||
assert(F)assert(F:IsA'TextButton')if F.Selected then return end F.
|
||||
BackgroundColor3=Color3.new(0,0,0)end function mouseOverTab(F)assert(F)assert(F:
|
||||
IsA'TextButton')if F.Selected then return end F.BackgroundColor3=Color3.new(
|
||||
0.15294117647058825,0.15294117647058825,0.15294117647058825)end function
|
||||
newTabClicked(F)assert(F)F=string.lower(F)g=F updateTabGui(F)C:Fire(F)
|
||||
resetSearch()end function trim(F)return(F:gsub('^%s*(.-)%s*$','%1'))end function
|
||||
resetSearchBoxGui()k.Visible=false i.Text=v end function doSearch()local F=i.
|
||||
Text if F==''then resetSearch()return end F=trim(F)k.Visible=true D:Fire(F)end
|
||||
function resetSearch()resetSearchBoxGui()D:Fire()end local F=function()p=true
|
||||
end function coreGuiChanged(G,H)if G==Enum.CoreGuiType.Backpack or G==Enum.
|
||||
CoreGuiType.All then r=H s=not H if s then pcall(function()game:GetService
|
||||
'GuiService':RemoveKey(w)game:GetService'GuiService':RemoveKey(x)end)else game:
|
||||
GetService'GuiService':AddKey(w)game:GetService'GuiService':AddKey(x)end
|
||||
resetSearch()h.Visible=H and q m.Visible=H a.Visible=H f.Visible=H end end
|
||||
createPublicFunction('CloseBackpack',E)createPublicFunction('BackpackReady',F)
|
||||
pcall(function()coreGuiChanged(Enum.CoreGuiType.Backpack,Game.StarterGui:
|
||||
GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))Game.StarterGui.
|
||||
CoreGuiChangedSignal:connect(coreGuiChanged)end)d.MouseButton1Click:connect(
|
||||
function()newTabClicked'gear'end)d.MouseEnter:connect(function()mouseOverTab(d)
|
||||
end)d.MouseLeave:connect(function()mouseLeaveTab(d)end)if game.CoreGui.Version>=
|
||||
8 then e.MouseButton1Click:connect(function()newTabClicked'wardrobe'end)e.
|
||||
MouseEnter:connect(function()mouseOverTab(e)end)e.MouseLeave:connect(function()
|
||||
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
|
||||
if game.CoreGui.Version<7 then return end local a a=function(b,c)while not b:
|
||||
FindFirstChild(c)do b.ChildAdded:wait()end return b:FindFirstChild(c)end local b
|
||||
b=function(c,d)while not c[d]do c.Changed:wait()end end a(game,'Players')if#game
|
||||
.Players:GetChildren()<1 then game.Players.ChildAdded:wait()end b(game.Players,
|
||||
'LocalPlayer')local c=script.Parent a(c,'Gear')local d=script.Parent.Parent
|
||||
assert(d:IsA'ScreenGui')a(c,'Tabs')a(c.Tabs,'CloseButton')local e=c.Tabs.
|
||||
CloseButton a(c.Tabs,'InventoryButton')local f,g=c.Tabs.InventoryButton,nil if
|
||||
game.CoreGui.Version>=8 then a(c.Tabs,'WardrobeButton')g=c.Tabs.WardrobeButton
|
||||
end a(c.Parent,'ControlFrame')local h,i,j=a(c.Parent.ControlFrame,
|
||||
'BackpackButton'),'gear',a(c,'SearchFrame')a(c.SearchFrame,'SearchBoxFrame')
|
||||
local k,l,m,n=a(c.SearchFrame.SearchBoxFrame,'SearchBox'),a(c.SearchFrame,
|
||||
'SearchButton'),a(c.SearchFrame,'ResetButton'),a(Game.CoreGui,'RobloxGui')local
|
||||
o=a(n,'CurrentLoadout')local p,q,r,s,t,u,v,w,x,y,z,A=a(o,'Background'),true,true
|
||||
,false,true,false,nil,0.25,'Search...','~','`',UDim2.new(0,600,0,400)if n.
|
||||
AbsoluteSize.Y<=320 then A=UDim2.new(0,200,0,140)end local B B=function(C)
|
||||
assert(C,'eventName is nil')assert(tostring(C),'eventName is not a string')local
|
||||
D=Instance.new'BindableEvent'D.Name=tostring(C)D.Parent=script return D end
|
||||
local C C=function(D,E)assert(D,'funcName is nil')assert(tostring(D),
|
||||
'funcName is not a string')assert(E,'invokeFunc is nil')assert(type(E)==
|
||||
'function',"invokeFunc should be of type 'function'")local F=Instance.new
|
||||
'BindableFunction'F.Name=tostring(D)F.OnInvoke=E F.Parent=script return F end
|
||||
local D,E,F,G,H,I=B'ResizeEvent',B'BackpackOpenEvent',B'BackpackCloseEvent',B
|
||||
'TabClickedEvent',B'SearchRequestedEvent',nil I=function()m.Visible=false k.Text
|
||||
=x end local J J=function()I()return H:Fire()end local K K=function()c.Visible=
|
||||
false t=false end local L L=function()if v then v:disconnect()end b(game.Players
|
||||
.LocalPlayer,'Character')a(game.Players.LocalPlayer.Character,'Humanoid')v=game.
|
||||
Players.LocalPlayer.Character.Humanoid.Died:connect(K)end local M M=function()s=
|
||||
false r=false h.Selected=false J()F:Fire(i)c.Tabs.Visible=false j.Visible=false
|
||||
c:TweenSizeAndPosition(UDim2.new(0,A.X.Offset,0,0),UDim2.new(0.5,-A.X.Offset/2,1
|
||||
,-85),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,w,true,function()game.
|
||||
GuiService:RemoveCenterDialog(c)c.Visible=false h.Selected=false end)return
|
||||
delay(w,function()game.GuiService:RemoveCenterDialog(c)c.Visible=false h.
|
||||
Selected=false r=true q=true end)end local N N=function()game.GuiService:
|
||||
AddCenterDialog(c,Enum.CenterDialogType.PlayerInitiatedDialog,function()c.
|
||||
Visible=true h.Selected=true end,function()c.Visible=false h.Selected=false end)
|
||||
c.Visible=true h.Selected=true c:TweenSizeAndPosition(A,UDim2.new(0.5,-A.X.
|
||||
Offset/2,1,-A.Y.Offset-88),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,w,true
|
||||
)return delay(w,function()c.Tabs.Visible=false j.Visible=true E:Fire(i)q=true r=
|
||||
true h.Image='http://www.roblox.com/asset/?id=97644093'h.Position=UDim2.new(0.5,
|
||||
-60,1,-A.Y.Offset-103)end)end local O O=function()if not game.Players.
|
||||
LocalPlayer then return end if not game.Players.LocalPlayer['Character']then
|
||||
return end if not q then return end if not r then return end r=false q=false s=
|
||||
not s if s then p.Image='http://www.roblox.com/asset/?id=97623721'p.Position=
|
||||
UDim2.new(-3E-2,0,-0.17,0)p.Size=UDim2.new(1.05,0,1.25,0)p.ZIndex=2 p.Visible=
|
||||
true return N()else h.Position=UDim2.new(0.5,-60,1,-44)p.Visible=false h.
|
||||
Selected=false h.Image='http://www.roblox.com/asset/?id=97617958'p.Image=
|
||||
'http://www.roblox.com/asset/?id=96536002'p.Position=UDim2.new(-0.1,0,-0.1,0)p.
|
||||
Size=UDim2.new(1.2,0,1.2,0)M()local P=o:GetChildren()for Q=1,#P do if P[Q]and P[
|
||||
Q]:IsA'Frame'then local R=P[Q]if#R:GetChildren()>0 then h.Position=UDim2.new(0.5
|
||||
,-60,1,-108)h.Visible=true p.Visible=true if R:GetChildren()[1]:IsA'ImageButton'
|
||||
then local S=R:GetChildren()[1]S.Active=true S.Draggable=false end end end end
|
||||
end end local P P=function()L()t=true c.Visible=s if s then return O()end end
|
||||
local Q Q=function()if s then return O()end end local R R=function(S)assert(S)
|
||||
assert(S:IsA'TextButton')S.BackgroundColor3=Color3.new(1,1,1)S.TextColor3=Color3
|
||||
.new(0,0,0)S.Selected=true S.ZIndex=3 return S end local S S=function(T)assert(T
|
||||
)assert(T:IsA'TextButton')T.BackgroundColor3=Color3.new(0,0,0)T.TextColor3=
|
||||
Color3.new(1,1,1)T.Selected=false T.ZIndex=1 return T end local T T=function(U)
|
||||
assert(U)if U=='gear'then R(f)return S(g)elseif U=='wardrobe'then R(g)return S(f
|
||||
)end end local U U=function(V)assert(V)assert(V:IsA'TextButton')if V.Selected
|
||||
then return end V.BackgroundColor3=Color3.new(0,0,0)end local V V=function(W)
|
||||
assert(W)assert(W:IsA'TextButton')if W.Selected then return end W.
|
||||
BackgroundColor3=Color3.new(0.15294117647058825,0.15294117647058825,
|
||||
0.15294117647058825)end local W W=function(X)assert(X)X=string.lower(X)i=X T(X)G
|
||||
:Fire(X)return J()end local X X=function(Y)return Y:gsub('^%s*(.-)%s*$','%1')end
|
||||
local Y Y=function()local Z=k.Text if Z==''then J()return end Z=X(Z)m.Visible=
|
||||
true return H:Fire(Z)end local Z Z=function()r=true end local _ _=function(aa,ab
|
||||
)if aa==Enum.CoreGuiType.Backpack or aa==Enum.CoreGuiType.All then t=ab u=not ab
|
||||
do local ac=game:GetService'GuiService'if u then pcall(function()ac:RemoveKey(y)
|
||||
return ac:RemoveKey(z)end)else ac:AddKey(y)ac:AddKey(z)end end J()j.Visible=ab
|
||||
and s o.Visible=ab c.Visible=ab h.Visible=ab end end C('CloseBackpack',M)C(
|
||||
'BackpackReady',Z)pcall(function()_(Enum.CoreGuiType.Backpack,Game.StarterGui:
|
||||
GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))return Game.StarterGui.
|
||||
CoreGuiChangedSignal:connect(_)end)f.MouseButton1Click:connect(function()return
|
||||
W'gear'end)f.MouseEnter:connect(function()return V(f)end)f.MouseLeave:connect(
|
||||
function()return U(f)end)if game.CoreGui.Version>=8 then g.MouseButton1Click:
|
||||
connect(function()return W'wardrobe'end)g.MouseEnter:connect(function()return V(
|
||||
g)end)g.MouseLeave:connect(function()return U(g)end)end e.MouseButton1Click:
|
||||
connect(Q)d.Changed:connect(function(aa)if aa=='AbsoluteSize'then return D:Fire(
|
||||
d.AbsoluteSize)end end)do local aa=game:GetService'GuiService'aa:AddKey(y)aa:
|
||||
AddKey(z)aa.KeyPressed:connect(function(ab)if not t or u then return end if ab==
|
||||
y or ab==z then return O()end end)end h.MouseButton1Click:connect(function()if
|
||||
not t or u then return end return O()end)if game.Players.LocalPlayer['Character'
|
||||
]then P()end game.Players.LocalPlayer.CharacterAdded:connect(P)k.FocusLost:
|
||||
connect(function(aa)if aa or k.Text~=''then return Y()elseif k.Text==''then
|
||||
return J()end end)l.MouseButton1Click:connect(Y)m.MouseButton1Click:connect(J)if
|
||||
j and n.AbsoluteSize.Y<=320 then j.RobloxLocked=false return j:Destroy()end
|
||||
|
|
@ -1,377 +1,361 @@
|
|||
local a=false local function WaitForChild(b,c)while b:FindFirstChild(c)==nil do
|
||||
b.ChildAdded:wait(0.03)end return b[c]end local function typedef(b)return b end
|
||||
local function IsPhone()local b=Game:GetService'CoreGui'local c=WaitForChild(b,
|
||||
'RobloxGui')if c.AbsoluteSize.Y<600 then return true end return false end
|
||||
local function StringTrim(b)return(b:gsub('^%s*(.-)%s*$','%1'))end while Game.
|
||||
Players.LocalPlayer==nil do wait(0.03)end local b=Game.Players.LocalPlayer while
|
||||
b.Character==nil do wait(0.03)end local c=LoadLibrary'RbxUtility'local d,e,f,g,h
|
||||
,i=typedef(c),Game.Workspace.CurrentCamera,Game:GetService'CoreGui',Game:
|
||||
GetService'Players',Game:GetService'GuiService',nil do i={}local j={}local k,l={
|
||||
__call=function(k,l)return k[l]or k[tonumber(l)]end,__index={GetEnumItems=
|
||||
function(k)local l={}for m,n in pairs(k)do if type(m)=='number'then l[#l+1]=n
|
||||
end end table.sort(l,function(o,p)return o.Value<p.Value end)return l end},
|
||||
__tostring=function(k)return'Enum.'..k[j]end},{__call=function(k,l)return l==k
|
||||
or l==k.Name or l==k.Value end,__tostring=function(k)return'Enum.'..k[j]..'.'..k
|
||||
.Name end}function CreateEnum(m)return function(n)local o={[j]=m}for p,q in
|
||||
pairs(n)do local r=setmetatable({Name=q,Value=p,Enum=o,[j]=m},l)o[p]=r o[q]=r o[
|
||||
r]=r end i[m]=o return setmetatable(o,k)end end end local j,k={Mouse=b:GetMouse(
|
||||
),Speed=0,Simulating=false,Configuration={DefaultSpeed=1},UserIsScrolling=false}
|
||||
,{ChatColors={BrickColor.new'Bright red',BrickColor.new'Bright blue',BrickColor.
|
||||
new'Earth green',BrickColor.new'Bright violet',BrickColor.new'Bright orange',
|
||||
BrickColor.new'Bright yellow',BrickColor.new'Light reddish violet',BrickColor.
|
||||
new'Brick yellow'},Gui=nil,Frame=nil,RenderFrame=nil,TapToChatLabel=nil,
|
||||
ClickToChatButton=nil,ScrollingLock=false,EventListener=nil,MessageQueue={},
|
||||
Configuration={FontSize=Enum.FontSize.Size12,NumFontSize=12,HistoryLength=20,
|
||||
Size=UDim2.new(0.38,0,0.2,0),MessageColor=Color3.new(1,1,1),AdminMessageColor=
|
||||
Color3.new(1,0.8431372549019608,0),XScale=0.025,LifeTime=45,Position=UDim2.new(0
|
||||
,2,0.05,0),DefaultTweenSpeed=0.15},SlotPositions_List={},CachedSpaceStrings_List
|
||||
={},MouseOnFrame=false,GotFocus=false,Messages_List={},MessageThread=nil,
|
||||
Admins_List={'taskmanager','Heliodex','tako'},SafeChat_List={[
|
||||
'Use the Chat menu to talk to me.']={'/sc 0',true},['I can only see menu chats.'
|
||||
]={'/sc 1',true},['Hello']={['Hi']={'/sc 2_0',true,['Hi there!']=true,[
|
||||
'Hi everyone']=true},['Howdy']={'/sc 2_1',true,['Howdy partner!']=true},[
|
||||
'Greetings']={'/sc 2_2',true,['Greetings everyone']=true,[
|
||||
'Greetings Robloxians!']=true,['Seasons greetings!']=true},['Welcome']={
|
||||
'/sc 2_3',true,['Welcome to my place']=true,['Welcome to my barbeque']=true,[
|
||||
'Welcome to our base']=true},['Hey there!']={'/sc 2_4',true},["What's up?"]={
|
||||
'/sc 2_5',true,['How are you doing?']=true,["How's it going?"]=true,[
|
||||
"What's new?"]=true},['Good day']={'/sc 2_6',true,['Good morning']=true,[
|
||||
'Good evening']=true,['Good afternoon']=true,['Good night']=true},['Silly']={
|
||||
'/sc 2_7',true,['Waaaaaaaz up?!']=true,['Hullo!']=true,[
|
||||
local a,b=false,nil b=function(c,d)while not(c:FindFirstChild(d)~=nil)do c.
|
||||
ChildAdded:wait(0.03)end return c[d]end local c c=function()local d=Game:
|
||||
GetService'CoreGui'local e=b(d,'RobloxGui')if e.AbsoluteSize.Y<600 then return
|
||||
true end return false end local d d=function(e)return e:gsub('^%s*(.-)%s*$','%1'
|
||||
)end while not(Game.Players.LocalPlayer~=nil)do wait(0.03)end local e=Game.
|
||||
Players.LocalPlayer while not(e.Character~=nil)do wait(0.03)end local f,g=Game.
|
||||
Workspace.CurrentCamera,nil g=function(h,i,j)if not(j~=nil)then j=i i=nil end
|
||||
local k=Instance.new(h)if i then k.Name=i end local l for m,n in pairs(j)do if
|
||||
type(m)=='string'then if m=='Parent'then l=n else k[m]=n end elseif type(m)==
|
||||
'number'and type(n)=='userdata'then n.Parent=k end end k.Parent=l return k end
|
||||
local h,i,j,k,l,m=Game:GetService'CoreGui',Game:GetService'Players',Game:
|
||||
GetService'GuiService',{},{},nil m=function(n)return function(o)local p={[l]=n}
|
||||
for q,r in pairs(o)do local s=setmetatable({Name=r,Value=q,Enum=p,[l]=n},{__call
|
||||
=function(s,t)return t==s or t==s.Name or t==s.Value end,__tostring=function(s)
|
||||
return'Enum.'..tostring(s[l])..'.'..tostring(s.Name)end})p[q]=s p[r]=s p[s]=s
|
||||
end k[n]=p return setmetatable(p,{__call=function(s,t)return s[t]or s[tonumber(t
|
||||
)]end,__index={GetEnumItems=function(s)o={}for t,u in pairs(s)do if type(t)==
|
||||
'number'then o[#o+1]=u end end table.sort(o,function(v,w)return v.Value<w.Value
|
||||
end)return o end},__tostring=function(s)return'Enum.'..tostring(s[l])end})end
|
||||
end local n,o,p={Mouse=e:GetMouse(),Speed=0,Simulating=false,Configuration={
|
||||
DefaultSpeed=1},UserIsScrolling=false},{ChatColors={BrickColor.new'Bright red',
|
||||
BrickColor.new'Bright blue',BrickColor.new'Earth green',BrickColor.new
|
||||
'Bright violet',BrickColor.new'Bright orange',BrickColor.new'Bright yellow',
|
||||
BrickColor.new'Light reddish violet',BrickColor.new'Brick yellow'},Gui=nil,Frame
|
||||
=nil,RenderFrame=nil,TapToChatLabel=nil,ClickToChatButton=nil,ScrollingLock=
|
||||
false,EventListener=nil,MessageQueue={},Configuration={FontSize=Enum.FontSize.
|
||||
Size12,NumFontSize=12,HistoryLength=20,Size=UDim2.new(0.38,0,0.2,0),MessageColor
|
||||
=Color3.new(1,1,1),AdminMessageColor=Color3.new(1,0.8431372549019608,0),XScale=
|
||||
0.025,LifeTime=45,Position=UDim2.new(0,2,0.05,0),DefaultTweenSpeed=0.15},
|
||||
SlotPositions_List={},CachedSpaceStrings_List={},MouseOnFrame=false,GotFocus=
|
||||
false,Messages_List={},MessageThread=nil,Admins_List={'taskmanager','Heliodex',
|
||||
'tako'},SafeChat_List={['Use the Chat menu to talk to me.']={'/sc0',true},[
|
||||
'I can only see menu chats.']={'/sc1',true},Hello={Hi={'/sc2_0',true,[
|
||||
'Hi there!']=true,['Hi everyone']=true},Howdy={'/sc2_1',true,['Howdy partner!']=
|
||||
true},Greetings={'/sc2_2',true,['Greetings everyone']=true,[
|
||||
'Greetings Robloxians!']=true,['Seasons greetings!']=true},Welcome={'/sc2_3',
|
||||
true,['Welcome to my place']=true,['Welcome to my barbeque']=true,[
|
||||
'Welcome to our base']=true},['Hey there!']={'/sc2_4',true},["What's up?"]={
|
||||
'/sc2_5',true,['How are you doing?']=true,["How's it going?"]=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,[
|
||||
'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,[
|
||||
'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 Thanksgiving!']=true,['Happy Halloween!']=true,['Happy Hanukkah!']=true,[
|
||||
'Merry Christmas!']=true,['Happy May Day!']=true,['Happy Towel Day!']=true,[
|
||||
'Happy Mercury Day!']=true,['Happy LOL Day!']=true},[1]='/sc 2'},['Goodbye']={[
|
||||
'Good Night']={'/sc 3_0',true,['Sweet dreams']=true,['Go to sleep!']=true,[
|
||||
'Lights out!']=true,['Bedtime']=true,['Going to bed now']=true},['Later']={
|
||||
'/sc 3_1',true,['See ya later']=true,['Later gator!']=true,['See you tomorrow']=
|
||||
true},['Bye']={'/sc 3_2',true,['Hasta la bye bye!']=true},["I'll be right back"]
|
||||
={'/sc 3_3',true},['I have to go']={'/sc 3_4',true},['Farewell']={'/sc 3_5',true
|
||||
,['Take care']=true,['Have a nice day']=true,['Goodluck!']=true,[
|
||||
'Ta-ta for now!']=true},['Peace']={'/sc 3_6',true,['Peace out!']=true,[
|
||||
'Peace dudes!']=true,['Rest in pieces!']=true},['Silly']={'/sc 3_7',true,[
|
||||
'To the batcave!']=true,['Over and out!']=true,['Happy trails!']=true,[
|
||||
"I've got to book it!"]=true,['Tootles!']=true,['Smell you later!']=true,['GG!']
|
||||
=true,['My house is on fire! gtg.']=true},[1]='/sc 3'},['Friend']={[
|
||||
'Wanna be friends?']={'/sc 4_0',true},['Follow me']={'/sc 4_1',true,[
|
||||
'Happy Mercury Day!']=true,['Happy LOL Day!']=true},'/sc2'},Goodbye={[
|
||||
'Good Night']={'/sc3_0',true,['Sweet dreams']=true,['Go to sleep!']=true,[
|
||||
'Lights out!']=true,Bedtime=true,['Going to bed now']=true},Later={'/sc3_1',true
|
||||
,['See ya later']=true,['Later gator!']=true,['See you tomorrow']=true},Bye={
|
||||
'/sc3_2',true,['Hasta la bye bye!']=true},["I'll be right back"]={'/sc3_3',true}
|
||||
,['I have to go']={'/sc3_4',true},Farewell={'/sc3_5',true,['Take care']=true,[
|
||||
'Have a nice day']=true,['Goodluck!']=true,['Ta-ta for now!']=true},Peace={
|
||||
'/sc3_6',true,['Peace out!']=true,['Peace dudes!']=true,['Rest in pieces!']=true
|
||||
},Silly={'/sc3_7',true,['To the batcave!']=true,['Over and out!']=true,[
|
||||
'Happy trails!']=true,["I've got to book it!"]=true,['Tootles!']=true,[
|
||||
'Smell you later!']=true,['GG!']=true,['My house is on fire! gtg.']=true},'/sc3'
|
||||
},Friend={['Wanna be friends?']={'/sc4_0',true},['Follow me']={'/sc4_1',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,[
|
||||
'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'
|
||||
]=true,['No, thank you']=true,['Thanx']=true},['No problem']={'/sc 4_4',true,[
|
||||
"Don't worry"]=true,["That's ok"]=true,['np']=true},['You are ...']={'/sc 4_5',
|
||||
true,['You are great!']=true,['You are good!']=true,['You are cool!']=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 ...']={'/sc4_5',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 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 items']=true,['I like money']=true},['Sorry']={'/sc 4_7',true,['My bad!'
|
||||
]=true,["I'm sorry"]=true,['Whoops!']=true,['Please forgive me.']=true,[
|
||||
'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,[
|
||||
'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',
|
||||
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,[
|
||||
"Sorry, I'll stop now."]=true},'/sc4'},Questions={['Who?']={'/sc5_0',true,[
|
||||
'Who wants to be my friend?']=true,['Who wants to be on my team?']=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 movie?']=true,['What is your favorite TV show?']=true,[
|
||||
'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 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?!']=
|
||||
true,['Where did you go?']=true},['How?']={'/sc 5_4',true,['How are you today?']
|
||||
=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,[
|
||||
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...']={
|
||||
'/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 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]=
|
||||
'/sc 5'},['Answers']={['You need help?']={'/sc 6_0',true,[
|
||||
'Check out the news section']=true,['Check out the help section']=true,[
|
||||
'Read the wiki!']=true,['All the answers are in the wiki!']=true,[
|
||||
'I will help you with this.']=true},['Some people ...']={'/sc 6_1',true,['Me']=
|
||||
true,['Not me']=true,['You']=true,['All of us']=true,['Everyone but you']=true,[
|
||||
'Builderman!']=true,['Telamon!']=true,['My team']=true,['My group']=true,['Mom']
|
||||
=true,['Dad']=true,['Sister']=true,['Brother']=true,['Cousin']=true,[
|
||||
'Grandparent']=true,['Friend']=true},['Time ...']={'/sc 6_2',true,[
|
||||
'In the morning']=true,['In the afternoon']=true,['At night']=true,['Tomorrow']=
|
||||
true,['This week']=true,['This month']=true,['Sometime']=true,['Sometimes']=true
|
||||
,['Whenever you want']=true,['Never']=true,['After this']=true,['In 10 minutes']
|
||||
=true,['In a couple hours']=true,['In a couple days']=true},['Animals']={
|
||||
'/sc 6_3',true,['Cats']={['Lion']=true,['Tiger']=true,['Leopard']=true,[
|
||||
'Cheetah']=true},['Dogs']={['Wolves']=true,['Beagle']=true,['Collie']=true,[
|
||||
'Dalmatian']=true,['Poodle']=true,['Spaniel']=true,['Shepherd']=true,['Terrier']
|
||||
=true,['Retriever']=true},['Horses']={['Ponies']=true,['Stallions']=true,[
|
||||
'Pwnyz']=true},['Reptiles']={['Dinosaurs']=true,['Lizards']=true,['Snakes']=true
|
||||
,['Turtles!']=true},['Hamster']=true,['Monkey']=true,['Bears']=true,['Fish']={[
|
||||
'Goldfish']=true,['Sharks']=true,['Sea Bass']=true,['Halibut']=true,[
|
||||
'Tropical Fish']=true},['Birds']={['Eagles']=true,['Penguins']=true,['Parakeets'
|
||||
]=true,['Owls']=true,['Hawks']=true,['Pidgeons']=true},['Elephants']=true,[
|
||||
'Mythical Beasts']={['Dragons']=true,['Unicorns']=true,['Sea Serpents']=true,[
|
||||
'Sphinx']=true,['Cyclops']=true,['Minotaurs']=true,['Goblins']=true,[
|
||||
'Honest Politicians']=true,['Ghosts']=true,['Scylla and Charybdis']=true}},[
|
||||
'Games']={'/sc 6_4',true,['Action']=true,['Puzzle']=true,['Strategy']=true,[
|
||||
'Racing']=true,['RPG']=true,['Obstacle Course']=true,['Tycoon']=true,['Roblox']=
|
||||
{['BrickBattle']=true,['Community Building']=true,['Roblox Minigames']=true,[
|
||||
'Contest Place']=true},['Board games']={['Chess']=true,['Checkers']=true,[
|
||||
'Settlers of Catan']=true,['Tigris and Euphrates']=true,['El Grande']=true,[
|
||||
'Stratego']=true,['Carcassonne']=true}},['Sports']={'/sc 6_5',true,['Hockey']=
|
||||
true,['Soccer']=true,['Football']=true,['Baseball']=true,['Basketball']=true,[
|
||||
'Volleyball']=true,['Tennis']=true,['Sports team practice']=true,['Watersports']
|
||||
={['Surfing']=true,['Swimming']=true,['Water Polo']=true},['Winter sports']={[
|
||||
'Skiing']=true,['Snowboarding']=true,['Sledding']=true,['Skating']=true},[
|
||||
'Adventure']={['Rock climbing']=true,['Hiking']=true,['Fishing']=true,[
|
||||
'Horseback riding']=true},['Wacky']={['Foosball']=true,['Calvinball']=true,[
|
||||
'Croquet']=true,['Cricket']=true,['Dodgeball']=true,['Squash']=true,[
|
||||
'Trampoline']=true}},['Movies/TV']={'/sc 6_6',true,['Science Fiction']=true,[
|
||||
'Animated']={['Anime']=true},['Comedy']=true,['Romantic']=true,['Action']=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,[
|
||||
'Can I have borrow your hat?']=true,['Can I have borrow your gear?']=true},
|
||||
'/sc5'},Answers={['You need help?']={'/sc6_0',true,['Check out the news section'
|
||||
]=true,['Check out the help section']=true,['Read the wiki!']=true,[
|
||||
'All the answers are in the wiki!']=true,['I will help you with this.']=true},[
|
||||
'Some people ...']={'/sc6_1',true,Me=true,['Not me']=true,You=true,['All of us']
|
||||
=true,['Everyone but you']=true,['Builderman!']=true,['Telamon!']=true,[
|
||||
'My team']=true,['My group']=true,Mom=true,Dad=true,Sister=true,Brother=true,
|
||||
Cousin=true,Grandparent=true,Friend=true},['Time ...']={'/sc6_2',true,[
|
||||
'In the morning']=true,['In the afternoon']=true,['At night']=true,Tomorrow=true
|
||||
,['This week']=true,['This month']=true,Sometime=true,Sometimes=true,[
|
||||
'Whenever you want']=true,Never=true,['After this']=true,['In 10 minutes']=true,
|
||||
['In a couple hours']=true,['In a couple days']=true},Animals={'/sc6_3',true,
|
||||
Cats={Lion=true,Tiger=true,Leopard=true,Cheetah=true},Dogs={Wolves=true,Beagle=
|
||||
true,Collie=true,Dalmatian=true,Poodle=true,Spaniel=true,Shepherd=true,Terrier=
|
||||
true,Retriever=true},Horses={Ponies=true,Stallions=true,Pwnyz=true},Reptiles={
|
||||
Dinosaurs=true,Lizards=true,Snakes=true,['Turtles!']=true},Hamster=true,Monkey=
|
||||
true,Bears=true,Fish={Goldfish=true,Sharks=true,['Sea Bass']=true,Halibut=true,[
|
||||
'Tropical Fish']=true},Birds={Eagles=true,Penguins=true,Parakeets=true,Owls=true
|
||||
,Hawks=true,Pidgeons=true},Elephants=true,['Mythical Beasts']={Dragons=true,
|
||||
Unicorns=true,['Sea Serpents']=true,Sphinx=true,Cyclops=true,Minotaurs=true,
|
||||
Goblins=true,['Honest Politicians']=true,Ghosts=true,['Scylla and Charybdis']=
|
||||
true}},Games={'/sc6_4',true,Action=true,Puzzle=true,Strategy=true,Racing=true,
|
||||
RPG=true,['Obstacle Course']=true,Tycoon=true,Roblox={BrickBattle=true,[
|
||||
'Community Building']=true,['Roblox Minigames']=true,['Contest Place']=true},[
|
||||
'Board games']={Chess=true,Checkers=true,['Settlers of Catan']=true,[
|
||||
'Tigris and Euphrates']=true,['El Grande']=true,Stratego=true,Carcassonne=true}}
|
||||
,Sports={'/sc6_5',true,Hockey=true,Soccer=true,Football=true,Baseball=true,
|
||||
Basketball=true,Volleyball=true,Tennis=true,['Sports team practice']=true,
|
||||
Watersports={Surfing=true,Swimming=true,['Water Polo']=true},['Winter sports']={
|
||||
Skiing=true,Snowboarding=true,Sledding=true,Skating=true},Adventure={[
|
||||
'Rock climbing']=true,Hiking=true,Fishing=true,['Horseback riding']=true},Wacky=
|
||||
{Foosball=true,Calvinball=true,Croquet=true,Cricket=true,Dodgeball=true,Squash=
|
||||
true,Trampoline=true}},['Movies/TV']={'/sc6_6',true,['Science Fiction']=true,
|
||||
Animated={Anime=true},Comedy=true,Romantic=true,Action=true,Fantasy=true},Music=
|
||||
{'/sc6_7',true,Country=true,Jazz=true,Rap=true,['Hip-hop']=true,Techno=true,
|
||||
Classical=true,Pop=true,Rock=true},Hobbies={'/sc6_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,[
|
||||
'Playing piano']=true,['Playing guitar']=true,['Playing violin']=true,[
|
||||
'Playing drums']=true,['Playing a weird instrument']=true}},['Location']={
|
||||
'/sc 6_9',true,['USA']={['West']={['Alaska']=true,['Arizona']=true,['California'
|
||||
]=true,['Colorado']=true,['Hawaii']=true,['Idaho']=true,['Montana']=true,[
|
||||
'Nevada']=true,['New Mexico']=true,['Oregon']=true,['Utah']=true,['Washington']=
|
||||
true,['Wyoming']=true},['South']={['Alabama']=true,['Arkansas']=true,['Florida']
|
||||
=true,['Georgia']=true,['Kentucky']=true,['Louisiana']=true,['Mississippi']=true
|
||||
,['North Carolina']=true,['Oklahoma']=true,['South Carolina']=true,['Tennessee']
|
||||
=true,['Texas']=true,['Virginia']=true,['West Virginia']=true},['Northeast']={[
|
||||
'Connecticut']=true,['Delaware']=true,['Maine']=true,['Maryland']=true,[
|
||||
'Massachusetts']=true,['New Hampshire']=true,['New Jersey']=true,['New York']=
|
||||
true,['Pennsylvania']=true,['Rhode Island']=true,['Vermont']=true},['Midwest']={
|
||||
['Illinois']=true,['Indiana']=true,['Iowa']=true,['Kansas']=true,['Michigan']=
|
||||
true,['Minnesota']=true,['Missouri']=true,['Nebraska']=true,['North Dakota']=
|
||||
true,['Ohio']=true,['South Dakota']=true,['Wisconsin']=true}},['Canada']={[
|
||||
'Alberta']=true,['British Columbia']=true,['Manitoba']=true,['New Brunswick']=
|
||||
true,['Newfoundland']=true,['Northwest Territories']=true,['Nova Scotia']=true,[
|
||||
'Nunavut']=true,['Ontario']=true,['Prince Edward Island']=true,['Quebec']=true,[
|
||||
'Saskatchewan']=true,['Yukon']=true},['Mexico']=true,['Central America']=true,[
|
||||
'Europe']={['France']=true,['Germany']=true,['Spain']=true,['Italy']=true,[
|
||||
'Poland']=true,['Switzerland']=true,['Greece']=true,['Romania']=true,[
|
||||
'Netherlands']=true,['Great Britain']={['England']=true,['Scotland']=true,[
|
||||
'Wales']=true,['Northern Ireland']=true}},['Asia']={['China']=true,['India']=
|
||||
true,['Japan']=true,['Korea']=true,['Russia']=true,['Vietnam']=true},[
|
||||
'South America']={['Argentina']=true,['Brazil']=true},['Africa']={['Eygpt']=true
|
||||
,['Swaziland']=true},['Australia']=true,['Middle East']=true,['Antarctica']=true
|
||||
,['New Zealand']=true},['Age']={'/sc 6_10',true,['Rugrat']=true,['Kid']=true,[
|
||||
'Tween']=true,['Teen']=true,['Twenties']=true,['Old']=true,['Ancient']=true,[
|
||||
'Mesozoic']=true,["I don't want to say my age. Don't ask."]=true},['Mood']={
|
||||
'/sc 6_11',true,['Good']=true,['Great!']=true,['Not bad']=true,['Sad']=true,[
|
||||
'Hyper']=true,['Chill']=true,['Happy']=true,['Kind of mad']=true},['Boy']={
|
||||
'/sc 6_12',true},['Girl']={'/sc 6_13',true},[
|
||||
"I don't want to say boy or girl. Don't ask."]={'/sc 6_14',true},[1]='/sc 6'},[
|
||||
'Game']={["Let's build"]={'/sc 7_0',true},["Let's battle"]={'/sc 7_1',true},[
|
||||
'Nice one!']={'/sc 7_2',true},['So far so good']={'/sc 7_3',true},['Lucky shot!'
|
||||
]={'/sc 7_4',true},['Oh man!']={'/sc 7_5',true},['I challenge you to a fight!']=
|
||||
{'/sc 7_6',true},['Help me with this']={'/sc 7_7',true},["Let's go to your game"
|
||||
]={'/sc 7_8',true},['Can you show me how do to that?']={'/sc 7_9',true},[
|
||||
'Backflip!']={'/sc 7_10',true},['Frontflip!']={'/sc 7_11',true},['Dance!']={
|
||||
'/sc 7_12',true},["I'm on your side!"]={'/sc 7_13',true},['Game Commands']={
|
||||
'/sc 7_14',true,['regen']=true,['reset']=true,['go']=true,['fix']=true,[
|
||||
'respawn']=true},[1]='/sc 7'},['Silly']={['Muahahahaha!']=true,[
|
||||
'all your base are belong to me!']=true,['GET OFF MAH LAWN']=true,[
|
||||
'TEH EPIK DUCK IS COMING!!!']=true,['ROFL']=true,['1337']={true,[
|
||||
'i r teh pwnz0r!']=true,['w00t!']=true,['z0mg h4x!']=true,['ub3rR0xXorzage!']=
|
||||
true}},['Yes']={['Absolutely!']=true,['Rock on!']=true,['Totally!']=true,[
|
||||
'Juice!']=true,['Yay!']=true,['Yesh']=true},['No']={['Ummm. No.']=true,['...']=
|
||||
true,['Stop!']=true,['Go away!']=true,["Don't do that"]=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,[
|
||||
'Playing drums']=true,['Playing a weird instrument']=true}},Location={'/sc6_9',
|
||||
true,USA={West={Alaska=true,Arizona=true,California=true,Colorado=true,Hawaii=
|
||||
true,Idaho=true,Montana=true,Nevada=true,['New Mexico']=true,Oregon=true,Utah=
|
||||
true,Washington=true,Wyoming=true},South={Alabama=true,Arkansas=true,Florida=
|
||||
true,Georgia=true,Kentucky=true,Louisiana=true,Mississippi=true,[
|
||||
'North Carolina']=true,Oklahoma=true,['South Carolina']=true,Tennessee=true,
|
||||
Texas=true,Virginia=true,['West Virginia']=true},Northeast={Connecticut=true,
|
||||
Delaware=true,Maine=true,Maryland=true,Massachusetts=true,['New Hampshire']=true
|
||||
,['New Jersey']=true,['New York']=true,Pennsylvania=true,['Rhode Island']=true,
|
||||
Vermont=true},Midwest={Illinois=true,Indiana=true,Iowa=true,Kansas=true,Michigan
|
||||
=true,Minnesota=true,Missouri=true,Nebraska=true,['North Dakota']=true,Ohio=true
|
||||
,['South Dakota']=true,Wisconsin=true}},Canada={Alberta=true,['British Columbia'
|
||||
]=true,Manitoba=true,['New Brunswick']=true,Newfoundland=true,[
|
||||
'Northwest Territories']=true,['Nova Scotia']=true,Nunavut=true,Ontario=true,[
|
||||
'Prince Edward Island']=true,Quebec=true,Saskatchewan=true,Yukon=true},Mexico=
|
||||
true,['Central America']=true,Europe={France=true,Germany=true,Spain=true,Italy=
|
||||
true,Poland=true,Switzerland=true,Greece=true,Romania=true,Netherlands=true,[
|
||||
'Great Britain']={England=true,Scotland=true,Wales=true,['Northern Ireland']=
|
||||
true}},Asia={China=true,India=true,Japan=true,Korea=true,Russia=true,Vietnam=
|
||||
true},['South America']={Argentina=true,Brazil=true},Africa={Eygpt=true,
|
||||
Swaziland=true},Australia=true,['Middle East']=true,Antarctica=true,[
|
||||
'New Zealand']=true},Age={'/sc6_10',true,Rugrat=true,Kid=true,Tween=true,Teen=
|
||||
true,Twenties=true,Old=true,Ancient=true,Mesozoic=true,[
|
||||
"I don't want to say my age. Don't ask."]=true},Mood={'/sc6_11',true,Good=true,[
|
||||
'Great!']=true,['Not bad']=true,Sad=true,Hyper=true,Chill=true,Happy=true,[
|
||||
'Kind of mad']=true},Boy={'/sc6_12',true},Girl={'/sc6_13',true},[
|
||||
"I don't want to say boy or girl. Don't ask."]={'/sc6_14',true},'/sc6'},Game={[
|
||||
"Let's build"]={'/sc7_0',true},["Let's battle"]={'/sc7_1',true},['Nice one!']={
|
||||
'/sc7_2',true},['So far so good']={'/sc7_3',true},['Lucky shot!']={'/sc7_4',true
|
||||
},['Oh man!']={'/sc7_5',true},['I challenge you to a fight!']={'/sc7_6',true},[
|
||||
'Help me with this']={'/sc7_7',true},["Let's go to your game"]={'/sc7_8',true},[
|
||||
'Can you show me how do to that?']={'/sc7_9',true},['Backflip!']={'/sc7_10',true
|
||||
},['Frontflip!']={'/sc7_11',true},['Dance!']={'/sc7_12',true},[
|
||||
"I'm on your side!"]={'/sc7_13',true},['Game Commands']={'/sc7_14',true,regen=
|
||||
true,reset=true,go=true,fix=true,respawn=true},'/sc7'},Silly={['Muahahahaha!']=
|
||||
true,['all your base are belong to me!']=true,['GET OFF MAH LAWN']=true,[
|
||||
'TEH EPIK DUCK IS COMING!!!']=true,ROFL=true,['1337']={true,['i r teh pwnz0r!']=
|
||||
true,['w00t!']=true,['z0mg h4x!']=true,['ub3rR0xXorzage!']=true}},Yes={[
|
||||
'Absolutely!']=true,['Rock on!']=true,['Totally!']=true,['Juice!']=true,['Yay!']
|
||||
=true,Yesh=true},No={['Ummm. No.']=true,['...']=true,['Stop!']=true,['Go away!']
|
||||
=true,["Don't do that"]=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 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 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',
|
||||
'Level3'},SafeChatTree={},TempSpaceLabel=nil}local function GetNameValue(l)local
|
||||
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
|
||||
p=p-1 end if p%4>=2 then o=-o end m=m+o end return m%8 end function k:
|
||||
ComputeChatColor(l)return self.ChatColors[GetNameValue(l)+1].Color end function
|
||||
k:EnableScrolling(l)self.MouseOnFrame=false if self.RenderFrame then self.
|
||||
RenderFrame.MouseEnter:connect(function()local m=b.Character local n,o=
|
||||
WaitForChild(m,'Torso'),WaitForChild(m,'Head')if l then self.MouseOnFrame=true e
|
||||
.CameraType='Scriptable'Spawn(function()local p=e.CoordinateFrame.p-n.Position
|
||||
while k.MouseOnFrame do e.CoordinateFrame=CFrame.new(n.Position+p,o.Position)
|
||||
wait(0.015)end end)end end)self.RenderFrame.MouseLeave:connect(function()e.
|
||||
CameraType='Custom'self.MouseOnFrame=false end)end end function k:IsTouchDevice(
|
||||
)local l=false pcall(function()l=Game:GetService'UserInputService'.TouchEnabled
|
||||
end)return l end function k:UpdateQueue(l,m)for n=#self.MessageQueue,1,-1 do if
|
||||
self.MessageQueue[n]then for o,p in pairs(self.MessageQueue[n])do if p and type(
|
||||
p)~='table'and type(p)~='number'then if p:IsA'TextLabel'or p:IsA'TextButton'then
|
||||
if m then p.Position=p.Position-UDim2.new(0,0,m,0)else if l==self.MessageQueue[n
|
||||
]then p.Position=UDim2.new(self.Configuration.XScale,0,p.Position.Y.Scale-l[
|
||||
'Message'].Size.Y.Scale,0)Spawn(function()wait(0.05)while p.TextTransparency>=0
|
||||
do p.TextTransparency=p.TextTransparency-0.2 wait(0.03)end if p==l['Message']
|
||||
then p.TextStrokeTransparency=0.8 else p.TextStrokeTransparency=1 end end)else p
|
||||
.Position=UDim2.new(self.Configuration.XScale,0,p.Position.Y.Scale-l['Message'].
|
||||
Size.Y.Scale,0)end if p.Position.Y.Scale<-1E-2 then p.Visible=false p:Destroy()
|
||||
end end end end end end end end function k:CreateScrollBar()end function k:
|
||||
CheckIfInBounds(l)if#k.MessageQueue<3 then return true end if l>0 and k.
|
||||
MessageQueue[1]and k.MessageQueue[1]['Player']and k.MessageQueue[1]['Player'].
|
||||
Position.Y.Scale==0 then return true elseif l<0 and k.MessageQueue[1]and k.
|
||||
MessageQueue[1]['Player']and k.MessageQueue[1]['Player'].Position.Y.Scale<0 then
|
||||
return true else return false end return false end function k:ComputeSpaceString
|
||||
(l)local m=' 'if not self.TempSpaceLabel then self.TempSpaceLabel=d.Create
|
||||
'TextButton'{Size=UDim2.new(0,l.AbsoluteSize.X,0,l.AbsoluteSize.Y),FontSize=self
|
||||
.Configuration.FontSize,Parent=self.RenderFrame,BackgroundTransparency=1,Text=m,
|
||||
Name='SpaceButton'}else self.TempSpaceLabel.Text=m end while self.TempSpaceLabel
|
||||
.TextBounds.X<l.TextBounds.X do m=m..' 'self.TempSpaceLabel.Text=m end m=m..' '
|
||||
self.CachedSpaceStrings_List[l.Text]=m self.TempSpaceLabel.Text=''return m end
|
||||
function k:UpdateChat(l,m)local n={['Player']=l,['Message']=m}if coroutine.
|
||||
status(k.MessageThread)=='dead'then table.insert(k.Messages_List,n)k.
|
||||
MessageThread=coroutine.create(function()for o=1,#k.Messages_List do local p=k.
|
||||
Messages_List[o]k:CreateMessage(p['Player'],p['Message'])end k.Messages_List={}
|
||||
end)coroutine.resume(k.MessageThread)else table.insert(k.Messages_List,n)end end
|
||||
function k:RecalculateSpacing()end function k:CreateMessage(l,m)local n if not l
|
||||
then n=''else n=l.Name end m=StringTrim(m)local o,p if#self.MessageQueue>self.
|
||||
Configuration.HistoryLength then self.MessageQueue[#self.MessageQueue]=nil end o
|
||||
=d.Create'TextLabel'{Name=n,Text=n..':',FontSize=k.Configuration.FontSize,
|
||||
TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top,
|
||||
Parent=self.RenderFrame,TextWrapped=false,Size=UDim2.new(1,0,0.1,0),
|
||||
BackgroundTransparency=1,TextTransparency=1,Position=UDim2.new(0,0,1,0),
|
||||
BorderSizePixel=0,TextStrokeColor3=Color3.new(0.5,0.5,0.5),
|
||||
TextStrokeTransparency=0.75}if l.Neutral then o.TextColor3=k:ComputeChatColor(n)
|
||||
else o.TextColor3=l.TeamColor.Color end local q if not self.
|
||||
CachedSpaceStrings_List[n]then q=k:ComputeSpaceString(o)else q=self.
|
||||
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.
|
||||
'I give it a 10 out of 10!']=true}},m'SafeChat'{'Level1','Level2','Level3'},
|
||||
SafeChatTree={},TempSpaceLabel=nil},nil p=function(q)local r=0 for s=1,#q do
|
||||
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
|
||||
>=2 then t=-t end r=r+t end return r%8 end o.ComputeChatColor=function(q,r)
|
||||
return q.ChatColors[p(r)+1].Color end o.EnableScrolling=function(q,r)q.
|
||||
MouseOnFrame=false if q.RenderFrame then q.RenderFrame.MouseEnter:connect(
|
||||
function()local s=e.Character local t,u=b(s,'Torso'),b(s,'Head')if r then q.
|
||||
MouseOnFrame=true f.CameraType='Scriptable'return Spawn(function()local v=f.
|
||||
CoordinateFrame.p-t.Position while o.MouseOnFrame do f.CoordinateFrame=CFrame.
|
||||
new(t.Position+v,u.Position)wait(0.015)end end)end end)return q.RenderFrame.
|
||||
MouseLeave:connect(function()f.CameraType='Custom'q.MouseOnFrame=false end)end
|
||||
end o.IsTouchDevice=function(q)local r=false pcall(function()r=Game:GetService
|
||||
'UserInputService'.TouchEnabled end)return r end o.UpdateQueue=function(q,r,s)
|
||||
for t=#q.MessageQueue,1,-1 do if q.MessageQueue[t]then for u,v in pairs(q.
|
||||
MessageQueue[t])do if v and type(v)~='table'and type(v)~='number'then if v:IsA
|
||||
'TextLabel'or v:IsA'TextButton'then if s then v.Position=v.Position-UDim2.new(0,
|
||||
0,s,0)else if r==q.MessageQueue[t]then v.Position=UDim2.new(q.Configuration.
|
||||
XScale,0,v.Position.Y.Scale-r['Message'].Size.Y.Scale,0)Spawn(function()wait(
|
||||
0.05)while v.TextTransparency>=0 do v.TextTransparency=v.TextTransparency-0.2
|
||||
wait(0.03)end if v==r['Message']then v.TextStrokeTransparency=0.8 else v.
|
||||
TextStrokeTransparency=1 end end)else v.Position=UDim2.new(q.Configuration.
|
||||
XScale,0,v.Position.Y.Scale-r['Message'].Size.Y.Scale,0)end if v.Position.Y.
|
||||
Scale<-1E-2 then v.Visible=false v:Destroy()end end end end end end end end o.
|
||||
CreateScrollBar=function(q)end o.CheckIfInBounds=function(q,r)if#o.MessageQueue<
|
||||
3 then return true end if r>0 and o.MessageQueue[1]and o.MessageQueue[1][
|
||||
'Player']and o.MessageQueue[1]['Player'].Position.Y.Scale==0 then return true
|
||||
elseif r<0 and o.MessageQueue[1]and o.MessageQueue[1]['Player']and o.
|
||||
MessageQueue[1]['Player'].Position.Y.Scale<0 then return true else return false
|
||||
end end o.ComputeSpaceString=function(q,r)local s=' 'if not q.TempSpaceLabel
|
||||
then q.TempSpaceLabel=g('TextButton','SpaceButton',{Size=UDim2.new(0,r.
|
||||
AbsoluteSize.X,0,r.AbsoluteSize.Y),FontSize=q.Configuration.FontSize,Parent=q.
|
||||
RenderFrame,BackgroundTransparency=1,Text=s})else q.TempSpaceLabel.Text=s end
|
||||
while q.TempSpaceLabel.TextBounds.X<r.TextBounds.X do s=s..' 'q.TempSpaceLabel.
|
||||
Text=s end s=s..' 'q.CachedSpaceStrings_List[r.Text]=s q.TempSpaceLabel.Text=''
|
||||
return s end o.UpdateChat=function(q,r,s)local t={Player=r,Message=s}if
|
||||
coroutine.status(o.MessageThread)=='dead'then table.insert(o.Messages_List,t)o.
|
||||
MessageThread=coroutine.create(function()for u=1,#o.Messages_List do local v=o.
|
||||
Messages_List[u]o:CreateMessage(v['Player'],v['Message'])end o.Messages_List={}
|
||||
end)return coroutine.resume(o.MessageThread)else return table.insert(o.
|
||||
Messages_List,t)end end o.CreateMessage=function(q,r,s)local t if not r then t=
|
||||
''else t=r.Name end s=d(s)local u,v if#q.MessageQueue>q.Configuration.
|
||||
HistoryLength then q.MessageQueue[#q.MessageQueue]=nil end u=g('TextLabel',t,{
|
||||
Text=t..':',FontSize=o.Configuration.FontSize,TextXAlignment=Enum.TextXAlignment
|
||||
.Left,TextYAlignment=Enum.TextYAlignment.Top,Parent=q.RenderFrame,TextWrapped=
|
||||
false,Size=UDim2.new(1,0,0.1,0),BackgroundTransparency=1,TextTransparency=1,
|
||||
Position=UDim2.new(0,0,1,0),BorderSizePixel=0,TextStrokeColor3=Color3.new(0.5,
|
||||
0.5,0.5),TextStrokeTransparency=0.75})if r.Neutral then u.TextColor3=o:
|
||||
ComputeChatColor(t)else u.TextColor3=r.TeamColor.Color end local w if not q.
|
||||
CachedSpaceStrings_List[t]then w=o:ComputeSpaceString(u)else w=q.
|
||||
CachedSpaceStrings_List[t]end v=g('TextLabel',tostring(t)..' - message',{Size=
|
||||
UDim2.new(1,0,0.5,0),TextColor3=o.Configuration.MessageColor,FontSize=o.
|
||||
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),
|
||||
BorderSizePixel=0,TextStrokeColor3=Color3.new(0,0,0)}p.Text=q..m if not n then o
|
||||
.Text=''p.TextColor3=Color3.new(0,0.4,1)end for r,s in pairs(self.Admins_List)do
|
||||
if string.lower(s)==string.lower(n)then p.TextColor3=self.Configuration.
|
||||
AdminMessageColor end end o.Visible=true p.Visible=true local t=p.TextBounds.Y p
|
||||
.Size=UDim2.new(1,0,t/self.RenderFrame.AbsoluteSize.Y,0)o.Size=p.Size local u={}
|
||||
u['Player']=o u['Message']=p u['SpawnTime']=tick()table.insert(self.MessageQueue
|
||||
,1,u)k:UpdateQueue(u)end function k:ScreenSizeChanged()wait()while self.Frame.
|
||||
AbsoluteSize.Y>120 do self.Frame.Size=self.Frame.Size-UDim2.new(0,0,0.005,0)end
|
||||
k:RecalculateSpacing()end function k:FindButtonTree(l,m)local n={}m=m or self.
|
||||
SafeChatTree for o,p in pairs(m)do if o==l then n=m[o]elseif type(m[o])=='table'
|
||||
then n=k:FindButtonTree(l,m[o])end end return n end function k:
|
||||
ToggleSafeChatMenu(l)local m=k:FindButtonTree(l,self.SafeChatTree)if m then for
|
||||
n,o in pairs(m)do if n:IsA'TextButton'or n:IsA'ImageButton'then n.Visible=not n.
|
||||
Visible end end return true end return false end function k:
|
||||
CreateSafeChatOptions(l,m)local n,o={},0 n[m]={}n[m][1]=l[1]m=m or self.
|
||||
SafeChatButton for p,q in pairs(l)do if type(p)=='string'then local r=d.Create
|
||||
'TextButton'{Name=p,Text=p,Size=UDim2.new(0,100,0,20),TextXAlignment=Enum.
|
||||
BorderSizePixel=0,TextStrokeColor3=Color3.new(0,0,0)})v.Text=w..s if not t then
|
||||
u.Text=''v.TextColor3=Color3.new(0,0.4,1)end for x,y in pairs(q.Admins_List)do
|
||||
if string.lower(y)==string.lower(t)then v.TextColor3=q.Configuration.
|
||||
AdminMessageColor end end u.Visible=true v.Visible=true local z=v.TextBounds.Y v
|
||||
.Size=UDim2.new(1,0,z/q.RenderFrame.AbsoluteSize.Y,0)u.Size=v.Size local A={}A[
|
||||
'Player']=u A['Message']=v A['SpawnTime']=tick()table.insert(q.MessageQueue,1,A)
|
||||
return o:UpdateQueue(A)end o.ScreenSizeChanged=function(q)wait()while q.Frame.
|
||||
AbsoluteSize.Y>120 do q.Frame.Size=q.Frame.Size-UDim2.new(0,0,0.005,0)end end o.
|
||||
FindButtonTree=function(q,r,s)local t={}s=s or q.SafeChatTree for u,v in pairs(s
|
||||
)do if u==r then t=s[u]elseif type(s[u])=='table'then t=o:FindButtonTree(r,s[u])
|
||||
end end return t end o.ToggleSafeChatMenu=function(q,r)local s=o:FindButtonTree(
|
||||
r,q.SafeChatTree)if s then for t,u in pairs(s)do if t:IsA'TextButton'or t:IsA
|
||||
'ImageButton'then t.Visible=not t.Visible end end return true end return false
|
||||
end o.CreateSafeChatOptions=function(q,r,s)local t,u={},0 t[s]={}t[s][1]=r[1]s=s
|
||||
or q.SafeChatButton for v,w in pairs(r)do if type(v)=='string'then local x=g(
|
||||
'TextButton',v,{Text=v,Size=UDim2.new(0,100,0,20),TextXAlignment=Enum.
|
||||
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,
|
||||
Position=UDim2.new(0,m.Position.X.Scale+105,0,m.Position.Y.Scale-((o-3)*100))}o=
|
||||
o+1 if type(l[p])=='table'then n[m][r]=k:CreateSafeChatOptions(l[p],r)end r.
|
||||
MouseEnter:connect(function()k:ToggleSafeChatMenu(r)end)r.MouseLeave:connect(
|
||||
function()k:ToggleSafeChatMenu(r)end)r.MouseButton1Click:connect(function()local
|
||||
s=k:FindButtonTree(r)pcall(function()g:Chat(s[1])end)end)end end return n end
|
||||
function k:CreateSafeChatGui()self.SafeChatFrame=d.Create'Frame'{Name=
|
||||
'SafeChatFrame',Size=UDim2.new(1,0,1,0),Parent=self.Gui,BackgroundTransparency=1
|
||||
,d.Create'ImageButton'{Name='SafeChatButton',Size=UDim2.new(0,44,0,31),Position=
|
||||
UDim2.new(0,1,0.35,0),BackgroundTransparency=1,Image=
|
||||
'http://www.roblox.com/asset/?id=97080365'}}self.SafeChatButton=self.
|
||||
SafeChatFrame.SafeChatButton self.SafeChatTree[self.SafeChatButton]=k:
|
||||
CreateSafeChatOptions(self.SafeChat_List,self.SafeChatButton)self.SafeChatButton
|
||||
.MouseButton1Click:connect(function()k:ToggleSafeChatMenu(self.SafeChatButton)
|
||||
end)end function k:FocusOnChatBar()if self.ClickToChatButton then self.
|
||||
ClickToChatButton.Visible=false end self.GotFocus=true if self.Frame[
|
||||
'Background']then self.Frame.Background.Visible=false end self.ChatBar:
|
||||
CaptureFocus()end function k:CreateTouchButton()self.ChatTouchFrame=d.Create
|
||||
'Frame'{Name='ChatTouchFrame',Size=UDim2.new(0,128,0,32),Position=UDim2.new(0,88
|
||||
,0,0),BackgroundTransparency=1,Parent=self.Gui,d.Create'ImageButton'{Name=
|
||||
'ChatLabel',Size=UDim2.new(0,74,0,28),Position=UDim2.new(0,0,0,0),
|
||||
BackgroundTransparency=1,ZIndex=2},d.Create'ImageLabel'{Name='Background',Size=
|
||||
UDim2.new(1,0,1,0),Position=UDim2.new(0,0,0,0),BackgroundTransparency=1,Image=
|
||||
'http://www.roblox.com/asset/?id=97078724'}}self.TapToChatLabel=self.
|
||||
ChatTouchFrame.ChatLabel self.TouchLabelBackground=self.ChatTouchFrame.
|
||||
Background self.ChatBar=d.Create'TextBox'{Name='ChatBar',Size=UDim2.new(1,0,0.2,
|
||||
0),Position=UDim2.new(0,0,0.8,800),Text='',ZIndex=1,BackgroundTransparency=1,
|
||||
Parent=self.Frame,TextXAlignment=Enum.TextXAlignment.Left,TextColor3=Color3.new(
|
||||
1,1,1),ClearTextOnFocus=false}self.TapToChatLabel.MouseButton1Click:connect(
|
||||
function()self.TapToChatLabel.Visible=false self.ChatBar:CaptureFocus()self.
|
||||
GotFocus=true if self.TouchLabelBackground then self.TouchLabelBackground.
|
||||
Visible=false end end)end function k:CreateChatBar()local l,m=pcall(function()
|
||||
return h.UseLuaChat end)if a or(l and m)then self.ClickToChatButton=d.Create
|
||||
'TextButton'{Name='ClickToChat',Size=UDim2.new(1,0,0,20),BackgroundTransparency=
|
||||
1,ZIndex=2,Parent=self.Gui,Text='To chat click here or press "/" key',TextColor3
|
||||
=Color3.new(1,1,0.9),Position=UDim2.new(0,0,1,0),TextXAlignment=Enum.
|
||||
TextXAlignment.Left,FontSize=Enum.FontSize.Size12}self.ChatBar=d.Create'TextBox'
|
||||
{Name='ChatBar',Size=UDim2.new(1,0,0,20),Position=UDim2.new(0,0,1,0),Text='',
|
||||
ZIndex=1,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.25,Parent=
|
||||
self.Gui,TextXAlignment=Enum.TextXAlignment.Left,TextColor3=Color3.new(1,1,1),
|
||||
FontSize=Enum.FontSize.Size12,ClearTextOnFocus=false}local n,o=pcall(function()h
|
||||
:SetGlobalGuiInset(0,0,0,20)end)if not n then h:SetGlobalSizeOffsetPixel(0,-20)
|
||||
end h:AddSpecialKey(Enum.SpecialKey.ChatHotkey)h.SpecialKeyPressed:connect(
|
||||
function(p)if p==Enum.SpecialKey.ChatHotkey then k:FocusOnChatBar()end end)self.
|
||||
ClickToChatButton.MouseButton1Click:connect(function()k:FocusOnChatBar()end)end
|
||||
end function k:CreateGui()self.Gui=WaitForChild(f,'RobloxGui')self.Frame=d.
|
||||
Create'Frame'{Name='ChatFrame',Size=UDim2.new(0,500,0,120),Position=UDim2.new(0,
|
||||
0,0,5),BackgroundTransparency=1,ZIndex=0,Parent=self.Gui,Active=false,d.Create
|
||||
'ImageLabel'{Name='Background',Image='http://www.roblox.com/asset/?id=97120937',
|
||||
Size=UDim2.new(1.3,0,1.64,0),Position=UDim2.new(0,0,0,0),BackgroundTransparency=
|
||||
1,ZIndex=0,Visible=false},d.Create'Frame'{Name='Border',Size=UDim2.new(1,0,0,1),
|
||||
Position=UDim2.new(0,0,0.8,0),BackgroundTransparency=0,BackgroundColor3=Color3.
|
||||
new(0.9254901960784314,0.9254901960784314,0.9254901960784314),BorderSizePixel=0,
|
||||
Visible=false},d.Create'Frame'{Name='ChatRenderFrame',Size=UDim2.new(1.02,0,1.01
|
||||
,0),Position=UDim2.new(0,0,0,0),BackgroundTransparency=1,ZIndex=0,Active=false}}
|
||||
Spawn(function()wait(0.5)if IsPhone()then self.Frame.Size=UDim2.new(0,280,0,120)
|
||||
end end)self.RenderFrame=self.Frame.ChatRenderFrame if k:IsTouchDevice()then
|
||||
self.Frame.Position=self.Configuration.Position self.RenderFrame.Size=UDim2.new(
|
||||
1,0,1,0)elseif self.Frame.AbsoluteSize.Y>120 then k:ScreenSizeChanged()self.Gui.
|
||||
Changed:connect(function(l)if l=='AbsoluteSize'then k:ScreenSizeChanged()end end
|
||||
)end if a or b.ChatMode==Enum.ChatMode.TextAndMenu then if k:IsTouchDevice()then
|
||||
k:CreateTouchButton()else k:CreateChatBar()end if self.ChatBar then self.ChatBar
|
||||
.FocusLost:connect(function(l)k.GotFocus=false if k:IsTouchDevice()then self.
|
||||
ChatBar.Visible=false self.TapToChatLabel.Visible=true if self.
|
||||
TouchLabelBackground then self.TouchLabelBackground.Visible=true end end if l
|
||||
and self.ChatBar.Text~=''then local m=self.ChatBar.Text if string.sub(self.
|
||||
ChatBar.Text,1,1)=='%'then m='(TEAM) '..string.sub(m,2,#m)pcall(function()g:
|
||||
TeamChat(m)end)else pcall(function()g:Chat(m)end)end if self.ClickToChatButton
|
||||
then self.ClickToChatButton.Visible=true end self.ChatBar.Text=''end Spawn(
|
||||
function()wait(5)if not k.GotFocus then k.Frame.Background.Visible=false end end
|
||||
)end)end end end function j:OnMouseScroll()Spawn(function()while j.Speed~=0 do
|
||||
if j.Speed>1 then while j.Speed>0 do j.Speed=j.Speed-1 wait(0.25)end elseif j.
|
||||
Speed<0 then while j.Speed<0 do j.Speed=j.Speed+1 wait(0.25)end end wait(0.03)
|
||||
end end)if k:CheckIfInBounds(j.Speed)then return end k:ScrollQueue()end function
|
||||
j:ApplySpeed(l)j.Speed=j.Speed+l if not self.Simulating then j:OnMouseScroll()
|
||||
end end function j:Initialize()self.Mouse.WheelBackward:connect(function()j:
|
||||
ApplySpeed(self.Configuration.DefaultSpeed)end)self.Mouse.WheelForward:connect(
|
||||
function()j:ApplySpeed(self.Configuration.DefaultSpeed)end)end function k:
|
||||
FindMessageInSafeChat(l,m)local n=false for o,p in pairs(m)do if o==l then
|
||||
return true end if type(m[o])=='table'then n=k:FindMessageInSafeChat(l,m[o])if n
|
||||
then return true end end end return n end function k:PlayerChatted(...)local l,m
|
||||
,n={...},nil,nil if l[2]then m=l[2]end if l[3]then n=l[3]if string.sub(n,1,1)==
|
||||
'%'then n='(TEAM) '..string.sub(n,2,#n)end end if g.ClassicChat then if not(
|
||||
string.sub(n,1,3)=='/e 'or string.sub(n,1,7)=='/emote ')and(a or b.ChatMode==
|
||||
Enum.ChatMode.TextAndMenu)or(b.ChatMode==Enum.ChatMode.Menu and string.sub(n,1,3
|
||||
)=='/sc')or(k:FindMessageInSafeChat(n,self.SafeChat_List))then k:UpdateChat(m,n)
|
||||
end end end function k:CullThread()while true do if#self.MessageQueue>0 then for
|
||||
l,m in pairs(self.MessageQueue)do if m['SpawnTime']and m['Player']and m[
|
||||
'Message']and tick()-m['SpawnTime']>self.Configuration.LifeTime then m['Player']
|
||||
.Visible=false m['Message'].Visible=false end end end wait(5)end end function k:
|
||||
LockAllFields(l)local m=l:GetChildren()for n=1,#m do m[n].RobloxLocked=true if#m
|
||||
[n]:GetChildren()>0 then k:LockAllFields(m[n])end end end function k:
|
||||
CoreGuiChanged(l,m)if l==Enum.CoreGuiType.Chat or l==Enum.CoreGuiType.All then
|
||||
if self.Frame then self.Frame.Visible=m end if not k:IsTouchDevice()and self.
|
||||
ChatBar then self.ChatBar.Visible=m if m then h:SetGlobalGuiInset(0,0,0,20)else
|
||||
h:SetGlobalGuiInset(0,0,0,0)end end end end function k:Initialize()k:CreateGui()
|
||||
pcall(function()k:CoreGuiChanged(Enum.CoreGuiType.Chat,Game.StarterGui:
|
||||
GetCoreGuiEnabled(Enum.CoreGuiType.Chat))Game.StarterGui.CoreGuiChangedSignal:
|
||||
connect(function(l,m)k:CoreGuiChanged(l,m)end)end)self.EventListener=g.
|
||||
PlayerChatted:connect(function(...)k:PlayerChatted(...)end)self.MessageThread=
|
||||
coroutine.create(function()end)coroutine.resume(self.MessageThread)j:Initialize(
|
||||
)g.ChildAdded:connect(function()k.EventListener:disconnect()self.EventListener=g
|
||||
.PlayerChatted:connect(function(...)k:PlayerChatted(...)end)end)Spawn(function()
|
||||
k:CullThread()end)self.Frame.RobloxLocked=true k:LockAllFields(self.Frame)self.
|
||||
Frame.DescendantAdded:connect(function(l)k:LockAllFields(l)end)end k:Initialize(
|
||||
)
|
||||
0.5,BackgroundColor3=Color3.new(1,1,1),Parent=q.SafeChatFrame,Visible=false,
|
||||
Position=UDim2.new(0,s.Position.X.Scale+105,0,s.Position.Y.Scale-(u-3)*100)})u=u
|
||||
+1 if type(r[v])=='table'then t[s][x]=o:CreateSafeChatOptions(r[v],x)end x.
|
||||
MouseEnter:connect(function()return o:ToggleSafeChatMenu(x)end)x.MouseLeave:
|
||||
connect(function()return o:ToggleSafeChatMenu(x)end)x.MouseButton1Click:connect(
|
||||
function()local y=o:FindButtonTree(x)return pcall(function()return i:Chat(y[1])
|
||||
end)end)end end return t end o.CreateSafeChatGui=function(q)q.SafeChatFrame=g(
|
||||
'Frame','SafeChatFrame',{Size=UDim2.new(1,0,1,0),Parent=q.Gui,
|
||||
BackgroundTransparency=1,g('ImageButton','SafeChatButton',{Size=UDim2.new(0,44,0
|
||||
,31),Position=UDim2.new(0,1,0.35,0),BackgroundTransparency=1,Image=
|
||||
'http://www.roblox.com/asset/?id=97080365'})})q.SafeChatButton=q.SafeChatFrame.
|
||||
SafeChatButton q.SafeChatTree[q.SafeChatButton]=o:CreateSafeChatOptions(q.
|
||||
SafeChat_List,q.SafeChatButton)return q.SafeChatButton.MouseButton1Click:
|
||||
connect(function()return o:ToggleSafeChatMenu(q.SafeChatButton)end)end o.
|
||||
FocusOnChatBar=function(q)if q.ClickToChatButton then q.ClickToChatButton.
|
||||
Visible=false end q.GotFocus=true if q.Frame['Background']then q.Frame.
|
||||
Background.Visible=false end return q.ChatBar:CaptureFocus()end o.
|
||||
CreateTouchButton=function(q)q.ChatTouchFrame=g('Frame','ChatTouchFrame',{Size=
|
||||
UDim2.new(0,128,0,32),Position=UDim2.new(0,88,0,0),BackgroundTransparency=1,
|
||||
Parent=q.Gui,g('ImageButton','ChatLabel',{Size=UDim2.new(0,74,0,28),Position=
|
||||
UDim2.new(0,0,0,0),BackgroundTransparency=1,ZIndex=2}),g('ImageLabel',
|
||||
'Background',{Size=UDim2.new(1,0,1,0),Position=UDim2.new(0,0,0,0),
|
||||
BackgroundTransparency=1,Image='http://www.roblox.com/asset/?id=97078724'})})q.
|
||||
TapToChatLabel=q.ChatTouchFrame.ChatLabel q.TouchLabelBackground=q.
|
||||
ChatTouchFrame.Background q.ChatBar=g('TextBox','ChatBar',{Size=UDim2.new(1,0,
|
||||
0.2,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,
|
||||
1,1),ClearTextOnFocus=false})return q.TapToChatLabel.MouseButton1Click:connect(
|
||||
function()q.TapToChatLabel.Visible=false q.ChatBar:CaptureFocus()q.GotFocus=true
|
||||
if q.TouchLabelBackground then q.TouchLabelBackground.Visible=false end end)end
|
||||
o.CreateChatBar=function(q)local r,s r,s=pcall(function()return j.UseLuaChat end
|
||||
)if a or(r and s)then q.ClickToChatButton=g('TextButton','ClickToChat',{Size=
|
||||
UDim2.new(1,0,0,20),BackgroundTransparency=1,ZIndex=2,Parent=q.Gui,Text=
|
||||
'To chat click here or press "/" key',TextColor3=Color3.new(1,1,0.9),Position=
|
||||
UDim2.new(0,0,1,0),TextXAlignment=Enum.TextXAlignment.Left,FontSize=Enum.
|
||||
FontSize.Size12})q.ChatBar=g('TextBox','ChatBar',{Size=UDim2.new(1,0,0,20),
|
||||
Position=UDim2.new(0,0,1,0),Text='',ZIndex=1,BackgroundColor3=Color3.new(0,0,0),
|
||||
BackgroundTransparency=0.25,Parent=q.Gui,TextXAlignment=Enum.TextXAlignment.Left
|
||||
,TextColor3=Color3.new(1,1,1),FontSize=Enum.FontSize.Size12,ClearTextOnFocus=
|
||||
false})local t,u t,u=pcall(function()return j:SetGlobalGuiInset(0,0,0,20)end)if
|
||||
not t then j:SetGlobalSizeOffsetPixel(0,-20)end j:AddSpecialKey(Enum.SpecialKey.
|
||||
ChatHotkey)j.SpecialKeyPressed:connect(function(v)if v==Enum.SpecialKey.
|
||||
ChatHotkey then return o:FocusOnChatBar()end end)return q.ClickToChatButton.
|
||||
MouseButton1Click:connect(function()return o:FocusOnChatBar()end)end end o.
|
||||
CreateGui=function(q)q.Gui=b(h,'RobloxGui')q.Frame=g('Frame','ChatFrame',{Size=
|
||||
UDim2.new(0,500,0,120),Position=UDim2.new(0,0,0,5),BackgroundTransparency=1,
|
||||
ZIndex=0,Parent=q.Gui,Active=false,g('ImageLabel','Background',{Image=
|
||||
'http://www.roblox.com/asset/?id=97120937',Size=UDim2.new(1.3,0,1.64,0),Position
|
||||
=UDim2.new(0,0,0,0),BackgroundTransparency=1,ZIndex=0,Visible=false}),g('Frame',
|
||||
'Border',{Size=UDim2.new(1,0,0,1),Position=UDim2.new(0,0,0.8,0),
|
||||
BackgroundTransparency=0,BackgroundColor3=Color3.new(0.9254901960784314,
|
||||
0.9254901960784314,0.9254901960784314),BorderSizePixel=0,Visible=false}),g(
|
||||
'Frame','ChatRenderFrame',{Size=UDim2.new(1.02,0,1.01,0),Position=UDim2.new(0,0,
|
||||
0,0),BackgroundTransparency=1,ZIndex=0,Active=false})})Spawn(function()wait(0.5)
|
||||
if c()then q.Frame.Size=UDim2.new(0,280,0,120)end end)q.RenderFrame=q.Frame.
|
||||
ChatRenderFrame if o:IsTouchDevice()then q.Frame.Position=q.Configuration.
|
||||
Position q.RenderFrame.Size=UDim2.new(1,0,1,0)elseif q.Frame.AbsoluteSize.Y>120
|
||||
then o:ScreenSizeChanged()q.Gui.Changed:connect(function(r)if r=='AbsoluteSize'
|
||||
then return o:ScreenSizeChanged()end end)end if a or e.ChatMode==Enum.ChatMode.
|
||||
TextAndMenu then if o:IsTouchDevice()then o:CreateTouchButton()else o:
|
||||
CreateChatBar()end if q.ChatBar then return q.ChatBar.FocusLost:connect(function
|
||||
(r)o.GotFocus=false if o:IsTouchDevice()then q.ChatBar.Visible=false q.
|
||||
TapToChatLabel.Visible=true if q.TouchLabelBackground then q.
|
||||
TouchLabelBackground.Visible=true end end if r and q.ChatBar.Text~=''then local
|
||||
s=q.ChatBar.Text if string.sub(q.ChatBar.Text,1,1)=='%'then s='(TEAM) '..
|
||||
tostring(string.sub(s,2,#s))pcall(function()return i:TeamChat(s)end)else pcall(
|
||||
function()return i:Chat(s)end)end if q.ClickToChatButton then q.
|
||||
ClickToChatButton.Visible=true end q.ChatBar.Text=''end return Spawn(function()
|
||||
wait(5)if not o.GotFocus then o.Frame.Background.Visible=false end end)end)end
|
||||
end end n.OnMouseScroll=function(q)Spawn(function()while n.Speed~=0 do if n.
|
||||
Speed>1 then while n.Speed>0 do n.Speed=n.Speed-1 wait(0.25)end elseif n.Speed<0
|
||||
then while n.Speed<0 do n.Speed=n.Speed+1 wait(0.25)end end wait(0.03)end end)if
|
||||
o:CheckIfInBounds(n.Speed)then return end return o:ScrollQueue()end n.ApplySpeed
|
||||
=function(q,r)n.Speed=n.Speed+r if not q.Simulating then return n:OnMouseScroll(
|
||||
)end end n.Initialize=function(q)q.Mouse.WheelBackward:connect(function()return
|
||||
n:ApplySpeed(q.Configuration.DefaultSpeed)end)return q.Mouse.WheelForward:
|
||||
connect(function()return n:ApplySpeed(q.Configuration.DefaultSpeed)end)end o.
|
||||
FindMessageInSafeChat=function(q,r,s)local t=false for u,v in pairs(s)do if u==r
|
||||
then return true end if type(s[u])=='table'then t=o:FindMessageInSafeChat(r,s[u]
|
||||
)if t then return true end end end return t end o.PlayerChatted=function(q,...)
|
||||
local r,s,t={...},nil,nil if r[2]then s=r[2]end if r[3]then t=r[3]if string.sub(
|
||||
t,1,1)=='%'then t='(TEAM) '..tostring(string.sub(t,2,#t))end end if i.
|
||||
ClassicChat then if not(string.sub(t,1,3)=='/e 'or string.sub(t,1,7)=='/emote ')
|
||||
and(a or e.ChatMode==Enum.ChatMode.TextAndMenu)or(e.ChatMode==Enum.ChatMode.Menu
|
||||
and string.sub(t,1,3)=='/sc')or o:FindMessageInSafeChat(t,q.SafeChat_List)then
|
||||
return o:UpdateChat(s,t)end end end o.CullThread=function(q)while true do if#q.
|
||||
MessageQueue>0 then for r,s in pairs(q.MessageQueue)do if s['SpawnTime']and s[
|
||||
'Player']and s['Message']and tick()-s['SpawnTime']>q.Configuration.LifeTime then
|
||||
s['Player'].Visible=false s['Message'].Visible=false end end end wait(5)end end
|
||||
o.LockAllFields=function(q,r)local s=r:GetChildren()for t=1,#s do s[t].
|
||||
RobloxLocked=true if#s[t]:GetChildren()>0 then o:LockAllFields(s[t])end end end
|
||||
o.CoreGuiChanged=function(q,r,s)if r==Enum.CoreGuiType.Chat or r==Enum.
|
||||
CoreGuiType.All then if q.Frame then q.Frame.Visible=s end if not o:
|
||||
IsTouchDevice()and q.ChatBar then q.ChatBar.Visible=s return j:
|
||||
SetGlobalGuiInset(0,0,0,(function()if s then return 20 else return 0 end end)())
|
||||
end end end o.Initialize=function(q)o:CreateGui()pcall(function()o:
|
||||
CoreGuiChanged(Enum.CoreGuiType.Chat,Game.StarterGui:GetCoreGuiEnabled(Enum.
|
||||
CoreGuiType.Chat))return Game.StarterGui.CoreGuiChangedSignal:connect(function(r
|
||||
,s)return o:CoreGuiChanged(r,s)end)end)q.EventListener=i.PlayerChatted:connect(
|
||||
function(...)return o:PlayerChatted(...)end)q.MessageThread=coroutine.create(
|
||||
function()end)coroutine.resume(q.MessageThread)n:Initialize()i.ChildAdded:
|
||||
connect(function()o.EventListener:disconnect()q.EventListener=i.PlayerChatted:
|
||||
connect(function(...)return o:PlayerChatted(...)end)end)Spawn(function()return o
|
||||
:CullThread()end)q.Frame.RobloxLocked=true o:LockAllFields(q.Frame)return q.
|
||||
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