Improve formatting of corescripts

This commit is contained in:
Lewin Kelly 2023-05-21 07:15:00 +01:00
parent b7200e253f
commit 37d28a3999
14 changed files with 355 additions and 375 deletions

View File

@ -115,8 +115,8 @@ getRbxUtility = ->
preloadAssets = -> preloadAssets = ->
for i = 1, #assetUrls for i in *assetUrls
game\GetService"ContentProvider"\Preload assetUrls[i] game\GetService"ContentProvider"\Preload i
----------------------------- End Util Functions --------------------------------------------- ----------------------------- End Util Functions ---------------------------------------------
@ -157,12 +157,12 @@ setButtonsVisible = (...) ->
argCount = select "#", ... argCount = select "#", ...
bodyFrameChildren = purchaseDialog.BodyFrame\GetChildren! bodyFrameChildren = purchaseDialog.BodyFrame\GetChildren!
for i = 1, #bodyFrameChildren for i in *bodyFrameChildren
if bodyFrameChildren[i]\IsA "GuiButton" if i\IsA "GuiButton"
bodyFrameChildren[i].Visible = false i.Visible = false
for j = 1, argCount for j = 1, argCount
if bodyFrameChildren[i] == args[j] if i == args[j]
bodyFrameChildren[i].Visible = true i.Visible = true
break break
signalPromptEnded = (isSuccess) -> signalPromptEnded = (isSuccess) ->
@ -611,9 +611,9 @@ getToolAssetID = (assetID) ->
return newTool return newTool
toolChildren = newTool\GetChildren! toolChildren = newTool\GetChildren!
for i = 1, #toolChildren for i in *toolChildren
if toolChildren[i]\IsA "Tool" if i\IsA "Tool"
return toolChildren[i] return i
nil nil
@ -723,11 +723,12 @@ doAcceptPurchase = (_) ->
response = getRbxUtility!.DecodeJSON response response = getRbxUtility!.DecodeJSON response
if response if response
if response["success"] == false if response["success"] == false and
if response["status"] ~= "AlreadyOwned" response["status"] ~= "AlreadyOwned"
print "web return response of fail on purchase of", currentAssetId, currentProductId
purchaseFailed response["status"] == "EconomyDisabled" print "web return response of fail on purchase of", currentAssetId, currentProductId
return purchaseFailed response["status"] == "EconomyDisabled"
return
else else
print "web return response of non parsable JSON on purchase of", currentAssetId print "web return response of non parsable JSON on purchase of", currentAssetId
@ -1054,9 +1055,9 @@ cutSizeInHalfRecursive = (_) ->
--[[changeSize instance,0.5 --[[changeSize instance,0.5
children = instance\GetChildren! children = instance\GetChildren!
for i = 1, #children for i in *children
cutSizeInHalfRecursive children[i] cutSizeInHalfRecursive i
end]] ]]
doubleSizeRecursive = (_) -> doubleSizeRecursive = (_) ->
@ -1064,9 +1065,9 @@ doubleSizeRecursive = (_) ->
--[[changeSize instance,2 --[[changeSize instance,2
children = instance\GetChildren! children = instance\GetChildren!
for i = 1, #children for i in *children
doubleSizeRecursive children[i] doubleSizeRecursive i
end]] ]]
-- depending on screen size, we need to change the gui -- depending on screen size, we need to change the gui
changeGuiToScreenSize = (smallScreen) -> changeGuiToScreenSize = (smallScreen) ->

View File

@ -172,7 +172,7 @@ createButton = (actionName, functionInfoTable) ->
button = createNewButton actionName, functionInfoTable button = createNewButton actionName, functionInfoTable
local position local position
for i = 1, #buttonVector do for i = 1, #buttonVector
if buttonVector[i] == "empty" if buttonVector[i] == "empty"
position = i position = i
break break
@ -200,9 +200,9 @@ removeAction = (actionName) ->
if actionButton if actionButton
actionButton.Parent = nil actionButton.Parent = nil
for i = 1, #buttonVector for i in *buttonVector
if buttonVector[i] == actionButton if i == actionButton
buttonVector[i] = "empty" i = "empty"
break break
actionButton\Destroy! actionButton\Destroy!

View File

@ -519,8 +519,8 @@ initializeDeveloperConsole = ->
posOffset = 0 posOffset = 0
for i = 1, #childMessages for i in *childMessages
childMessages[i].Visible = false i.Visible = false
for i = 1, #messageList for i = 1, #messageList
local message local message
@ -856,8 +856,8 @@ initializeDeveloperConsole = ->
history = game\GetService"LogService"\GetLogHistory! history = game\GetService"LogService"\GetLogHistory!
for i = 1, #history for i in *history
AddLocalMessage history[i].message, history[i].messageType, history[i].timestamp AddLocalMessage i.message, i.messageType, i.timestamp
with game\GetService"LogService" with game\GetService"LogService"
.MessageOut\connect (message, messageType) -> .MessageOut\connect (message, messageType) ->

View File

@ -91,35 +91,35 @@ wait 5 -- make sure we are loaded in, won't need tool tips for first 5 seconds a
bottomLeftChildren = bottomLeftControl\GetChildren! bottomLeftChildren = bottomLeftControl\GetChildren!
for i = 1, #bottomLeftChildren for i in *bottomLeftChildren
if bottomLeftChildren[i].Name == "Exit" if i.Name == "Exit"
with exitTip = frameTip\clone! with exitTip = frameTip\clone!
.RobloxLocked = true .RobloxLocked = true
.Text = "Leave Place" .Text = "Leave Place"
.Position = UDim2.new 0, 0, -1, 0 .Position = UDim2.new 0, 0, -1, 0
.Size = UDim2.new 1, 0, 1, 0 .Size = UDim2.new 1, 0, 1, 0
.Parent = bottomLeftChildren[i] .Parent = i
setUpListeners exitTip setUpListeners exitTip
elseif bottomLeftChildren[i].Name == "SettingsButton" elseif i.Name == "SettingsButton"
createSettingsButtonTip bottomLeftChildren[i] createSettingsButtonTip i
---------------- set up Bottom Right Tool Tips ------------------------- ---------------- set up Bottom Right Tool Tips -------------------------
bottomRightChildren = bottomRightControl\GetChildren! bottomRightChildren = bottomRightControl\GetChildren!
for i = 1, #bottomRightChildren for i in *bottomRightChildren
if bottomRightChildren[i].Name\find"Camera"? if i.Name\find"Camera"?
with cameraTip = frameTip\clone! with cameraTip = frameTip\clone!
.RobloxLocked = true .RobloxLocked = true
.Text = "Camera View" .Text = "Camera View"
.Position = if bottomRightChildren[i].Name\find "Zoom" .Position = if i.Name\find "Zoom"
UDim2.new -1, 0, -1.5 UDim2.new -1, 0, -1.5
else else
UDim2.new 0, 0, -1.5, 0 UDim2.new 0, 0, -1.5, 0
.Size = UDim2.new 2, 0, 1.25, 0 .Size = UDim2.new 2, 0, 1.25, 0
.Parent = bottomRightChildren[i] .Parent = i
setUpListeners cameraTip setUpListeners cameraTip

View File

@ -138,24 +138,24 @@ while true
fire = config\FindFirstChild "Fire" fire = config\FindFirstChild "Fire"
stun = config\FindFirstChild "Stun" stun = config\FindFirstChild "Stun"
with regen do if regen with regen do if regen
delta += .Value.X delta += .Value.X
if .Value.Y >= 0 if .Value.Y >= 0
.Value = Vector3.new .Value.X + .Value.Z, .Value.Y - s, .Value.Z -- maybe have 3rd parameter be an increaser/decreaser? .Value = Vector3.new .Value.X + .Value.Z, .Value.Y - s, .Value.Z -- maybe have 3rd parameter be an increaser/decreaser?
elseif .Value.Y == -1 elseif .Value.Y == -1
.Value = Vector3.new .Value.X + .Value.Z, -1, .Value.Z .Value = Vector3.new .Value.X + .Value.Z, -1, .Value.Z
else else
\remove! \remove!
-- infinity is -1 -- infinity is -1
with poison do if poison with poison do if poison
delta -= .Value.X delta -= .Value.X
if .Value.Y >= 0 if .Value.Y >= 0
.Value = Vector3.new .Value.X + .Value.Z, .Value.Y - s, .Value.Z .Value = Vector3.new .Value.X + .Value.Z, .Value.Y - s, .Value.Z
elseif .Value.Y == -1 elseif .Value.Y == -1
.Value = Vector3.new .Value.X + .Value.Z, -1, .Value.Z .Value = Vector3.new .Value.X + .Value.Z, -1, .Value.Z
else else
\remove! \remove!
-- infinity is -1 -- infinity is -1
with ice do if ice with ice do if ice
--print "IN ICE" --print "IN ICE"
@ -182,39 +182,37 @@ while true
Torso.Anchored = true Torso.Anchored = true
currentChildren = script.Parent\GetChildren! currentChildren = script.Parent\GetChildren!
backpackTools = game.Players\GetPlayerFromCharacter(script.Parent).Backpack\GetChildren! backpackTools = game.Players\GetPlayerFromCharacter(script.Parent).Backpack\GetChildren!
for i = 1, #currentChildren for i in *currentChildren
if currentChildren[i].className == "Tool" if i.className == "Tool"
inCharTag\Clone!.Parent = currentChildren[i] inCharTag\Clone!.Parent = i
print backpackTools print backpackTools
table.insert backpackTools, currentChildren[i] table.insert backpackTools, i
for i = 1, #backpackTools for i in *backpackTools
if not backpackTools[i]\FindFirstChild"RobloxBuildTool"? if not i\FindFirstChild"RobloxBuildTool"?
hider\Clone!.Parent = backpackTools[i] hider\Clone!.Parent = i
backpackTools[i].Parent = game.Lighting i.Parent = game.Lighting
wait 0.2 wait 0.2
for i = 1, #backpackTools for i in *backpackTools
backpackTools[i].Parent = game.Players\GetPlayerFromCharacter(script.Parent).Backpack i.Parent = game.Players\GetPlayerFromCharacter(script.Parent).Backpack
stun.Value = stun.Value - s stun.Value = stun.Value - s
else else
Torso.Anchored = false Torso.Anchored = false
for i = 1, #backpackTools for i in *backpackTools
rbTool = backpackTools[i]\FindFirstChild "RobloxBuildTool" i\FindFirstChild"RobloxBuildTool"?\Remove!
if rbTool
rbTool\Remove!
backpackTools[i].Parent = game.Lighting i.Parent = game.Lighting
wait 0.2 wait 0.2
for i = 1, #backpackTools for i in *backpackTools
wasInChar = backpackTools[i]\FindFirstChild "InCharTag" wasInChar = i\FindFirstChild "InCharTag"
if wasInChar i.Parent = if wasInChar
wasInChar\Remove! wasInChar\Remove!
backpackTools[i].Parent = script.Parent script.Parent
else else
backpackTools[i].Parent = game.Players\GetPlayerFromCharacter(script.Parent).Backpack game.Players\GetPlayerFromCharacter(script.Parent).Backpack
stun\Remove! stun\Remove!
@ -224,9 +222,9 @@ while true
--health += delta * s * Humanoid.MaxHealth --health += delta * s * Humanoid.MaxHealth
health = Humanoid.Health + delta * s health = Humanoid.Health + delta * s
if health * 1.01 < Humanoid.MaxHealth Humanoid.Health = if health * 1.01 < Humanoid.MaxHealth
Humanoid.Health = health health
--myHealth.Value = math.floor Humanoid.Health --myHealth.Value = math.floor Humanoid.Health
elseif delta > 0 elseif delta > 0
Humanoid.Health = Humanoid.MaxHealth Humanoid.MaxHealth
--myHealth.Value = Humanoid.Health --myHealth.Value = Humanoid.Health

View File

@ -36,16 +36,14 @@ ScopedConnect = (parentInstance, instance, event, signalFunc, syncFunc, removeFu
--Entering the world, make sure we are connected/synced --Entering the world, make sure we are connected/synced
if not eventConnection if not eventConnection
eventConnection = instance[event]\connect signalFunc eventConnection = instance[event]\connect signalFunc
if syncFunc syncFunc?!
syncFunc!
else else
--Probably leaving the world, so disconnect for now --Probably leaving the world, so disconnect for now
if eventConnection if eventConnection
eventConnection\disconnect! eventConnection\disconnect!
if removeFunc removeFunc?!
removeFunc!
--Hook it up to ancestryChanged signal --Hook it up to ancestryChanged signal
@ -127,8 +125,7 @@ setSliderPos = (newAbsPosX, slider, sliderPosition, bar, steps) ->
cancelSlide = (areaSoak) -> cancelSlide = (areaSoak) ->
areaSoak.Visible = false areaSoak.Visible = false
if areaSoakMouseMoveCon areaSoakMouseMoveCon?\disconnect!
areaSoakMouseMoveCon\disconnect!
t.CreateStyledMessageDialog = (title, message, style, buttons) -> t.CreateStyledMessageDialog = (title, message, style, buttons) ->
@ -828,36 +825,36 @@ t.CreateTrueScrollingFrame = ->
scrollUpButton.MouseEnter\connect -> scrollUpButton.MouseEnter\connect ->
scrollUpButton.BackgroundTransparency = 0.1 scrollUpButton.BackgroundTransparency = 0.1
upChildren = scrollUpButton\GetChildren! upChildren = scrollUpButton\GetChildren!
for i = 1, #upChildren for i in *upChildren
upChildren[i].BackgroundTransparency = 0.1 i.BackgroundTransparency = 0.1
scrollUpButton.MouseLeave\connect -> scrollUpButton.MouseLeave\connect ->
scrollUpButton.BackgroundTransparency = 0.5 scrollUpButton.BackgroundTransparency = 0.5
upChildren = scrollUpButton\GetChildren! upChildren = scrollUpButton\GetChildren!
for i = 1, #upChildren for i in *upChildren
upChildren[i].BackgroundTransparency = 0.5 i.BackgroundTransparency = 0.5
scrollDownButton = scrollUpButton\clone! scrollDownButton = scrollUpButton\clone!
scrollDownButton.Name = "ScrollDownButton" scrollDownButton.Name = "ScrollDownButton"
scrollDownButton.Position = UDim2.new 0, 0, 1, -18 scrollDownButton.Position = UDim2.new 0, 0, 1, -18
downChildren = scrollDownButton\GetChildren! downChildren = scrollDownButton\GetChildren!
for i = 1, #downChildren for i in *downChildren
downChildren[i].Position = UDim2.new 0, 3 + (i - 1), 0.5, -2 + (i - 1) i.Position = UDim2.new 0, 3 + (i - 1), 0.5, -2 + (i - 1)
scrollDownButton.MouseEnter\connect -> scrollDownButton.MouseEnter\connect ->
scrollDownButton.BackgroundTransparency = 0.1 scrollDownButton.BackgroundTransparency = 0.1
downChildren = scrollDownButton\GetChildren! downChildren = scrollDownButton\GetChildren!
for i = 1, #downChildren for i in *downChildren
downChildren[i].BackgroundTransparency = 0.1 i.BackgroundTransparency = 0.1
scrollDownButton.MouseLeave\connect -> scrollDownButton.MouseLeave\connect ->
scrollDownButton.BackgroundTransparency = 0.5 scrollDownButton.BackgroundTransparency = 0.5
downChildren = scrollDownButton\GetChildren! downChildren = scrollDownButton\GetChildren!
for i = 1, #downChildren for i in *downChildren
downChildren[i].BackgroundTransparency = 0.5 i.BackgroundTransparency = 0.5
scrollDownButton.Parent = controlFrame scrollDownButton.Parent = controlFrame
@ -962,15 +959,15 @@ t.CreateTrueScrollingFrame = ->
highY = instance.AbsolutePosition.Y + instance.AbsoluteSize.Y highY = instance.AbsolutePosition.Y + instance.AbsoluteSize.Y
children = instance\GetChildren! children = instance\GetChildren!
for i = 1, #children for i in *children
drillDownSetHighLow children[i] drillDownSetHighLow i
resetHighLow = -> resetHighLow = ->
firstChildren = scrollingFrame\GetChildren! firstChildren = scrollingFrame\GetChildren!
for i = 1, #firstChildren for i in *firstChildren
drillDownSetHighLow firstChildren[i] drillDownSetHighLow i
recalculate = -> recalculate = ->
@ -991,13 +988,13 @@ t.CreateTrueScrollingFrame = ->
hiddenYAmount = (scrollingFrame.AbsoluteSize.Y - (highY - lowY)) * percentFrame hiddenYAmount = (scrollingFrame.AbsoluteSize.Y - (highY - lowY)) * percentFrame
guiChildren = scrollingFrame\GetChildren! guiChildren = scrollingFrame\GetChildren!
for i = 1, #guiChildren for i in *guiChildren
if guiChildren[i] ~= controlFrame if i ~= controlFrame
guiChildren[i].Position = UDim2.new( i.Position = UDim2.new(
guiChildren[i].Position.X.Scale, i.Position.X.Scale,
guiChildren[i].Position.X.Offset, i.Position.X.Offset,
0, 0,
math.ceil(guiChildren[i].AbsolutePosition.Y) - math.ceil lowY + hiddenYAmount math.ceil(i.AbsolutePosition.Y) - math.ceil lowY + hiddenYAmount
) )
@ -2306,11 +2303,11 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
drillDownSetZIndex = (parent, index) -> drillDownSetZIndex = (parent, index) ->
children = parent\GetChildren! children = parent\GetChildren!
for i = 1, #children for i in *children
if children[i]\IsA "GuiObject" if i\IsA "GuiObject"
children[i].ZIndex = index i.ZIndex = index
drillDownSetZIndex children[i], index drillDownSetZIndex i, index
-- for terrain stamping -- for terrain stamping
@ -2697,8 +2694,8 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
realignButtonGrid = (columns) -> realignButtonGrid = (columns) ->
x = 0 x = 0
y = 0 y = 0
for i = 1, #insertButtons for i in *insertButtons
insertButtons[i].Position = UDim2.new 0, buttonWidth * x, 0, buttonHeight * y i.Position = UDim2.new 0, buttonWidth * x, 0, buttonHeight * y
x += 1 x += 1
if x >= columns if x >= columns
x = 0 x = 0
@ -2786,12 +2783,11 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
contents = Data.Category[Data.CurrentCategory].Contents contents = Data.Category[Data.CurrentCategory].Contents
if contents if contents
-- remove our buttons and their connections -- remove our buttons and their connections
for i = 1, #insertButtons for i in *insertButtons
insertButtons[i]\remove! i\remove!
for i = 1, #insertButtonCons for i in *insertButtonCons
if insertButtonCons[i] i?\disconnect!
insertButtonCons[i]\disconnect!
insertButtonCons = {} insertButtonCons = {}
@ -2846,12 +2842,12 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
resetAllSetButtonSelection = -> resetAllSetButtonSelection = ->
setButtons = setGui.SetPanel.Sets.SetsLists\GetChildren! setButtons = setGui.SetPanel.Sets.SetsLists\GetChildren!
for i = 1, #setButtons for i in *setButtons
if setButtons[i]\IsA "TextButton" if i\IsA "TextButton"
setButtons[i].Selected = false i.Selected = false
setButtons[i].BackgroundTransparency = 1 i.BackgroundTransparency = 1
setButtons[i].TextColor3 = Color3.new 1, 1, 1 i.TextColor3 = Color3.new 1, 1, 1
setButtons[i].BackgroundColor3 = Color3.new 1, 1, 1 i.BackgroundColor3 = Color3.new 1, 1, 1
populateSetsFrame = -> populateSetsFrame = ->
@ -2939,8 +2935,8 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
userData = {} userData = {}
for id = 1, #userIdsForSets for id in *userIdsForSets
newUserData = game\GetService"InsertService"\GetUserSets userIdsForSets[id] newUserData = game\GetService"InsertService"\GetUserSets id
if newUserData and #newUserData > 2 if newUserData and #newUserData > 2
-- start at #3 to skip over My Decals and My Models for each account -- start at #3 to skip over My Decals and My Models for each account
for category = 3, #newUserData for category = 3, #newUserData
@ -3155,10 +3151,10 @@ t.CreateTerrainMaterialSelector = (size, position) ->
buttonWrap buttonWrap
for i = 1, #materialNames for i in *materialNames
imageButton = createMaterialButton materialNames[i] imageButton = createMaterialButton i
if materialNames[i] == "Grass" -- always start with grass as the default if i == "Grass" -- always start with grass as the default
selectedButton = imageButton selectedButton = imageButton
imageButton.BackgroundTransparency = 0 imageButton.BackgroundTransparency = 0
@ -3172,17 +3168,17 @@ t.CreateTerrainMaterialSelector = (size, position) ->
matName = getNameFromEnum newMaterialType matName = getNameFromEnum newMaterialType
buttons = scrollFrame\GetChildren! buttons = scrollFrame\GetChildren!
for i = 1, #buttons for i in *buttons
if buttons[i].Name == "Plastic (blue)" and matName == "Plastic (blue)" if i.Name == "Plastic (blue)" and matName == "Plastic (blue)"
goToNewMaterial buttons[i], matName goToNewMaterial i, matName
return return
if buttons[i].Name == "Plastic (red)" and matName == "Plastic (red)" if i.Name == "Plastic (red)" and matName == "Plastic (red)"
goToNewMaterial buttons[i], matName goToNewMaterial i, matName
return return
if string.find buttons[i].Name, matName if string.find i.Name, matName
goToNewMaterial buttons[i], matName goToNewMaterial i, matName
return return
frame.Changed\connect (prop) -> frame.Changed\connect (prop) ->

View File

@ -88,9 +88,9 @@ resumeGameFunction = (shield) ->
) )
delay tweenTime, -> delay tweenTime, ->
shield.Visible = false shield.Visible = false
for i = 1, #centerDialogs for i in *centerDialogs
centerDialogs[i].Visible = false i.Visible = false
game.GuiService\RemoveCenterDialog centerDialogs[i] game.GuiService\RemoveCenterDialog i
game.GuiService\RemoveCenterDialog shield game.GuiService\RemoveCenterDialog shield
settingsButton.Active = true settingsButton.Active = true
@ -106,9 +106,9 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
lastMenuSelection = {} lastMenuSelection = {}
containerChildren = container\GetChildren! containerChildren = container\GetChildren!
for i = 1, #containerChildren for i in *containerChildren
if containerChildren[i].Name == menuName if i.Name == menuName
containerChildren[i].Visible = true i.Visible = true
currentMenuSelection = currentMenuSelection =
container: container container: container
name: menuName name: menuName
@ -117,7 +117,7 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
-- selectedMenu = true -- selectedMenu = true
if size and position if size and position
containerChildren[i]\TweenSizeAndPosition( i\TweenSizeAndPosition(
size, size,
position, position,
Enum.EasingDirection.InOut, Enum.EasingDirection.InOut,
@ -126,7 +126,7 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
true true
) )
elseif size elseif size
containerChildren[i]\TweenSizeAndPosition( i\TweenSizeAndPosition(
size, size,
UDim2.new(0.5, -size.X.Offset / 2, 0.5, -size.Y.Offset / 2), UDim2.new(0.5, -size.X.Offset / 2, 0.5, -size.Y.Offset / 2),
Enum.EasingDirection.InOut, Enum.EasingDirection.InOut,
@ -135,7 +135,7 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
true true
) )
else else
containerChildren[i]\TweenPosition( i\TweenPosition(
UDim2.new(0, 0, 0, 0), UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.InOut, Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine, Enum.EasingStyle.Sine,
@ -145,7 +145,7 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
else else
if moveDirection == "left" if moveDirection == "left"
containerChildren[i]\TweenPosition( i\TweenPosition(
UDim2.new(-1, -525, 0, 0), UDim2.new(-1, -525, 0, 0),
Enum.EasingDirection.InOut, Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine, Enum.EasingStyle.Sine,
@ -153,7 +153,7 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
true true
) )
elseif moveDirection == "right" elseif moveDirection == "right"
containerChildren[i]\TweenPosition( i\TweenPosition(
UDim2.new(1, 525, 0, 0), UDim2.new(1, 525, 0, 0),
Enum.EasingDirection.InOut, Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine, Enum.EasingStyle.Sine,
@ -161,7 +161,7 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
true true
) )
elseif moveDirection == "up" elseif moveDirection == "up"
containerChildren[i]\TweenPosition( i\TweenPosition(
UDim2.new(0, 0, -1, -400), UDim2.new(0, 0, -1, -400),
Enum.EasingDirection.InOut, Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine, Enum.EasingStyle.Sine,
@ -169,7 +169,7 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
true true
) )
elseif moveDirection == "down" elseif moveDirection == "down"
containerChildren[i]\TweenPosition( i\TweenPosition(
UDim2.new(0, 0, 1, 400), UDim2.new(0, 0, 1, 400),
Enum.EasingDirection.InOut, Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine, Enum.EasingStyle.Sine,
@ -178,7 +178,7 @@ goToMenu = (container, menuName, moveDirection, size, position) ->
) )
delay tweenTime, -> delay tweenTime, ->
containerChildren[i].Visible = false i.Visible = false
resetLocalCharacter = -> resetLocalCharacter = ->
@ -279,9 +279,9 @@ recordVideoClick = (recordVideoButton, stopRecordButton) ->
backToGame = (buttonClicked, shield, settingsButton) -> backToGame = (buttonClicked, shield, settingsButton) ->
buttonClicked.Parent.Parent.Parent.Parent.Visible = false buttonClicked.Parent.Parent.Parent.Parent.Visible = false
shield.Visible = false shield.Visible = false
for i = 1, #centerDialogs for i in *centerDialogs
game.GuiService\RemoveCenterDialog centerDialogs[i] game.GuiService\RemoveCenterDialog i
centerDialogs[i].Visible = false i.Visible = false
centerDialogs = {} centerDialogs = {}
game.GuiService\RemoveCenterDialog shield game.GuiService\RemoveCenterDialog shield
@ -1487,9 +1487,9 @@ if LoadLibrary
) )
elseif #lastMenuSelection > 0 elseif #lastMenuSelection > 0
if #centerDialogs > 0 if #centerDialogs > 0
for i = 1, #centerDialogs for i in *centerDialogs
game.GuiService\RemoveCenterDialog centerDialogs[i] game.GuiService\RemoveCenterDialog i
centerDialogs[i].Visible = false i.Visible = false
centerDialogs = {} centerDialogs = {}

View File

@ -1781,8 +1781,8 @@ UpdateMaximize = ->
for _, i in ipairs MiddleFrames for _, i in ipairs MiddleFrames
if i\FindFirstChild "ClickListener" if i\FindFirstChild "ClickListener"
i.ClickListener.Size = UDim2.new 0.96, 0, i.ClickListener.Size.Y.Scale, 0 i.ClickListener.Size = UDim2.new 0.96, 0, i.ClickListener.Size.Y.Scale, 0
for j = 1, #ScoreNames, 1 for j in *ScoreNames
scoreval = ScoreNames[j] scoreval = j
if i\FindFirstChild(scoreval["Name"]) and scoreval["XOffset"] if i\FindFirstChild(scoreval["Name"]) and scoreval["XOffset"]
-- print "updateing stat position: #{scoreval["Name"]}" -- print "updateing stat position: #{scoreval["Name"]}"
i[scoreval["Name"]]\TweenPosition( i[scoreval["Name"]]\TweenPosition(
@ -2625,7 +2625,7 @@ TeamSortFunc = (a, b) ->
team team entry to sum the scores of team team entry to sum the scores of
--]] --]]
AddTeamScores = (team) -> AddTeamScores = (team) ->
for j = 1, #ScoreNames, 1 for j = 1, #ScoreNames
i = ScoreNames[j] i = ScoreNames[j]
tscore = 0 tscore = 0
for _, j in ipairs team["MyPlayers"] for _, j in ipairs team["MyPlayers"]

View File

@ -158,8 +158,7 @@ if teleportEnabled
local clickCon local clickCon
clickCon = popup.OKButton.MouseButton1Click\connect -> clickCon = popup.OKButton.MouseButton1Click\connect ->
game\GetService"TeleportService"\TeleportCancel! game\GetService"TeleportService"\TeleportCancel!
if clickCon clickCon?\disconnect!
clickCon\disconnect!
game.GuiService\RemoveCenterDialog script.Parent\FindFirstChild "Popup" game.GuiService\RemoveCenterDialog script.Parent\FindFirstChild "Popup"
popup\TweenSize( popup\TweenSize(
UDim2.new(0, 0, 0, 0), UDim2.new(0, 0, 0, 0),

View File

@ -181,8 +181,8 @@ removeGear = (gear) ->
waitForChild player, "Backpack" waitForChild player, "Backpack"
allEmpty = true allEmpty = true
for i = 1, #gearSlots for i in *gearSlots
if gearSlots[i] ~= "empty" if i ~= "empty"
allEmpty = false allEmpty = false
if allEmpty if allEmpty
@ -257,34 +257,33 @@ checkToolAncestry = (child, parent) ->
return if child\FindFirstChild "RobloxBuildTool" return if child\FindFirstChild "RobloxBuildTool"
-- don't show roblox build tools -- don't show roblox build tools
if child\IsA"Tool" or child\IsA "HopperBin" if child\IsA"Tool" or child\IsA "HopperBin"
for i = 1, #gearSlots for i in *gearSlots
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child if i ~= "empty" and i.GearReference.Value == child
if not parent? if not parent?
gearSlots[i].Kill.Value = true i.Kill.Value = true
return false return false
elseif child.Parent == player.Character elseif child.Parent == player.Character
gearSlots[i].Selected = true i.Selected = true
return true return true
elseif child.Parent == player.Backpack elseif child.Parent == player.Backpack
if child\IsA"Tool" or child\IsA "HopperBin" if child\IsA"Tool" or child\IsA "HopperBin"
gearSlots[i].Selected = false i.Selected = false
return true return true
i.Kill.Value = true
gearSlots[i].Kill.Value = true
return false return false
removeAllEquippedGear = (physGear) -> removeAllEquippedGear = (physGear) ->
stuff = player.Character\GetChildren! stuff = player.Character\GetChildren!
for i = 1, #stuff for i in *stuff
if (stuff[i]\IsA"Tool" or stuff[i]\IsA"HopperBin") and stuff[i] ~= physGear if (i\IsA"Tool" or i\IsA"HopperBin") and i ~= physGear
if stuff[i]\IsA "Tool" if i\IsA "Tool"
stuff[i].Parent = player.Backpack i.Parent = player.Backpack
if stuff[i]\IsA "HopperBin" if i\IsA "HopperBin"
stuff[i]\Disable! i\Disable!
normalizeButton = (button, speed) -> normalizeButton = (button, speed) ->
return if not button return if not button
@ -322,11 +321,11 @@ enlargeButton = (button) ->
return if not button.Parent return if not button.Parent
return if not button.Selected return if not button.Selected
for i = 1, #gearSlots for i in *gearSlots
break if gearSlots[i] == "empty" break if i == "empty"
if gearSlots[i] ~= button if i ~= button
normalizeButton gearSlots[i] normalizeButton i
return if not enlargeOverride return if not enlargeOverride
@ -427,10 +426,10 @@ activateGear = (num) ->
normalizeAllButtons = -> normalizeAllButtons = ->
for i = 1, #gearSlots for i in *gearSlots
break if gearSlots[i] == "empty" break if i == "empty"
if gearSlots[i] ~= button if i ~= button
normalizeButton gearSlots[i], 0.1 normalizeButton i, 0.1
waitForDebounce = -> waitForDebounce = ->
@ -504,11 +503,11 @@ resolveDrag = (gearClone, x, y) ->
frame = gearClone.Parent frame = gearClone.Parent
frames = frame.Parent\GetChildren! frames = frame.Parent\GetChildren!
for i = 1, #frames for i in *frames
if frames[i]\IsA"Frame" and if i\IsA"Frame" and
pointInRectangle mousePoint, frames[i].AbsolutePosition, frames[i].AbsoluteSize pointInRectangle mousePoint, i.AbsolutePosition, i.AbsoluteSize
swapGear gearClone, frames[i] swapGear gearClone, i
return true return true
if (x < frame.AbsolutePosition.x or x > (frame.AbsolutePosition.x + frame.AbsoluteSize.x)) or if (x < frame.AbsolutePosition.x or x > (frame.AbsolutePosition.x + frame.AbsoluteSize.x)) or
@ -524,17 +523,16 @@ resolveDrag = (gearClone, x, y) ->
unequipAllItems = (dontEquipThis) -> unequipAllItems = (dontEquipThis) ->
for i = 1, #gearSlots for i in *gearSlots
break if gearSlots[i] == "empty" break if i == "empty"
with gearSlots[i] if i.GearReference.Value and i.GearReference.Value ~= dontEquipThis
if .GearReference.Value and .GearReference.Value ~= dontEquipThis if i.GearReference.Value\IsA "HopperBin"
if .GearReference.Value\IsA "HopperBin" i.GearReference.Value\Disable!
.GearReference.Value\Disable! elseif i.GearReference.Value\IsA "Tool"
elseif .GearReference.Value\IsA "Tool" i.GearReference.Value.Parent = game.Players.LocalPlayer.Backpack
.GearReference.Value.Parent = game.Players.LocalPlayer.Backpack
.Selected = false i.Selected = false
showToolTip = (button, tip) -> showToolTip = (button, tip) ->
@ -576,8 +574,8 @@ addingPlayerChild = (child, equipped, addToSlot, inventoryGearButton) ->
if not addToSlot if not addToSlot
for i = 1, #gearSlots for i in *gearSlots
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child -- we already have gear, do nothing if i ~= "empty" and i.GearReference.Value == child -- we already have gear, do nothing
debounce = false debounce = false
return return
@ -677,15 +675,15 @@ addingPlayerChild = (child, equipped, addToSlot, inventoryGearButton) ->
dragBeginPos = pos dragBeginPos = pos
gearClone.ZIndex = 7 gearClone.ZIndex = 7
children = gearClone\GetChildren! children = gearClone\GetChildren!
for i = 1, #children for i in *children
if children[i]\IsA "TextLabel" if i\IsA "TextLabel"
children[i].ZIndex = if string.find children[i].Name, "Shadow" i.ZIndex = if string.find i.Name, "Shadow"
8 8
else else
9 9
elseif children[i]\IsA"Frame" or children[i]\IsA "ImageLabel" elseif i\IsA"Frame" or i\IsA "ImageLabel"
children[i].ZIndex = 7 i.ZIndex = 7
dragStop = gearClone.DragStopped\connect (x, y) -> dragStop = gearClone.DragStopped\connect (x, y) ->
@ -695,15 +693,15 @@ addingPlayerChild = (child, equipped, addToSlot, inventoryGearButton) ->
3 3
children = gearClone\GetChildren! children = gearClone\GetChildren!
for i = 1, #children for i in *children
if children[i]\IsA "TextLabel" if i\IsA "TextLabel"
children[i].ZIndex = if string.find children[i].Name, "Shadow" i.ZIndex = if string.find i.Name, "Shadow"
3 3
else else
4 4
elseif children[i]\IsA"Frame" or children[i]\IsA "ImageLabel" elseif i\IsA"Frame" or i\IsA "ImageLabel"
children[i].ZIndex = 2 i.ZIndex = 2
resolveDrag gearClone, x, y resolveDrag gearClone, x, y
@ -756,8 +754,8 @@ addingPlayerChild = (child, equipped, addToSlot, inventoryGearButton) ->
while backpackIsOpen! while backpackIsOpen!
wait 0.03 wait 0.03
for i = 1, #gearSlots for i in *gearSlots
if gearSlots[i] ~= "empty" if i ~= "empty"
backpackButton.Position = UDim2.new 0.5, -60, 1, -108 backpackButton.Position = UDim2.new 0.5, -60, 1, -108
if backpackEnabled if backpackEnabled
backpackButton.Visible = true backpackButton.Visible = true
@ -785,15 +783,15 @@ addToInventory = (child) ->
spreadOutGear = -> spreadOutGear = ->
loadoutChildren = currentLoadout\GetChildren! loadoutChildren = currentLoadout\GetChildren!
for i = 1, #loadoutChildren for i in *loadoutChildren
if loadoutChildren[i]\IsA "Frame" if i\IsA "Frame"
loadoutChildren[i].BackgroundTransparency = 0.5 i.BackgroundTransparency = 0.5
slot = tonumber string.sub loadoutChildren[i].Name, 5 slot = tonumber string.sub i.Name, 5
if slot == 0 if slot == 0
slot = 10 slot = 10
if robloxGui.AbsoluteSize.Y <= 320 if robloxGui.AbsoluteSize.Y <= 320
loadoutChildren[i]\TweenPosition( i\TweenPosition(
UDim2.new(0, (slot - 1) * 60, 0, 0), UDim2.new(0, (slot - 1) * 60, 0, 0),
Enum.EasingDirection.Out, Enum.EasingDirection.Out,
Enum.EasingStyle.Quad, Enum.EasingStyle.Quad,
@ -801,7 +799,7 @@ spreadOutGear = ->
true true
) )
else else
loadoutChildren[i]\TweenPosition( i\TweenPosition(
UDim2.new((slot - 1) / 10, 0, 0, 0), UDim2.new((slot - 1) / 10, 0, 0, 0),
Enum.EasingDirection.Out, Enum.EasingDirection.Out,
Enum.EasingStyle.Quad, Enum.EasingStyle.Quad,
@ -815,16 +813,16 @@ centerGear = ->
gearButtons = {} gearButtons = {}
local lastSlotAdd local lastSlotAdd
for i = 1, #loadoutChildren for i in *loadoutChildren
if loadoutChildren[i]\IsA "Frame" if i\IsA "Frame"
if #loadoutChildren[i]\GetChildren! > 0 if #i\GetChildren! > 0
if loadoutChildren[i].Name == "Slot0" if i.Name == "Slot0"
lastSlotAdd = loadoutChildren[i] lastSlotAdd = i
else else
table.insert gearButtons, loadoutChildren[i] table.insert gearButtons, i
loadoutChildren[i].BackgroundTransparency = 1 i.BackgroundTransparency = 1
if lastSlotAdd if lastSlotAdd
@ -949,11 +947,10 @@ delay 2, ->
--while true --while true
if not backpackWasOpened if not backpackWasOpened
if robloxGui.AbsoluteSize.Y <= 320 if robloxGui.AbsoluteSize.Y <= 320
cChildren = currentLoadout\GetChildren! for i in *currentLoadout\GetChildren!
for i = 1, #cChildren slotNum = tonumber string.sub i.Name, 5, string.len i.Name
slotNum = tonumber string.sub cChildren[i].Name, 5, string.len cChildren[i].Name
if type(slotNum) == "number" if type(slotNum) == "number"
cChildren[i].Position = UDim2.new 0, (slotNum - 1) * 60, 0, 0 i.Position = UDim2.new 0, (slotNum - 1) * 60, 0, 0
wait 0.25 wait 0.25
@ -984,10 +981,10 @@ humanoidDiedCon = player.Character.Humanoid.Died\connect ->
player.CharacterRemoving\connect -> player.CharacterRemoving\connect ->
for i = 1, #gearSlots for i in *gearSlots
if gearSlots[i] ~= "empty" if i ~= "empty"
gearSlots[i].Parent = nil i.Parent = nil
gearSlots[i] = "empty" i = "empty"
player.CharacterAdded\connect -> player.CharacterAdded\connect ->
@ -1040,10 +1037,10 @@ player.CharacterAdded\connect ->
(robloxGui.AbsoluteSize.Y <= 320) (robloxGui.AbsoluteSize.Y <= 320)
cChildren = currentLoadout\GetChildren! cChildren = currentLoadout\GetChildren!
for i = 1, #cChildren for i in *cChildren
slotNum = tonumber string.sub cChildren[i].Name, 5, string.len cChildren[i].Name slotNum = tonumber string.sub i.Name, 5, string.len i.Name
if type(slotNum) == "number" if type(slotNum) == "number"
cChildren[i].Position = UDim2.new 0, (slotNum - 1) * 60, 0, 0 i.Position = UDim2.new 0, (slotNum - 1) * 60, 0, 0
wait 0.25 wait 0.25

View File

@ -94,8 +94,8 @@ rotatePartAndChildren = (part, rotCF, offsetFromOrigin) ->
-- recursively do the same to all children -- recursively do the same to all children
partChildren = part\GetChildren! partChildren = part\GetChildren!
for c = 1, #partChildren for c in *partChildren
rotatePartAndChildren partChildren[c], rotCF, offsetFromOrigin rotatePartAndChildren c, rotCF, offsetFromOrigin
modelRotate = (model, yAngle) -> modelRotate = (model, yAngle) ->
rotCF = CFrame.Angles 0, yAngle, 0 rotCF = CFrame.Angles 0, yAngle, 0
@ -161,8 +161,8 @@ findSeatsInModel = (parent, seatTable) ->
table.insert seatTable, parent table.insert seatTable, parent
myChildren = parent\GetChildren! myChildren = parent\GetChildren!
for j = 1, #myChildren for j in *myChildren
findSeatsInModel myChildren[j], seatTable findSeatsInModel j, seatTable
setSeatEnabledStatus = (model, isEnabled) -> setSeatEnabledStatus = (model, isEnabled) ->
@ -171,19 +171,19 @@ setSeatEnabledStatus = (model, isEnabled) ->
if isEnabled if isEnabled
-- remove any welds called "SeatWeld" in seats -- remove any welds called "SeatWeld" in seats
for i = 1, #seatList for i in *seatList
nextSeat = seatList[i]\FindFirstChild "SeatWeld" nextSeat = i\FindFirstChild "SeatWeld"
while nextSeat while nextSeat
nextSeat\Remove! nextSeat\Remove!
nextSeat = seatList[i]\FindFirstChild "SeatWeld" nextSeat = i\FindFirstChild "SeatWeld"
else else
-- put a weld called "SeatWeld" in every seat -- put a weld called "SeatWeld" in every seat
-- this tricks it into thinking there's already someone sitting there, and it won't make you sit XD -- this tricks it into thinking there's already someone sitting there, and it won't make you sit XD
for i = 1, #seatList for i in *seatList
New "Weld", "SeatWeld" New "Weld", "SeatWeld"
Parent: seatList[i] Parent: i
autoAlignToFace = (parts) -> autoAlignToFace = (parts) ->
@ -404,8 +404,8 @@ spaceAboveCharacter = (charTorso, newTorsoY, stampData) ->
100 100
) )
for j = 1, #partsAboveChar for j in *partsAboveChar
if partsAboveChar[j].CanCollide and not partsAboveChar[j]\IsDescendantOf stampData.CurrentParts if j.CanCollide and not j\IsDescendantOf stampData.CurrentParts
return false return false
if clusterPartsInRegion( if clusterPartsInRegion(
@ -510,12 +510,12 @@ findConfigAtMouseTarget = (Mouse, stampData) ->
--[[if targetPart.Parent\IsA "Model" --[[if targetPart.Parent\IsA "Model"
hitFace = modelTargetSurface(targetPart.Parent, Mouse.Hit.p, game.Workspace.CurrentCamera.CoordinateFrame.p) -- best, if you get it right hitFace = modelTargetSurface(targetPart.Parent, Mouse.Hit.p, game.Workspace.CurrentCamera.CoordinateFrame.p) -- best, if you get it right
WORLD_AXES = { Vector3.new(1, 0, 0), Vector3.new(0, 1, 0), Vector3.new(0, 0, 1) } WORLD_AXES = { Vector3.new(1, 0, 0), Vector3.new(0, 1, 0), Vector3.new(0, 0, 1) }
if hitFace > 0 targetVectorInWorld = if hitFace > 0
targetVectorInWorld = targetCFrame\vectorToWorldSpace WORLD_AXES[hitFace] targetCFrame\vectorToWorldSpace WORLD_AXES[hitFace]
elseif hitFace < 0 elseif hitFace < 0
targetVectorInWorld = targetCFrame\vectorToWorldSpace -WORLD_AXES[-hitFace] targetCFrame\vectorToWorldSpace -WORLD_AXES[-hitFace]
end]] ]]
local targetRefPointInTarget, insertRefPointInInsert local targetRefPointInTarget, insertRefPointInInsert
@ -613,8 +613,8 @@ saveTheWelds = (object, manualWeldTable, manualWeldParentTable) ->
table.insert manualWeldParentTable, object.Parent table.insert manualWeldParentTable, object.Parent
else else
children = object\GetChildren! children = object\GetChildren!
for i = 1, #children for i in *children
saveTheWelds children[i], manualWeldTable, manualWeldParentTable saveTheWelds i, manualWeldTable, manualWeldParentTable
restoreTheWelds = (manualWeldTable, manualWeldParentTable) -> restoreTheWelds = (manualWeldTable, manualWeldParentTable) ->
@ -1399,7 +1399,7 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
for _, script in pairs scripts for _, script in pairs scripts
if not script.Disabled if not script.Disabled
script.Disabled = true script.Disabled = true
stampData.DisabledScripts[#stampData.DisabledScripts + 1] = script stampData.DisabledScripts[] = script
for _, part in pairs parts for _, part in pairs parts
@ -1502,8 +1502,8 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
skipThisCell = false skipThisCell = false
for b = 1, #cellBlockingParts for b in *cellBlockingParts
if isBlocker cellBlockingParts[b] if isBlocker b
skipThisCell = true skipThisCell = true
break break
@ -1512,15 +1512,15 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
-- pop players up above any set cells -- pop players up above any set cells
alreadyPushedUp = {} alreadyPushedUp = {}
-- if no blocking model below, then see if stamping on top of a character -- if no blocking model below, then see if stamping on top of a character
for b = 1, #cellBlockingParts for b in *cellBlockingParts
if cellBlockingParts[b].Parent and if b.Parent and
not alreadyPushedUp[cellBlockingParts[b].Parent] and not alreadyPushedUp[b.Parent] and
cellBlockingParts[b].Parent\FindFirstChild "Humanoid" and b.Parent\FindFirstChild "Humanoid" and
cellBlockingParts[b].Parent\FindFirstChild"Humanoid"\IsA "Humanoid" b.Parent\FindFirstChild"Humanoid"\IsA "Humanoid"
----------------------------------------------------------------------------------- -----------------------------------------------------------------------------------
blockingPersonTorso = cellBlockingParts[b].Parent\FindFirstChild "Torso" blockingPersonTorso = b.Parent\FindFirstChild "Torso"
alreadyPushedUp[cellBlockingParts[b].Parent] = true alreadyPushedUp[b.Parent] = true
if blockingPersonTorso if blockingPersonTorso
-- if so, let's push the person upwards so they pop on top of the stamped model/part (but only if there's space above them) -- if so, let's push the person upwards so they pop on top of the stamped model/part (but only if there's space above them)
@ -1621,20 +1621,20 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
math.floor lines[i].Z + 0.5 math.floor lines[i].Z + 0.5
) -- round to integers ) -- round to integers
if lines[i].X > 0 xInc[i] = if lines[i].X > 0
xInc[i] = 1 1
elseif lines[i].X < 0 elseif lines[i].X < 0
xInc[i] = -1 -1
if lines[i].Y > 0 yInc[i] = if lines[i].Y > 0
yInc[i] = 1 1
elseif lines[i].Y < 0 elseif lines[i].Y < 0
yInc[i] = -1 -1
if lines[i].Z > 0 zInc[i] = if lines[i].Z > 0
zInc[i] = 1 1
elseif lines[i].Z < 0 elseif lines[i].Z < 0
zInc[i] = -1 -1
incrementVect[i] = Vector3.new xInc[i], yInc[i], zInc[i] incrementVect[i] = Vector3.new xInc[i], yInc[i], zInc[i]
@ -1767,16 +1767,13 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
error "Error: RbxStamper.DoStamperMouseUp: Mouse is of type", Mouse.className, "should be of type Mouse" error "Error: RbxStamper.DoStamperMouseUp: Mouse is of type", Mouse.className, "should be of type Mouse"
return false return false
if not stampData.Dragger if not stampData.Dragger
error "Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil" error "Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil"
return false return false
if not HighScalabilityLine if not HighScalabilityLine
return false return false
local checkHighScalabilityStamp local checkHighScalabilityStamp
if stampInModel if stampInModel
local canStamp local canStamp
@ -1834,23 +1831,23 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
100 100
) )
for b = 1, #blockingParts for b in *blockingParts
if isBlocker blockingParts[b] if isBlocker b
flashRedBox! flashRedBox!
return false return false
alreadyPushedUp = {} alreadyPushedUp = {}
-- if no blocking model below, then see if stamping on top of a character -- if no blocking model below, then see if stamping on top of a character
for b = 1, #blockingParts for b in *blockingParts
if blockingParts[b].Parent and if b.Parent and
not alreadyPushedUp[blockingParts[b].Parent] and not alreadyPushedUp[b.Parent] and
blockingParts[b].Parent\FindFirstChild"Humanoid" and b.Parent\FindFirstChild"Humanoid" and
blockingParts[b].Parent\FindFirstChild"Humanoid"\IsA "Humanoid" b.Parent\FindFirstChild"Humanoid"\IsA "Humanoid"
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
blockingPersonTorso = blockingParts[b].Parent\FindFirstChild "Torso" blockingPersonTorso = b.Parent\FindFirstChild "Torso"
alreadyPushedUp[blockingParts[b].Parent] = true alreadyPushedUp[b.Parent] = true
if blockingPersonTorso if blockingPersonTorso
-- if so, let's push the person upwards so they pop on top of the stamped model/part (but only if there's space above them) -- if so, let's push the person upwards so they pop on top of the stamped model/part (but only if there's space above them)
@ -2115,9 +2112,9 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
true true
pauseStamper = -> pauseStamper = ->
for i = 1, #mouseCons -- stop the mouse from doing anything for i in *mouseCons -- stop the mouse from doing anything
mouseCons[i]\disconnect! i\disconnect!
mouseCons[i] = nil i = nil
mouseCons = {} mouseCons = {}
@ -2144,9 +2141,7 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
surfaceNormal = isPositive * modelCFrame\vectorToWorldSpace AXIS_VECTORS[whichSurface] surfaceNormal = isPositive * modelCFrame\vectorToWorldSpace AXIS_VECTORS[whichSurface]
for i = 1, #parts for currPart in *parts
currPart = parts[i]
-- now just need to find which surface of currPart most closely match surfaceNormal and then set that to Unjoinable -- now just need to find which surface of currPart most closely match surfaceNormal and then set that to Unjoinable
surfaceNormalInLocalCoords = currPart.CFrame\vectorToObjectSpace surfaceNormal surfaceNormalInLocalCoords = currPart.CFrame\vectorToObjectSpace surfaceNormal
if math.abs(surfaceNormalInLocalCoords.X) > math.abs surfaceNormalInLocalCoords.Y if math.abs(surfaceNormalInLocalCoords.X) > math.abs surfaceNormalInLocalCoords.Y
@ -2186,10 +2181,10 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
if unjoinableTag if unjoinableTag
for unjoinableSurface in string.gmatch unjoinableTag.Value, "[^,]*" for unjoinableSurface in string.gmatch unjoinableTag.Value, "[^,]*"
if tonumber unjoinableSurface if tonumber unjoinableSurface
if clone\IsA "Model" prepareUnjoinableSurfaces if clone\IsA "Model"
prepareUnjoinableSurfaces clone\GetModelCFrame!, parts, tonumber unjoinableSurface clone\GetModelCFrame!, parts, tonumber unjoinableSurface
else else
prepareUnjoinableSurfaces clone.CFrame, parts, tonumber unjoinableSurface clone.CFrame, parts, tonumber unjoinableSurface
stampData.ErrorBox = errorBox stampData.ErrorBox = errorBox
@ -2211,10 +2206,10 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
mouseTarget = Mouse.Target mouseTarget = Mouse.Target
if mouseTarget and not mouseTarget.Parent\FindFirstChild"RobloxModel"? game.JointsService\SetJoinAfterMoveTarget if mouseTarget and not mouseTarget.Parent\FindFirstChild"RobloxModel"?
game.JointsService\SetJoinAfterMoveTarget mouseTarget mouseTarget
else else
game.JointsService\SetJoinAfterMoveTarget nil nil
game.JointsService\ShowPermissibleJoints! game.JointsService\ShowPermissibleJoints!
@ -2318,9 +2313,9 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
-- High-Scalability and with the new model orientation setting methods (model\ResetOrientationToIdentity!) [HotThoth] -- High-Scalability and with the new model orientation setting methods (model\ResetOrientationToIdentity!) [HotThoth]
control.Destroy = -> -- Stops current Stamp operation and destroys control construct control.Destroy = -> -- Stops current Stamp operation and destroys control construct
for i = 1, #mouseCons for i in *mouseCons
mouseCons[i]\disconnect! i\disconnect!
mouseCons[i] = nil i = nil
keyCon?\disconnect! keyCon?\disconnect!

View File

@ -187,24 +187,23 @@ clearHighlight = (button) ->
inLoadout = (gear) -> inLoadout = (gear) ->
children = currentLoadout\GetChildren! children = currentLoadout\GetChildren!
for i = 1, #children for i in *children
if children[i]\IsA "Frame" if i\IsA "Frame"
button = children[i]\GetChildren! button = i\GetChildren!
if #button > 0 and if #button > 0 and
button[1].GearReference.Value and button[1].GearReference.Value and
button[1].GearReference.Value == gear button[1].GearReference.Value == gear
return true
return true
false false
updateGridActive = -> updateGridActive = ->
for _, v in pairs backpackItems for _, v in pairs backpackItems
if buttons[v] if buttons[v]
local gear
gearRef = buttons[v]\FindFirstChild "GearReference" gearRef = buttons[v]\FindFirstChild "GearReference"
if gearRef gear = gearRef?.Value
gear = gearRef.Value
buttons[v].Active = if (not gear) or inLoadout gear buttons[v].Active = if (not gear) or inLoadout gear
false false
@ -232,9 +231,9 @@ UnequipGearMenuClick = (element, menu) ->
gearToUnequip = inventoryButton.GearReference.Value gearToUnequip = inventoryButton.GearReference.Value
loadoutChildren = currentLoadout\GetChildren! loadoutChildren = currentLoadout\GetChildren!
slot = -1 slot = -1
for i = 1, #loadoutChildren for i in *loadoutChildren
if loadoutChildren[i]\IsA "Frame" if i\IsA "Frame"
button = loadoutChildren[i]\GetChildren! button = i\GetChildren!
if button[1] and button[1].GearReference.Value == gearToUnequip if button[1] and button[1].GearReference.Value == gearToUnequip
slot = button[1].SlotNumber.Text slot = button[1].SlotNumber.Text
break break
@ -367,9 +366,9 @@ getGearContextMenu = ->
findEmptySlot = -> findEmptySlot = ->
local smallestNum local smallestNum
loadout = currentLoadout\GetChildren! loadout = currentLoadout\GetChildren!
for i = 1, #loadout for i in *loadout
if loadout[i]\IsA"Frame" and #loadout[i]\GetChildren! <= 0 if i\IsA"Frame" and #i\GetChildren! <= 0
frameNum = tonumber string.sub loadout[i].Name, 5 frameNum = tonumber string.sub i.Name, 5
if frameNum == 0 if frameNum == 0
frameNum = 10 frameNum = 10
@ -383,15 +382,15 @@ findEmptySlot = ->
checkForSwap = (button, x, y) -> checkForSwap = (button, x, y) ->
loadoutChildren = currentLoadout\GetChildren! loadoutChildren = currentLoadout\GetChildren!
for i = 1, #loadoutChildren for i in *loadoutChildren
if loadoutChildren[i]\IsA"Frame" and string.find loadoutChildren[i].Name, "Slot" if i\IsA"Frame" and string.find i.Name, "Slot"
if x >= loadoutChildren[i].AbsolutePosition.x and if x >= i.AbsolutePosition.x and
x <= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x) x <= (i.AbsolutePosition.x + i.AbsoluteSize.x)
if y >= loadoutChildren[i].AbsolutePosition.y and if y >= i.AbsolutePosition.y and
y <= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y) y <= (i.AbsolutePosition.y + i.AbsoluteSize.y)
slot = tonumber string.sub loadoutChildren[i].Name, 5 slot = tonumber string.sub i.Name, 5
swapGearSlot slot, button swapGearSlot slot, button
return true return true
false false
@ -563,12 +562,12 @@ showEntireGrid = ->
centerGear = (loadoutChildren) -> centerGear = (loadoutChildren) ->
gearButtons = {} gearButtons = {}
local lastSlotAdd local lastSlotAdd
for i = 1, #loadoutChildren for i in *loadoutChildren
if loadoutChildren[i]\IsA"Frame" and #loadoutChildren[i]\GetChildren! > 0 if i\IsA"Frame" and #i\GetChildren! > 0
if loadoutChildren[i].Name == "Slot0" if i.Name == "Slot0"
lastSlotAdd = loadoutChildren[i] lastSlotAdd = i
else else
table.insert gearButtons, loadoutChildren[i] table.insert gearButtons, i
if lastSlotAdd if lastSlotAdd
table.insert gearButtons, lastSlotAdd table.insert gearButtons, lastSlotAdd
@ -627,9 +626,9 @@ loadoutCheck = (child, selectState) ->
-- removeAllEquippedGear = (physGear) -> -- removeAllEquippedGear = (physGear) ->
-- stuff = player.Character\GetChildren! -- stuff = player.Character\GetChildren!
-- for i = 1, #stuff -- for i in *stuff
-- if (stuff[i]\IsA"Tool" or stuff[i]\IsA"HopperBin") and stuff[i] ~= physGear -- if (i\IsA"Tool" or stuff[i]\IsA"HopperBin") and i ~= physGear
-- stuff[i].Parent = playerBackpack -- i.Parent = playerBackpack
-- equipGear = (physGear) -> -- equipGear = (physGear) ->
-- removeAllEquippedGear physGear -- removeAllEquippedGear physGear
@ -644,8 +643,8 @@ setupCharacterConnections = ->
-- make sure we get all the children -- make sure we get all the children
backpackChildren = game.Players.LocalPlayer.Backpack\GetChildren! backpackChildren = game.Players.LocalPlayer.Backpack\GetChildren!
for i = 1, #backpackChildren for i in *backpackChildren
addToGrid backpackChildren[i] addToGrid i
characterChildAddedCon?\disconnect! characterChildAddedCon?\disconnect!
@ -672,8 +671,8 @@ filterGear = (terms) ->
for _, v in pairs backpackItems for _, v in pairs backpackItems
if buttons[v] if buttons[v]
gearString = trim string.lower buttons[v].GearReference.Value.Name gearString = trim string.lower buttons[v].GearReference.Value.Name
for i = 1, #terms for i in *terms
if string.match gearString, terms[i] if string.match gearString, i
table.insert filteredGear, buttons[v] table.insert filteredGear, buttons[v]
break break
@ -718,8 +717,8 @@ nukeBackpack = ->
backpackItems = {} backpackItems = {}
scrollingFrameChildren = grid.ScrollingFrame\GetChildren! scrollingFrameChildren = grid.ScrollingFrame\GetChildren!
for i = 1, #scrollingFrameChildren for i in *scrollingFrameChildren
scrollingFrameChildren[i]\remove! i\remove!
coreGuiChanged = (coreGuiType, enabled) -> coreGuiChanged = (coreGuiType, enabled) ->
if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All
@ -728,8 +727,8 @@ coreGuiChanged = (coreGuiType, enabled) ->
backpackChildren = player.Backpack\GetChildren! backpackChildren = player.Backpack\GetChildren!
for i = 1, #backpackChildren for i in *backpackChildren
addToGrid backpackChildren[i] addToGrid i
------------------------- Start Lifelong Connections ----------------------- ------------------------- Start Lifelong Connections -----------------------
@ -784,10 +783,10 @@ swapSlot.Changed\connect ->
updateGridActive! updateGridActive!
loadoutChildren = currentLoadout\GetChildren! loadoutChildren = currentLoadout\GetChildren!
for i = 1, #loadoutChildren for i in *loadoutChildren
if loadoutChildren[i]\IsA"Frame" and string.find loadoutChildren[i].Name, "Slot" if i\IsA"Frame" and string.find i.Name, "Slot"
loadoutChildren[i].ChildRemoved\connect -> updateGridActive! i.ChildRemoved\connect -> updateGridActive!
loadoutChildren[i].ChildAdded\connect -> updateGridActive! i.ChildAdded\connect -> updateGridActive!
------------------------- End Lifelong Connections ----------------------- ------------------------- End Lifelong Connections -----------------------
@ -802,8 +801,8 @@ resizeGrid!
-- make sure any items in the loadout are accounted for in inventory -- make sure any items in the loadout are accounted for in inventory
loadoutChildren = currentLoadout\GetChildren! loadoutChildren = currentLoadout\GetChildren!
for i = 1, #loadoutChildren for i in *loadoutChildren
loadoutCheck loadoutChildren[i], false loadoutCheck i, false
if not backpack.Visible if not backpack.Visible
centerGear currentLoadout\GetChildren! centerGear currentLoadout\GetChildren!

View File

@ -124,8 +124,7 @@ deactivateBackpack = ->
active = false active = false
initHumanoidDiedConnections = -> initHumanoidDiedConnections = ->
if humanoidDiedCon humanoidDiedCon?\disconnect!
humanoidDiedCon\disconnect!
waitForProperty game.Players.LocalPlayer, "Character" waitForProperty game.Players.LocalPlayer, "Character"
waitForChild game.Players.LocalPlayer.Character, "Humanoid" waitForChild game.Players.LocalPlayer.Character, "Humanoid"
@ -215,9 +214,9 @@ toggleBackpack = ->
hideBackpack! hideBackpack!
clChildren = currentLoadout\GetChildren! clChildren = currentLoadout\GetChildren!
for i = 1, #clChildren for i in *clChildren
if clChildren[i] and clChildren[i]\IsA "Frame" if i and i\IsA "Frame"
frame = clChildren[i] frame = i
if #frame\GetChildren! > 0 if #frame\GetChildren! > 0
backpackButton.Position = UDim2.new 0.5, -60, 1, -108 backpackButton.Position = UDim2.new 0.5, -60, 1, -108
backpackButton.Visible = true backpackButton.Visible = true

View File

@ -970,10 +970,10 @@ GetNameValue = (pName) ->
cValue = string.byte string.sub pName, index, index cValue = string.byte string.sub pName, index, index
reverseIndex = #pName - index + 1 reverseIndex = #pName - index + 1
if #pName % 2 == 1 if #pName % 2 == 1
reverseIndex = reverseIndex - 1 reverseIndex -= 1
if reverseIndex % 4 >= 2 if reverseIndex % 4 >= 2
cValue = -cValue cValue = -cValue
value = value + cValue value += cValue
value % 8 value % 8
Chat.ComputeChatColor = (pName) => Chat.ComputeChatColor = (pName) =>
@ -1007,8 +1007,6 @@ Chat.EnableScrolling = (toggle) =>
-- Chat.OnScroll = (speed) => -- Chat.OnScroll = (speed) =>
-- if @MouseOnFrame -- if @MouseOnFrame
-- -- -- --
-- end
-- end
-- Check if we are running on a touch device -- Check if we are running on a touch device
Chat.IsTouchDevice ==> Chat.IsTouchDevice ==>
@ -1019,16 +1017,16 @@ Chat.IsTouchDevice ==>
-- Scrolling -- Scrolling
-- Chat.ScrollQueue = (value) => -- Chat.ScrollQueue = (value) =>
-- for i = 1, #@MessageQueue -- for i in *@MessageQueue
-- if @MessageQueue[i] -- if i
-- for _, label in pairs @MessageQueue[i] -- for _, label in pairs i
-- next = @MessageQueue[i].Next -- next = i.Next
-- previous = @MessageQueue[i].Previous -- previous = i.Previous
-- if label and label\IsA('TextLabel') or label\IsA 'TextButton' -- if label and label\IsA('TextLabel') or label\IsA 'TextButton'
-- if value > 0 and previous and previous['Message'] -- label.Position = if value > 0 and previous and previous['Message']
-- label.Position = previous['Message'].Position -- previous['Message'].Position
-- elseif value < 1 and next['Message'] -- elseif value < 1 and next['Message']
-- label.Position = previous['Message'].Position -- previous['Message'].Position
-- Handles the rendering of the text objects in their appropriate places -- Handles the rendering of the text objects in their appropriate places
Chat.UpdateQueue = (field, diff) => Chat.UpdateQueue = (field, diff) =>
@ -1128,8 +1126,7 @@ Chat.UpdateChat = (cPlayer, message) =>
--Chat.Messages_List = {} --Chat.Messages_List = {}
table.insert Chat.Messages_List, messageField table.insert Chat.Messages_List, messageField
Chat.MessageThread = coroutine.create -> Chat.MessageThread = coroutine.create ->
for i = 1, #Chat.Messages_List for field in *Chat.Messages_List
field = Chat.Messages_List[i]
Chat\CreateMessage field["Player"], field["Message"] Chat\CreateMessage field["Player"], field["Message"]
Chat.Messages_List = {} Chat.Messages_List = {}
@ -1138,9 +1135,9 @@ Chat.UpdateChat = (cPlayer, message) =>
table.insert Chat.Messages_List, messageField table.insert Chat.Messages_List, messageField
-- Chat.RecalculateSpacing ==> -- Chat.RecalculateSpacing ==>
--[[for i = 1, #@MessageQueue --[[for i in *@MessageQueue
pLabel = @MessageQueue[i]['Player'] pLabel = i['Player']
mLabel = @MessageQueue[i]['Message'] mLabel = i['Message']
prevYScale = mLabel.Size.Y.Scale prevYScale = mLabel.Size.Y.Scale
prevText = mLabel.Text prevText = mLabel.Text
@ -1153,7 +1150,7 @@ Chat.UpdateChat = (cPlayer, message) =>
diff = mLabel.Size.Y.Scale - prevYScale diff = mLabel.Size.Y.Scale - prevYScale
Chat\UpdateQueue @MessageQueue[i], diff Chat\UpdateQueue i, diff
end ]] end ]]
-- Chat.ApplyFilter = (str) => -- Chat.ApplyFilter = (str) =>
@ -1179,22 +1176,21 @@ Chat.CreateMessage = (cPlayer, message) =>
--[[pLabel = @MessageQueue[#@MessageQueue]['Player'] --[[pLabel = @MessageQueue[#@MessageQueue]['Player']
mLabel = @MessageQueue[#@MessageQueue]['Message'] mLabel = @MessageQueue[#@MessageQueue]['Message']
pLabel.Text = pName .. ':' pLabel.Text = pName .. ":"
pLabel.Name = pName pLabel.Name = pName
local pColor local pColor
if cPlayer.Neutral pLabel.TextColor3 = if cPlayer.Neutral
pLabel.TextColor3 = Chat\ComputeChatColor pName Chat\ComputeChatColor pName
else else
pLabel.TextColor3 = cPlayer.TeamColor.Color cPlayer.TeamColor.Color
local nString local nString
if not @CachedSpaceStrings_List[pName] nString = if not @CachedSpaceStrings_List[pName]
nString = Chat\ComputeSpaceString pLabel Chat\ComputeSpaceString pLabel
else else
nString = @CachedSpaceStrings_List[pName] @CachedSpaceStrings_List[pName]
end
mLabel.Text = "" mLabel.Text = ""
mLabel.Name = pName .. " - message" mLabel.Name = pName .. " - message"
@ -1227,10 +1223,10 @@ Chat.CreateMessage = (cPlayer, message) =>
TextStrokeTransparency: 0.75 TextStrokeTransparency: 0.75
--Active = false --Active = false
if cPlayer.Neutral pLabel.TextColor3 = if cPlayer.Neutral
pLabel.TextColor3 = Chat\ComputeChatColor pName Chat\ComputeChatColor pName
else else
pLabel.TextColor3 = cPlayer.TeamColor.Color cPlayer.TeamColor.Color
nString = if not @CachedSpaceStrings_List[pName] nString = if not @CachedSpaceStrings_List[pName]
Chat\ComputeSpaceString pLabel Chat\ComputeSpaceString pLabel
@ -1331,7 +1327,7 @@ Chat.CreateSafeChatOptions = (list, rootButton) =>
) )
count = count + 1 count += 1
if type(list[msg]) == "table" if type(list[msg]) == "table"
text_List[rootButton][chatText] = Chat\CreateSafeChatOptions list[msg], chatText text_List[rootButton][chatText] = Chat\CreateSafeChatOptions list[msg], chatText
@ -1635,10 +1631,10 @@ Chat.CullThread ==>
-- RobloxLock everything so users can't delete them(?) -- RobloxLock everything so users can't delete them(?)
Chat.LockAllFields = (gui) => Chat.LockAllFields = (gui) =>
children = gui\GetChildren! children = gui\GetChildren!
for i = 1, #children for i in *children
children[i].RobloxLocked = true i.RobloxLocked = true
if #children[i]\GetChildren! > 0 if #i\GetChildren! > 0
Chat\LockAllFields children[i] Chat\LockAllFields i
Chat.CoreGuiChanged = (coreGuiType, enabled) => Chat.CoreGuiChanged = (coreGuiType, enabled) =>
if coreGuiType == Enum.CoreGuiType.Chat or coreGuiType == Enum.CoreGuiType.All if coreGuiType == Enum.CoreGuiType.Chat or coreGuiType == Enum.CoreGuiType.All