Guess it isn't the end of the world after all....

This commit is contained in:
Bitl 2022-08-23 13:13:15 -07:00
parent e2fceebc25
commit fdf5114f12
21 changed files with 20880 additions and 3 deletions

View File

@ -1,4 +1,9 @@
1.3 Snapshot v22.8269.26928.1
1.3 Snapshot v22.8270.18357.1
Enhancements:
- Added an alpha 2012M client!
- NOTE: this client is VERY experimental and a WIP. It may be removed at any time for any reason.
- You can now change the "blank" place that loads up when studio loads with no map. Just replace "Place1.rbxl" in the config folder with one of your choice!
Fixes:
- Fixed -outputinfo not functioning without -debug being enabled.
----------------------------------------------------------------------------

View File

@ -82,6 +82,12 @@ del /s /q Novetus\clients\2011M\opengl32.dll
del /s /q Novetus\clients\2011M\DefaultPreset.ini
del /s /q Novetus\clients\2011M\content\temp.rbxl
del /s /q Novetus\clients\2012M\ReShade.ini
del /s /q Novetus\clients\2012M\OPENGL32.log
del /s /q Novetus\clients\2012M\opengl32.dll
del /s /q Novetus\clients\2012M\DefaultPreset.ini
del /s /q Novetus\clients\2012M\content\temp.rbxl
del /s /q Novetus\clients\ClientScriptTester\ReShade.ini
del /s /q Novetus\clients\ClientScriptTester\OPENGL32.log
del /s /q Novetus\clients\ClientScriptTester\opengl32.dll
@ -107,6 +113,7 @@ del /s /q Novetus\config\clients\GlobalSettings2_2006S-Shaders.xml
del /s /q Novetus\config\clients\GlobalSettings4_2007M.xml
del /s /q Novetus\config\clients\GlobalSettings4_2007M-Shaders.xml
del /s /q Novetus\config\clients\GlobalSettings7_2008M.xml
del /s /q Novetus\config\clients\GlobalSettings_13_2012M.xml
rmdir /s /q Novetus\maps\Custom
rmdir /s /q Novetus\shareddata\assetcache

View File

@ -17,6 +17,7 @@ if not exist "%gamescriptdir%/2009E-HD" mkdir "%gamescriptdir%/2009E-HD"
if not exist "%gamescriptdir%/2010L" mkdir "%gamescriptdir%/2010L"
if not exist "%gamescriptdir%/2011E" mkdir "%gamescriptdir%/2011E"
if not exist "%gamescriptdir%/2011M" mkdir "%gamescriptdir%/2011M"
if not exist "%gamescriptdir%/2012M" mkdir "%gamescriptdir%/2012M"
echo Copying client scripts...
XCOPY "%cd%\Novetus\clients\2006S\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2006S" /y
@ -31,6 +32,7 @@ XCOPY "%cd%\Novetus\clients\2009E-HD\content\scripts\CSMPFunctions.lua" "%gamesc
XCOPY "%cd%\Novetus\clients\2010L\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2010L" /y
XCOPY "%cd%\Novetus\clients\2011E\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2011E" /y
XCOPY "%cd%\Novetus\clients\2011M\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2011M" /y
XCOPY "%cd%\Novetus\clients\2012M\content\scripts\CSMPFunctions.lua" "%gamescriptdir%/2012M" /y
echo.
echo Copying client corescripts...
@ -46,6 +48,12 @@ SET mcores=%gamescriptdir%\2011M\cores
if not exist "%mcores%" mkdir "%mcores%"
XCOPY "%cd%\Novetus\clients\2011M\content\scripts\cores\*.lua" "%mcores%" /sy
echo.
echo 2012M
SET twelvemcores=%gamescriptdir%\2012M\cores
if not exist "%twelvemcores%" mkdir "%twelvemcores%"
XCOPY "%cd%\Novetus\clients\2012M\content\scripts\cores\*.lua" "%twelvemcores%" /sy
echo.
echo Copying client script libraries...
XCOPY "%cd%\Novetus\clients\2006S\content\fonts\libraries.rbxm" "%gamescriptdir%/2006S" /y
@ -60,6 +68,7 @@ XCOPY "%cd%\Novetus\clients\2009E-HD\content\fonts\libraries.rbxm" "%gamescriptd
XCOPY "%cd%\Novetus\clients\2010L\content\fonts\libraries.rbxm" "%gamescriptdir%/2010L" /y
XCOPY "%cd%\Novetus\clients\2011E\content\fonts\libraries.rbxm" "%gamescriptdir%/2011E" /y
XCOPY "%cd%\Novetus\clients\2011M\content\fonts\libraries.rbxm" "%gamescriptdir%/2011M" /y
XCOPY "%cd%\Novetus\clients\2012M\content\fonts\libraries.rbxm" "%gamescriptdir%/2012M" /y
echo.
echo Copying default client configurations...
@ -78,6 +87,7 @@ del /s /q "%tempdir%\GlobalSettings4_2006S-Shaders.xml"
del /s /q "%tempdir%\GlobalSettings4_2007M.xml"
del /s /q "%tempdir%\GlobalSettings4_2007M-Shaders.xml"
del /s /q "%tempdir%\GlobalSettings7_2008M.xml"
del /s /q "%tempdir%\GlobalSettings_13_2012M.xml"
XCOPY "%tempdir%\GlobalSettings2_2007E_default.xml" "%gamescriptdir%/2007E" /y
XCOPY "%tempdir%\GlobalSettings2_2007E-Shaders_default.xml" "%gamescriptdir%/2007E-Shaders" /y
@ -91,6 +101,7 @@ XCOPY "%tempdir%\GlobalSettings4_2006S-Shaders_default.xml" "%gamescriptdir%/200
XCOPY "%tempdir%\GlobalSettings4_2007M_default.xml" "%gamescriptdir%/2007M" /y
XCOPY "%tempdir%\GlobalSettings4_2007M-Shaders_default.xml" "%gamescriptdir%/2007M-Shaders" /y
XCOPY "%tempdir%\GlobalSettings7_2008M_default.xml" "%gamescriptdir%/2008M" /y
XCOPY "%tempdir%\GlobalSettings_13_2012M_default.xml" "%gamescriptdir%/2012M" /y
rmdir "%tempdir%" /s /q
echo.

View File

@ -0,0 +1,858 @@
showServerNotifications = true
pcall(function() settings().Diagnostics:LegacyScriptMode() end)
pcall(function() game:GetService("ScriptContext").ScriptsDisabled = false end)
--function made by rbxbanland
function newWaitForChild(newParent,name)
local returnable = nil
if newParent:FindFirstChild(name) then
returnable = newParent:FindFirstChild(name)
else
repeat wait() returnable = newParent:FindFirstChild(name) until returnable ~= nil
end
return returnable
end
function KickPlayer(Player,reason)
pcall(function() _G.CSScript_OnPrePlayerKicked(Player,reason) end)
if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then
do return end
end
Server = game:GetService("NetworkServer")
if (Player ~= nil) then
pcall(function() _G.CSScript_OnPlayerKicked(Player,reason) end)
for _,Child in pairs(Server:children()) do
name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value
if (Server:findFirstChild(name) ~= nil and Child.Name == name) then
Child:CloseConnection()
print("Player '" .. Player.Name .. "' Kicked. Reason: "..reason)
end
end
end
end
function newWaitForChildSecurity(newParent,name)
local returnable = nil
local loadAttempts = 0
local maxAttempts = 5
while loadAttempts < maxAttempts do
if newParent:FindFirstChild(name) then
returnable = newParent:FindFirstChild(name)
break
end
--for 2011+ to work the same way as other clients, we need to add half a second of wait time.
wait(0.5)
loadAttempts = loadAttempts + 1
print("Player '" .. newParent.Name .. "' trying to connect. Number of attempts: "..loadAttempts)
end
if (loadAttempts == maxAttempts) then
KickPlayer(newParent, "Modified Client")
end
return returnable
end
function LoadCharacterNew(playerApp,newChar)
if (game.Lighting:findFirstChild("DisableCustomization") ~= nil) then
do return end
end
PlayerService = game:GetService("Players")
Player = PlayerService:GetPlayerFromCharacter(newChar)
wait(0.65)
local function kick()
KickPlayer(Player, "Modified Client")
end
if (playerApp == nil) then
kick()
end
if (not Player:FindFirstChild("Appearance")) then
kick()
end
if ((playerApp:GetChildren() == 0) or (playerApp:GetChildren() == nil)) then
kick()
end
local path = "rbxasset://../../../shareddata/charcustom/"
local charparts = {[1] = newWaitForChild(newChar,"Head"),[2] = newWaitForChild(newChar,"Torso"),[3] = newWaitForChild(newChar,"Left Arm"),[4] = newWaitForChild(newChar,"Right Arm"),[5] = newWaitForChild(newChar,"Left Leg"),[6] = newWaitForChild(newChar,"Right Leg")}
for _,newVal in pairs(playerApp:GetChildren()) do
local customtype = newVal.CustomizationType.Value
if (customtype == 1) then
pcall(function()
charparts[newVal.ColorIndex.Value].BrickColor = newVal.Value
end)
elseif (customtype == 2) then
pcall(function()
local newHat = game.Workspace:InsertContent(path.."hats/"..newVal.Value)
if newHat[1] then
if newHat[1].className == "Hat" then
newHat[1].Parent = newChar
else
newHat[1]:remove()
end
end
end)
elseif (customtype == 3) then
pcall(function()
local newTShirt = "";
if (string.match(newVal.Value, "http") == "http") then
if (pcall(function()
newTShirt = game.Workspace:InsertContent(newVal.Value)
if newTShirt[1] then
if newTShirt[1].className == "ShirtGraphic" then
newTShirt[1].Parent = newChar
local oldTexture = newTShirt[1].Graphic;
OldURL,OldID = oldTexture:match("(.+)=(.+)")
NewURL,NewID = newVal.Value:match("(.+)=(.+)")
newTShirt[1].Graphic = NewURL .. '=' .. OldID
else
newTShirt[1]:remove()
end
end
end)) then
--nothing
print("success");
else
print("fail");
newTShirt = Instance.new("ShirtGraphic")
newTShirt.Graphic = newVal.Value
newTShirt.Parent = newChar
end
else
newTShirt = game.Workspace:InsertContent(path.."tshirts/"..newVal.Value)
if newTShirt[1] then
if newTShirt[1].className == "ShirtGraphic" then
newTShirt[1].Parent = newChar
else
newTShirt[1]:remove()
end
end
end
end)
elseif (customtype == 4) then
pcall(function()
local newShirt = "";
if (string.match(newVal.Value, "http") == "http") then
if (pcall(function()
newShirt = game.Workspace:InsertContent(newVal.Value)
if newShirt[1] then
if newShirt[1].className == "Shirt" then
newShirt[1].Parent = newChar
local oldTexture = newShirt[1].ShirtTemplate;
OldURL,OldID = oldTexture:match("(.+)=(.+)")
NewURL,NewID = newVal.Value:match("(.+)=(.+)")
newShirt[1].ShirtTemplate = NewURL .. '=' .. OldID
else
newShirt[1]:remove()
end
end
end)) then
--nothing
print("success");
else
print("fail");
newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = newVal.Value
newShirt.Parent = newChar
end
else
newShirt = game.Workspace:InsertContent(path.."shirts/"..newVal.Value)
if newShirt[1] then
if newShirt[1].className == "Shirt" then
newShirt[1].Parent = newChar
else
newShirt[1]:remove()
end
end
end
end)
elseif (customtype == 5) then
pcall(function()
local newPants = "";
if (string.match(newVal.Value, "http") == "http") then
if (pcall(function()
newPants = game.Workspace:InsertContent(newVal.Value)
if newPants[1] then
if newPants[1].className == "Pants" then
newPants[1].Parent = newChar
local oldTexture = newPants[1].PantsTemplate;
OldURL,OldID = oldTexture:match("(.+)=(.+)")
NewURL,NewID = newVal.Value:match("(.+)=(.+)")
newPants[1].PantsTemplate = NewURL .. '=' .. OldID
else
newPants[1]:remove()
end
end
end)) then
--nothing
print("success");
else
print("fail");
newPants = Instance.new("Pants")
newPants.PantsTemplate = newVal.Value
newPants.Parent = newChar
end
else
newPants = game.Workspace:InsertContent(path.."pants/"..newVal.Value)
if newPants[1] then
if newPants[1].className == "Pants" then
newPants[1].Parent = newChar
else
newPants[1]:remove()
end
end
end
end)
elseif (customtype == 6) then
pcall(function()
local newFace = "";
if (string.match(newVal.Value, "http") == "http") then
if (pcall(function()
newFace = game.Workspace:InsertContent(newVal.Value)
if newFace[1] then
if newFace[1].className == "Decal" then
newWaitForChild(charparts[1],"face"):remove()
newFace[1].Parent = charparts[1]
newFace[1].Face = "Front"
local oldTexture = newFace[1].Texture;
OldURL,OldID = oldTexture:match("(.+)=(.+)")
NewURL,NewID = newVal.Value:match("(.+)=(.+)")
newFace[1].Texture = NewURL .. '=' .. OldID
else
newFace[1]:remove()
end
end
end)) then
--nothing
print("success");
else
print("fail");
newWaitForChild(charparts[1],"face"):remove()
newFace = Instance.new("Decal")
newFace.Texture = newVal.Value
newFace.Face = "Front"
newFace.Parent = charparts[1]
end
else
newFace = game.Workspace:InsertContent(path.."faces/"..newVal.Value)
if newFace[1] then
if newFace[1].className == "Decal" then
newWaitForChild(charparts[1],"face"):remove()
newFace[1].Parent = charparts[1]
newFace[1].Face = "Front"
else
newFace[1]:remove()
end
end
end
end)
elseif (customtype == 7) then
pcall(function()
local newPart = game.Workspace:InsertContent(path.."heads/"..newVal.Value)
if newPart[1] then
if newPart[1].className == "SpecialMesh" or newPart[1].className == "CylinderMesh" or newPart[1].className == "BlockMesh" then
newWaitForChild(charparts[1],"Mesh"):remove()
newPart[1].Parent = charparts[1]
else
newPart[1]:remove()
end
end
end)
elseif (customtype == 8) then
pcall(function()
local newHat = game.Workspace:InsertContent(path.."hats/"..newVal.Value)
if newHat[1] then
if newHat[1].className == "Hat" then
newHat[1].Parent = newChar
else
newHat[1]:remove()
end
end
end)
pcall(function()
local newItem = game.Workspace:InsertContent(path.."custom/"..newVal.Value)
if newItem[1] then
if newItem[1].className == "Decal" then
newWaitForChild(charparts[1],"face"):remove()
newItem[1].Parent = charparts[1]
newItem[1].Face = "Front"
elseif newPart[1].className == "SpecialMesh" or newPart[1].className == "CylinderMesh" or newPart[1].className == "BlockMesh" then
newWaitForChild(charparts[1],"Mesh"):remove()
newItem[1].Parent = charparts[1]
else
newItem[1].Parent = newChar
end
end
end)
end
end
pcall(function() _G.CSScript_OnLoadCharacter(Player, playerApp) end)
end
function InitalizeClientAppearance(Player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID,IconType)
local newCharApp = Instance.new("IntValue",Player)
newCharApp.Name = "Appearance"
--BODY COLORS
for i=1,6,1 do
local BodyColor = Instance.new("BrickColorValue",newCharApp)
if (i == 1) then
if (HeadColorID ~= nil) then
BodyColor.Value = BrickColor.new(HeadColorID)
else
BodyColor.Value = BrickColor.new(1)
end
BodyColor.Name = "Head Color"
elseif (i == 2) then
if (TorsoColorID ~= nil) then
BodyColor.Value = BrickColor.new(TorsoColorID)
else
BodyColor.Value = BrickColor.new(1)
end
BodyColor.Name = "Torso Color"
elseif (i == 3) then
if (LeftArmColorID ~= nil) then
BodyColor.Value = BrickColor.new(LeftArmColorID)
else
BodyColor.Value = BrickColor.new(1)
end
BodyColor.Name = "Left Arm Color"
elseif (i == 4) then
if (RightArmColorID ~= nil) then
BodyColor.Value = BrickColor.new(RightArmColorID)
else
BodyColor.Value = BrickColor.new(1)
end
BodyColor.Name = "Right Arm Color"
elseif (i == 5) then
if (LeftLegColorID ~= nil) then
BodyColor.Value = BrickColor.new(LeftLegColorID)
else
BodyColor.Value = BrickColor.new(1)
end
BodyColor.Name = "Left Leg Color"
elseif (i == 6) then
if (RightLegColorID ~= nil) then
BodyColor.Value = BrickColor.new(RightLegColorID)
else
BodyColor.Value = BrickColor.new(1)
end
BodyColor.Name = "Right Leg Color"
end
local indexValue = Instance.new("NumberValue")
indexValue.Name = "ColorIndex"
indexValue.Parent = BodyColor
indexValue.Value = i
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = BodyColor
typeValue.Value = 1
end
--HATS
for i=1,3,1 do
local newHat = Instance.new("StringValue",newCharApp)
if (i == 1) then
if (Hat1ID ~= nil) then
newHat.Value = Hat1ID
newHat.Name = "Hat 1 - "..Hat1ID
else
newHat.Value = "NoHat.rbxm"
newHat.Name = "Hat 1 - NoHat.rbxm"
end
elseif (i == 2) then
if (Hat2ID ~= nil) then
newHat.Value = Hat2ID
newHat.Name = "Hat 2 - "..Hat2ID
else
newHat.Value = "NoHat.rbxm"
newHat.Name = "Hat 2 - NoHat.rbxm"
end
elseif (i == 3) then
if (Hat3ID ~= nil) then
newHat.Value = Hat3ID
newHat.Name = "Hat 3 - "..Hat3ID
else
newHat.Value = "NoHat.rbxm"
newHat.Name = "Hat 3 - NoHat.rbxm"
end
end
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = newHat
typeValue.Value = 2
end
--T-SHIRT
local newTShirt = Instance.new("StringValue",newCharApp)
if (TShirtID ~= nil) then
newTShirt.Value = TShirtID
newTShirt.Name = "T-Shirt - "..TShirtID
else
newTShirt.Value = "NoTShirt.rbxm"
newTShirt.Name = "T-Shirt - NoTShirt.rbxm"
end
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = newTShirt
typeValue.Value = 3
--SHIRT
local newShirt = Instance.new("StringValue",newCharApp)
if (ShirtID ~= nil) then
newShirt.Value = ShirtID
newShirt.Name = "Shirt - "..ShirtID
else
newShirt.Value = "NoShirt.rbxm"
newShirt.Name = "Shirt - NoShirt.rbxm"
end
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = newShirt
typeValue.Value = 4
--PANTS
local newPants = Instance.new("StringValue",newCharApp)
if (PantsID ~= nil) then
newPants.Value = PantsID
newPants.Name = "Pants - "..PantsID
else
newPants.Value = "NoPants.rbxm"
newPants.Name = "Pants - NoPants.rbxm"
end
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = newPants
typeValue.Value = 5
--FACE
local newFace = Instance.new("StringValue",newCharApp)
if (FaceID ~= nil) then
newFace.Value = FaceID
newFace.Name = "Face - "..FaceID
else
newFace.Value = "DefaultFace.rbxm"
newFace.Name = "Face - DefaultFace.rbxm"
end
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = newFace
typeValue.Value = 6
--HEADS
local newHead = Instance.new("StringValue",newCharApp)
if (HeadID ~= nil) then
newHead.Value = HeadID
newHead.Name = "Head - "..HeadID
else
newHead.Value = "DefaultHead.rbxm"
newHead.Name = "Head - DefaultHead.rbxm"
end
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = newHead
typeValue.Value = 7
--EXTRA
local newItem = Instance.new("StringValue",newCharApp)
if (ItemID ~= nil) then
newItem.Value = ItemID
newItem.Name = "Extra - "..ItemID
else
newItem.Value = "NoExtra.rbxm"
newItem.Name = "Extra - NoExtra.rbxm"
end
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = newItem
typeValue.Value = 8
--ICON
local newIcon = Instance.new("StringValue",newCharApp)
if (IconType ~= nil) then
newIcon.Value = IconType
else
newIcon.Value = "NBC"
end
newIcon.Name = "Icon"
local typeValue = Instance.new("NumberValue")
typeValue.Name = "CustomizationType"
typeValue.Parent = newIcon
typeValue.Value = 9
end
function LoadSecurity(playerApp,Player,ServerSecurityLocation)
local function kick()
KickPlayer(Player, "Modified Client")
end
if (playerApp == nil) then
kick()
end
if (not Player:FindFirstChild("Security")) then
kick()
end
if (not playerApp:FindFirstChild("ClientEXEMD5") or not playerApp:FindFirstChild("LauncherMD5") or not playerApp:FindFirstChild("ClientScriptMD5") or not playerApp:FindFirstChild("ValidatedFiles")) then
kick()
end
for _,newVal in pairs(playerApp:GetChildren()) do
if (newVal.Name == "ClientEXEMD5") then
if (newVal.Value ~= ServerSecurityLocation.Security.ClientEXEMD5.Value or newVal.Value == "") then
kick()
break
end
end
if (newVal.Name == "LauncherMD5") then
if (newVal.Value ~= ServerSecurityLocation.Security.LauncherMD5.Value or newVal.Value == "") then
kick()
break
end
end
if (newVal.Name == "ClientScriptMD5") then
if (newVal.Value ~= ServerSecurityLocation.Security.ClientScriptMD5.Value or newVal.Value == "") then
kick()
break
end
end
if (newVal.Name == "ValidatedFiles") then
if (newVal.Value ~= ServerSecurityLocation.Security.ValidatedFiles.Value or newVal.Value == "") then
kick()
break
end
end
end
end
function InitalizeSecurityValues(Location,ClientEXEMD5,LauncherMD5,ClientScriptMD5,ValidatedScripts)
Location = Instance.new("IntValue", Location)
Location.Name = "Security"
local clientValue = Instance.new("StringValue", Location)
clientValue.Value = ClientEXEMD5 or ""
clientValue.Name = "ClientEXEMD5"
local launcherValue = Instance.new("StringValue", Location)
launcherValue.Value = LauncherMD5 or ""
launcherValue.Name = "LauncherMD5"
local scriptValue = Instance.new("StringValue", Location)
scriptValue.Value = ClientScriptMD5 or ""
scriptValue.Name = "ClientScriptMD5"
local validScriptValue = Instance.new("StringValue", Location)
validScriptValue.Value = ValidatedScripts or "0"
validScriptValue.Name = "ValidatedFiles"
end
function InitalizeTripcode(Location,Tripcode)
local code = Instance.new("StringValue", Location)
code.Value = Tripcode or ""
code.Name = "Tripcode"
end
function LoadTripcode(Player)
local function kick()
KickPlayer(Player, "Modified Client")
end
if (not Player:FindFirstChild("Tripcode")) then
kick()
end
for _,newVal in pairs(Player:GetChildren()) do
if (newVal.Name == "Tripcode") then
if (newVal.Value == "") then
kick()
break
end
end
end
end
rbxversion = version()
print("ROBLOX Client version '" .. rbxversion .. "' loaded.")
function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications,ValidatedScripts,NewGUI)
pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end)
pcall(function() _G.CSScript_PreInit("Server", "2012M") end)
pcall(function() game:SetPlaceID(-1, false) end)
dofile("rbxasset://scripts\\cores\\StarterScriptServer.lua")
assert((type(Port)~="number" or tonumber(Port)~=nil or Port==nil),"CSRun Error: Port must be nil or a number.")
local NetworkServer=game:GetService("NetworkServer")
pcall(function() NetworkServer:SetIsPlayerAuthenticationRequired(true) end)
local RunService = game:GetService("RunService")
local PlayerService = game:GetService("Players")
game:GetService("Visit"):SetUploadUrl("")
showServerNotifications = Notifications
pcall(NetworkServer.Stop,NetworkServer)
NetworkServer:Start(Port)
local max = Instance.new("IntValue", game.Lighting)
max.Value = PlayerLimit
max.Name = "MaxPlayers"
if (showServerNotifications) then
max.Value = PlayerLimit + 1
--create a fake player to record connections and disconnections
notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1)
notifyPlayer.Name = "[SERVER]"
end
local playerCount = 0
PlayerService.PlayerAdded:connect(function(Player)
-- create anonymous player identifier. This is so we can track clients without tripcodes
playerCount = playerCount + 1
local code = Instance.new("StringValue", Player)
code.Value = playerCount
code.Name = "AnonymousIdentifier"
-- rename all Server replicators in NetworkServer to "ServerReplicator"
for _,Child in pairs(NetworkServer:children()) do
if (Child:GetPlayer() == Player) then
name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value
if (NetworkServer:findFirstChild(name) == nil) then
Child.Name = name
end
end
end
if (PlayerService.NumPlayers > max.Value) then
KickPlayer(Player, "Too many players on server.")
else
print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added")
if (showServerNotifications) then
game.Players:Chat("Player '" .. Player.Name .. "' joined")
end
Player:LoadCharacter()
end
Player.CharacterAdded:connect(function(pchar)
LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting)
newWaitForChildSecurity(Player,"Tripcode")
LoadTripcode(Player)
pcall(function() print("Player '" .. Player.Name .. "-" .. Player.userId .. "' security check success. Tripcode: '" .. Player.Tripcode.Value .. "'") end)
LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"), pchar)
end)
Player.Changed:connect(function(Property)
if (game.Lighting:findFirstChild("DisableRespawns") == nil) then
if (Player.Character~=nil) then
local Character=Player.Character
local Humanoid=Character:FindFirstChild("Humanoid")
if (Humanoid~=nil) then
Humanoid.Died:connect(function() delay(5,function() Player:LoadCharacter() LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character) end) end)
end
end
end
end)
Player.Chatted:connect(function(msg)
print(Player.Name.."; "..msg)
end)
pcall(function() _G.CSScript_OnPlayerAdded(Player) end)
end)
PlayerService.PlayerRemoving:connect(function(Player)
print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving")
if (showServerNotifications) then
game.Players:Chat("Player '" .. Player.Name .. "' left")
end
pcall(function() _G.CSScript_OnPlayerRemoved(Player) end)
end)
RunService:Run()
game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm")
InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5,ValidatedScripts)
NetworkServer.IncommingConnection:connect(IncommingConnection)
pcall(function() game.Close:connect(function() NetworkServer:Stop() end) end)
pcall(function() _G.CSScript_PostInit() end)
coroutine.resume(coroutine.create(function()
while true do
wait(0.1)
pcall(function() _G.CSScript_Update() end)
end
end))
end
function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,ValidatedScripts,NewGUI,Ticket)
pcall(function() game:SetPlaceID(-1, false) end)
dofile("rbxasset://scripts\\cores\\StarterScript.lua")
pcall(function() game:GetService("Players"):SetChatStyle(Enum.ChatStyle.ClassicAndBubble) end)
game:GetService("RunService"):Run()
assert((ServerIP~=nil and ServerPort~=nil),"CSConnect Error: ServerIP and ServerPort must be defined.")
local function SetMessage(Message) game:SetMessage(Message) end
local Visit,NetworkClient,PlayerSuccess,Player,ConnectionFailedHook=game:GetService("Visit"),game:GetService("NetworkClient")
local function GetClassCount(Class,Parent)
local Objects=Parent:GetChildren()
local Number=0
for Index,Object in pairs(Objects) do
if (Object.className==Class) then
Number=Number+1
end
Number=Number+GetClassCount(Class,Object)
end
return Number
end
local function RequestCharacter(Replicator)
local Connection
Connection=Player.Changed:connect(function(Property)
if (Property=="Character") then
game:ClearMessage()
end
end)
SetMessage("Requesting character...")
Replicator:RequestCharacter()
SetMessage("Waiting for character...")
end
local function Disconnection(Peer,LostConnection)
SetMessage("You have lost connection to the game")
end
local function ConnectionAccepted(Peer,Replicator)
Replicator.Disconnection:connect(Disconnection)
local RequestingMarker=true
game:SetMessageBrickCount()
local Marker=Replicator:SendMarker()
Marker.Received:connect(function()
RequestingMarker=false
RequestCharacter(Replicator)
end)
while RequestingMarker do
Workspace:ZoomToExtents()
wait(0.5)
end
end
local function ConnectionFailed(Peer, Code, why)
SetMessage("Failed to connect to the Game. (ID="..Code..")")
end
pcall(function() settings().Diagnostics:LegacyScriptMode() end)
pcall(function() game:SetRemoteBuildMode(true) end)
SetMessage("Connecting to server...")
NetworkClient.ConnectionAccepted:connect(ConnectionAccepted)
ConnectionFailedHook=NetworkClient.ConnectionFailed:connect(ConnectionFailed)
NetworkClient.ConnectionRejected:connect(function()
pcall(function() ConnectionFailedHook:disconnect() end)
SetMessage("Failed to connect to the Game. (Connection rejected)")
end)
pcall(function() NetworkClient.Ticket=Ticket or "" end) -- 2008 client has no ticket :O
PlayerSuccess,Player=pcall(function() return NetworkClient:PlayerConnect(UserID,ServerIP,ServerPort) end)
if (not PlayerSuccess) then
SetMessage("Failed to connect to the Game. (Invalid IP Address)")
NetworkClient:Disconnect()
end
if (not PlayerSuccess) then
local Error,Message=pcall(function()
Player=game:GetService("Players"):CreateLocalPlayer(UserID)
NetworkClient:Connect(ServerIP,ServerPort)
end)
if (not Error) then
SetMessage("Failed to connect to the Game.")
end
end
pcall(function() Player.Name=PlayerName or "" end)
pcall(function() Player:SetUnder13(false) end)
pcall(function() Player:SetAccountAge(365) end)
Player:SetSuperSafeChat(false)
Player.CharacterAppearance=0
if (IconType == "BC") then
Player:SetMembershipType(Enum.MembershipType.BuildersClub)
elseif (IconType == "TBC") then
Player:SetMembershipType(Enum.MembershipType.TurboBuildersClub)
elseif (IconType == "OBC") then
Player:SetMembershipType(Enum.MembershipType.OutrageousBuildersClub)
elseif (IconType == "NBC" or string.match(IconType, "http") == "http") then
Player:SetMembershipType(Enum.MembershipType.None)
end
pcall(function() Visit:SetUploadUrl("") end)
InitalizeClientAppearance(Player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID,IconType)
InitalizeSecurityValues(Player,ClientEXEMD5,LauncherMD5,ClientScriptMD5,ValidatedScripts)
InitalizeTripcode(Player,Tripcode)
end
function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,NewGUI)
pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end)
pcall(function() _G.CSScript_PreInit("Solo", "2012M") end)
pcall(function() game:SetPlaceID(-1, false) end)
dofile("rbxasset://scripts\\cores\\StarterScript.lua")
game:GetService("RunService"):Run()
local plr = game.Players:CreateLocalPlayer(UserID)
plr.Name = PlayerName
plr:LoadCharacter()
if (IconType == "BC") then
plr:SetMembershipType(Enum.MembershipType.BuildersClub)
elseif (IconType == "TBC") then
plr:SetMembershipType(Enum.MembershipType.TurboBuildersClub)
elseif (IconType == "OBC") then
plr:SetMembershipType(Enum.MembershipType.OutrageousBuildersClub)
elseif (IconType == "NBC" or string.match(IconType, "http") == "http") then
plr:SetMembershipType(Enum.MembershipType.None)
end
plr.CharacterAppearance=0
InitalizeClientAppearance(plr,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID,IconType)
wait(0.7)
delay(0.5,function() LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) end)
game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm")
game:GetService("Visit"):SetUploadUrl("")
pcall(function() _G.CSScript_PostInit() end)
coroutine.resume(coroutine.create(function()
while true do
wait(0.1)
pcall(function() _G.CSScript_Update() end)
end
end))
while true do
wait(0.001)
if (game.Lighting:findFirstChild("DisableRespawns") == nil) then
if (plr.Character ~= nil) then
if (plr.Character:findFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then
wait(5)
plr:LoadCharacter()
delay(0.5,function() LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) end)
elseif (plr.Character.Parent == nil) then
wait(5)
plr:LoadCharacter() -- to make sure nobody is deleted.
delay(0.5,function() LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) end)
end
end
end
end
end
function CSStudio(NewGUI)
pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end)
pcall(function() _G.CSScript_PreInit("Studio", "2012M") end)
pcall(function() game:SetPlaceID(-1, false) end)
dofile("rbxasset://scripts\\cores\\StarterScript.lua")
pcall(function() _G.CSScript_PostInit() end)
coroutine.resume(coroutine.create(function()
while true do
wait(0.1)
pcall(function() _G.CSScript_Update() end)
end
end))
end
_G.CSServer=CSServer
_G.CSConnect=CSConnect
_G.CSSolo=CSSolo
_G.CSStudio=CSStudio

View File

@ -0,0 +1,167 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<External>null</External>
<External>nil</External>
<Item class="GameSettings" referent="RBX0">
<Properties>
<float name="BubbleChatLifetime">30</float>
<int name="BubbleChatMaxBubbles">3</int>
<int name="ChatHistory">100</int>
<int name="ChatScrollLength">5</int>
<bool name="CollisionSoundEnabled">true</bool>
<float name="CollisionSoundVolume">10</float>
<bool name="HardwareMouse">false</bool>
<token name="ImageUploadPromptBehavior">1</token>
<int name="MaxCollisionSounds">-1</int>
<string name="Name">Game Options</string>
<int name="ReportAbuseChatHistory">50</int>
<bool name="SoftwareSound">false</bool>
<bool name="SoundEnabled">true</bool>
<bool name="VideoCaptureEnabled">true</bool>
<token name="VideoQuality">1</token>
</Properties>
</Item>
<Item class="LuaSettings" referent="RBX1">
<Properties>
<bool name="AreScriptStartsReported">false</bool>
<double name="DefaultWaitTime">0.029999999999999999</double>
<int name="GcFrequency">0</int>
<int name="GcLimit">2</int>
<int name="GcPause">200</int>
<int name="GcStepMul">200</int>
<string name="Name">Lua</string>
<float name="WaitingThreadsBudget">0.100000001</float>
</Properties>
</Item>
<Item class="DebugSettings" referent="RBX2">
<Properties>
<bool name="EnforceInstanceCountLimit">false</bool>
<token name="ErrorReporting">2</token>
<int name="InstanceCountLimit">0</int>
<bool name="IsFmodProfilingEnabled">false</bool>
<bool name="IsProfilingEnabled">false</bool>
<bool name="IsScriptStackTracingEnabled">true</bool>
<int name="LuaRamLimit">0</int>
<string name="Name">Diagnostics</string>
<double name="ProfilingWindow">3</double>
<bool name="ReportExtendedMachineConfiguration">false</bool>
<bool name="ReportSoundWarnings">false</bool>
<token name="TickCountPreciseOverride">2</token>
</Properties>
</Item>
<Item class="PhysicsSettings" referent="RBX3">
<Properties>
<bool name="AllowSleep">true</bool>
<bool name="AreAnchorsShown">false</bool>
<bool name="AreAwakePartsHighlighted">false</bool>
<bool name="AreModelCoordsShown">false</bool>
<bool name="AreOwnersShown">false</bool>
<bool name="ArePartCoordsShown">false</bool>
<bool name="AreRegionsShown">false</bool>
<bool name="AreUnalignedPartsShown">false</bool>
<bool name="AreWorldCoordsShown">false</bool>
<bool name="IsReceiveAgeShown">false</bool>
<string name="Name">Physics</string>
<bool name="ParallelPhysics">false</bool>
<token name="PhysicsEnvironmentalThrottle">0</token>
<double name="ThrottleAdjustTime">1</double>
<float name="WaterViscosity">0.00400000019</float>
</Properties>
</Item>
<Item class="FastLogSettings" referent="RBX4">
<Properties>
<string name="Name">FastLogSettings</string>
</Properties>
</Item>
<Item class="Authoring" referent="RBX5">
<Properties>
<string name="EditorFont">Courier New</string>
<int name="EditorFontSize">10</int>
<int name="EditorTabWidth">3</int>
<string name="Name">Authoring</string>
<bool name="ShowDeprecatedObjects">false</bool>
<bool name="ShowDevObjects">false</bool>
<bool name="ShowPreliminaryObjects">true</bool>
</Properties>
</Item>
<Item class="NetworkSettings" referent="RBX6">
<Properties>
<bool name="ArePhysicsRejectionsReported">false</bool>
<int name="CanSendPacketBufferLimit">1</int>
<int name="DataMtuAdjust">-200</int>
<float name="DataSendRate">30</float>
<bool name="ExperimentalPhysicsEnabled">true</bool>
<double name="IncommingReplicationLag">0</double>
<bool name="IsQueueErrorComputed">true</bool>
<bool name="IsThrottledByCongestionControl">false</bool>
<bool name="IsThrottledByOutgoingBandwidthLimit">false</bool>
<string name="Name">Network</string>
<float name="NetworkOwnerRate">10</float>
<int name="PhysicsMtuAdjust">-200</int>
<token name="PhysicsReceive">1</token>
<token name="PhysicsSend">1</token>
<float name="PhysicsSendRate">20</float>
<int name="PreferredClientPort">0</int>
<bool name="PrintEvents">false</bool>
<bool name="PrintInstances">false</bool>
<bool name="PrintPhysicsErrors">false</bool>
<bool name="PrintProperties">false</bool>
<bool name="PrintSplitMessage">false</bool>
<bool name="PrintTouches">false</bool>
<double name="ReceiveRate">60</double>
<int name="SendPacketBufferLimit">-1</int>
<float name="TouchSendRate">10</float>
<bool name="UseInstancePacketCache">false</bool>
<bool name="UsePhysicsPacketCache">false</bool>
</Properties>
</Item>
<Item class="TaskScheduler" referent="RBX7">
<Properties>
<bool name="AreArbitersThrottled">false</bool>
<token name="Concurrency">2</token>
<string name="Name">Task Scheduler</string>
<token name="PriorityMethod">1</token>
<token name="SleepAdjustMethod">2</token>
<token name="ThreadPoolConfig">0</token>
<double name="ThrottledJobSleepTime">0.01</double>
</Properties>
</Item>
<Item class="RenderSettings" referent="RBX8">
<Properties>
<token name="AASamples">1</token>
<token name="AluminumQuality">0</token>
<token name="Antialiasing">2</token>
<int name="AutoFRMLevel">1</int>
<float name="BatchSize">20</float>
<token name="Bevels">0</token>
<token name="CompoundMaterialQuality">0</token>
<token name="CorrodedMetalQuality">0</token>
<int name="DebugCullBlockCount">-1</int>
<bool name="DebugDisableDebriService">false</bool>
<bool name="DebugDisableInterpolation">false</bool>
<bool name="DebugFRMCullHumanoids">false</bool>
<bool name="DebugLogFRMLogVariables">false</bool>
<token name="DiamondPlateQuality">0</token>
<bool name="EagerBulkExecution">false</bool>
<token name="FrameRateManager">0</token>
<token name="GrassQuality">0</token>
<token name="IceQuality">0</token>
<bool name="IsAggregationShown">false</bool>
<bool name="IsSynchronizedWithPhysics">false</bool>
<int name="MeshCacheSize">33554432</int>
<string name="Name">Rendering</string>
<token name="PlasticQuality">0</token>
<token name="QualityLevel">0</token>
<token name="Resolution">0</token>
<token name="Shadow">0</token>
<bool name="ShowBoundingBoxes">false</bool>
<token name="SlateQuality">0</token>
<int name="TextureCacheSize">33554432</int>
<bool name="TextureCompositingEnabled">true</bool>
<token name="TrussDetail">0</token>
<bool name="UsesPaintMessage">true</bool>
<token name="WoodQuality">0</token>
<token name="graphicsMode">1</token>
<string name="profileName">profiled5</string>
</Properties>
</Item>
</roblox>

View File

@ -0,0 +1,496 @@
--- ATTENTION!!! There are site-specific ids at the end of this script!!!!!!!!!!!!!!!!!!!!
delay(0, function()
if game.CoreGui.Version < 3 then return end -- peace out if we aren't using the right client
local gui = game:GetService("CoreGui").RobloxGui
-- A couple of necessary functions
local function waitForChild(instance, name)
while not instance:FindFirstChild(name) do
instance.ChildAdded:wait()
end
end
local function waitForProperty(instance, property)
while not instance[property] do
instance.Changed:wait()
end
end
waitForChild(game,"Players")
waitForProperty(game.Players,"LocalPlayer")
local player = game.Players.LocalPlayer
-- First up is the current loadout
local CurrentLoadout = Instance.new("Frame")
CurrentLoadout.Name = "CurrentLoadout"
CurrentLoadout.Position = UDim2.new(0.5, -240, 1, -85)
CurrentLoadout.Size = UDim2.new(0, 480, 0, 48)
CurrentLoadout.BackgroundTransparency = 1
CurrentLoadout.RobloxLocked = true
CurrentLoadout.Parent = gui
local Debounce = Instance.new("BoolValue")
Debounce.Name = "Debounce"
Debounce.RobloxLocked = true
Debounce.Parent = CurrentLoadout
local BackpackButton = Instance.new("ImageButton")
BackpackButton.RobloxLocked = true
BackpackButton.Visible = false
BackpackButton.Name = "BackpackButton"
BackpackButton.BackgroundTransparency = 1
BackpackButton.Image = "rbxasset://textures/ui/backpackButton.png"
BackpackButton.Position = UDim2.new(0.5, -195, 1, -30)
BackpackButton.Size = UDim2.new(0,107,0,26)
waitForChild(gui,"ControlFrame")
BackpackButton.Parent = gui.ControlFrame
for i = 0, 9 do
local slotFrame = Instance.new("Frame")
slotFrame.RobloxLocked = true
slotFrame.BackgroundColor3 = Color3.new(0,0,0)
slotFrame.BackgroundTransparency = 1
slotFrame.BorderColor3 = Color3.new(1,1,1)
slotFrame.Name = "Slot" .. tostring(i)
if i == 0 then
slotFrame.Position = UDim2.new(0.9,0,0,0)
else
slotFrame.Position = UDim2.new((i - 1) * 0.1,0,0,0)
end
slotFrame.Size = UDim2.new(0.1,0,1,0)
slotFrame.Parent = CurrentLoadout
end
local TempSlot = Instance.new("ImageButton")
TempSlot.Name = "TempSlot"
TempSlot.Active = true
TempSlot.Size = UDim2.new(1,0,1,0)
TempSlot.Style = Enum.ButtonStyle.RobloxButton
TempSlot.Visible = false
TempSlot.RobloxLocked = true
TempSlot.Parent = CurrentLoadout
-- TempSlot Children
local GearReference = Instance.new("ObjectValue")
GearReference.Name = "GearReference"
GearReference.RobloxLocked = true
GearReference.Parent = TempSlot
local ToolTipLabel = Instance.new("TextLabel")
ToolTipLabel.Name = "ToolTipLabel"
ToolTipLabel.RobloxLocked = true
ToolTipLabel.Text = ""
ToolTipLabel.BackgroundTransparency = 0.5
ToolTipLabel.BorderSizePixel = 0
ToolTipLabel.Visible = false
ToolTipLabel.TextColor3 = Color3.new(1,1,1)
ToolTipLabel.BackgroundColor3 = Color3.new(0,0,0)
ToolTipLabel.TextStrokeTransparency = 0
ToolTipLabel.Font = Enum.Font.ArialBold
ToolTipLabel.FontSize = Enum.FontSize.Size14
--ToolTipLabel.TextWrap = true
ToolTipLabel.Size = UDim2.new(1,60,0,20)
ToolTipLabel.Position = UDim2.new(0,-30,0,-30)
ToolTipLabel.Parent = TempSlot
local Kill = Instance.new("BoolValue")
Kill.Name = "Kill"
Kill.RobloxLocked = true
Kill.Parent = TempSlot
local GearImage = Instance.new("ImageLabel")
GearImage.Name = "GearImage"
GearImage.BackgroundTransparency = 1
GearImage.Position = UDim2.new(0,-7,0,-7)
GearImage.Size = UDim2.new(1,14,1,14)
GearImage.ZIndex = 2
GearImage.RobloxLocked = true
GearImage.Parent = TempSlot
local SlotNumber = Instance.new("TextLabel")
SlotNumber.Name = "SlotNumber"
SlotNumber.BackgroundTransparency = 1
SlotNumber.BorderSizePixel = 0
SlotNumber.Font = Enum.Font.ArialBold
SlotNumber.FontSize = Enum.FontSize.Size18
SlotNumber.Position = UDim2.new(0,-7,0,-7)
SlotNumber.Size = UDim2.new(0,10,0,15)
SlotNumber.TextColor3 = Color3.new(1,1,1)
SlotNumber.TextTransparency = 0
SlotNumber.TextXAlignment = Enum.TextXAlignment.Left
SlotNumber.TextYAlignment = Enum.TextYAlignment.Bottom
SlotNumber.ZIndex = 4
SlotNumber.RobloxLocked = true
SlotNumber.Parent = TempSlot
local SlotNumberDownShadow = SlotNumber:clone()
SlotNumberDownShadow.Name = "SlotNumberDownShadow"
SlotNumberDownShadow.TextColor3 = Color3.new(0,0,0)
SlotNumberDownShadow.ZIndex = 3
SlotNumberDownShadow.Position = UDim2.new(0,-6,0,-6)
SlotNumberDownShadow.Parent = TempSlot
local SlotNumberUpShadow = SlotNumberDownShadow:clone()
SlotNumberUpShadow.Name = "SlotNumberUpShadow"
SlotNumberUpShadow.Position = UDim2.new(0,-8,0,-8)
SlotNumberUpShadow.Parent = TempSlot
local GearText = Instance.new("TextLabel")
GearText.RobloxLocked = true
GearText.Name = "GearText"
GearText.BackgroundTransparency = 1
GearText.Font = Enum.Font.Arial
GearText.FontSize = Enum.FontSize.Size14
GearText.Position = UDim2.new(0,-8,0,-8)
GearText.ZIndex = 2
GearText.Size = UDim2.new(1,16,1,16)
GearText.Text = ""
GearText.TextColor3 = Color3.new(1,1,1)
GearText.TextWrap = true
GearText.Parent = TempSlot
--- Great, now lets make the inventory!
local Backpack = Instance.new("Frame")
Backpack.Visible = false
Backpack.Name = "Backpack"
Backpack.Position = UDim2.new(0.5,0,0.5,0)
Backpack.Size = UDim2.new(0,0,0,0)
Backpack.Style = Enum.FrameStyle.RobloxSquare
Backpack.RobloxLocked = true
Backpack.Parent = gui
Backpack.Active = true
-- Backpack Children
local SwapSlot = Instance.new("BoolValue")
SwapSlot.RobloxLocked = true
SwapSlot.Name = "SwapSlot"
SwapSlot.Parent = Backpack
-- SwapSlot Children
local Slot = Instance.new("IntValue")
Slot.RobloxLocked = true
Slot.Name = "Slot"
Slot.Parent = SwapSlot
local GearButton = Instance.new("ObjectValue")
GearButton.RobloxLocked = true
GearButton.Name = "GearButton"
GearButton.Parent = SwapSlot
local Tabs = Instance.new("Frame")
Tabs.Name = "Tabs"
Tabs.Visible = false
Tabs.RobloxLocked = true
Tabs.BackgroundColor3 = Color3.new(0,0,0)
Tabs.BackgroundTransparency = 0.5
Tabs.BorderSizePixel = 0
Tabs.Position = UDim2.new(0,-8,-0.1,-8)
Tabs.Size = UDim2.new(1,16,0.1,0)
Tabs.Parent = Backpack
-- Tabs Children
local InventoryButton = Instance.new("ImageButton")
InventoryButton.RobloxLocked = true
InventoryButton.Name = "InventoryButton"
InventoryButton.Size = UDim2.new(0.12,0,1,0)
InventoryButton.Style = Enum.ButtonStyle.RobloxButton
InventoryButton.Selected = true
InventoryButton.Parent = Tabs
-- InventoryButton Children
local InventoryText = Instance.new("TextLabel")
InventoryText.RobloxLocked = true
InventoryText.Name = "InventoryText"
InventoryText.BackgroundTransparency = 1
InventoryText.Font = Enum.Font.ArialBold
InventoryText.FontSize = Enum.FontSize.Size18
InventoryText.Position = UDim2.new(0,-7,0,-7)
InventoryText.Size = UDim2.new(1,14,1,14)
InventoryText.Text = "Gear"
InventoryText.TextColor3 = Color3.new(1,1,1)
InventoryText.Parent = InventoryButton
local closeButton = Instance.new("TextButton")
closeButton.RobloxLocked = true
closeButton.Name = "CloseButton"
closeButton.Font = Enum.Font.ArialBold
closeButton.FontSize = Enum.FontSize.Size24
closeButton.Position = UDim2.new(1,-33,0,2)
closeButton.Size = UDim2.new(0,30,0,30)
closeButton.Style = Enum.ButtonStyle.RobloxButton
closeButton.Text = "X"
closeButton.TextColor3 = Color3.new(1,1,1)
closeButton.Parent = Tabs
local Gear = Instance.new("Frame")
Gear.Name = "Gear"
Gear.RobloxLocked = true
Gear.BackgroundTransparency = 1
Gear.Size = UDim2.new(1,0,1,0)
Gear.Parent = Backpack
-- Gear Children
local GearGrid = Instance.new("Frame")
GearGrid.RobloxLocked = true
GearGrid.Name = "GearGrid"
GearGrid.Size = UDim2.new(0.69,0,1,0)
GearGrid.Style = Enum.FrameStyle.RobloxSquare
GearGrid.Parent = Gear
-- GearGrid Children
local ResetFrame = Instance.new("Frame")
ResetFrame.RobloxLocked = true
ResetFrame.Name = "ResetFrame"
ResetFrame.Visible = false
ResetFrame.BackgroundTransparency = 1
ResetFrame.Size = UDim2.new(0,32,0,64)
ResetFrame.Parent = GearGrid
-- ResetFrame Children
local ResetImageLabel = Instance.new("ImageLabel")
ResetImageLabel.RobloxLocked = true
ResetImageLabel.Name = "ResetImageLabel"
ResetImageLabel.Image = "rbxasset://textures/ui/ResetIcon.png"
ResetImageLabel.BackgroundTransparency = 1
ResetImageLabel.Position = UDim2.new(0,0,0,-12)
ResetImageLabel.Size = UDim2.new(0.8,0,0.79,0)
ResetImageLabel.ZIndex = 2
ResetImageLabel.Parent = ResetFrame
local ResetButtonBorder = Instance.new("TextButton")
ResetButtonBorder.RobloxLocked = true
ResetButtonBorder.Name = "ResetButtonBorder"
ResetButtonBorder.Position = UDim2.new(0,-3,0,-7)
ResetButtonBorder.Size = UDim2.new(1,0,0.64,0)
ResetButtonBorder.Style = Enum.ButtonStyle.RobloxButton
ResetButtonBorder.Text = ""
ResetButtonBorder.Parent = ResetFrame
local SearchFrame = Instance.new("Frame")
SearchFrame.RobloxLocked = true
SearchFrame.Name = "SearchFrame"
SearchFrame.BackgroundTransparency = 1
SearchFrame.Position = UDim2.new(1,-150,0,0)
SearchFrame.Size = UDim2.new(0,150,0,25)
SearchFrame.Parent = GearGrid
-- SearchFrame Children
local SearchButton = Instance.new("ImageButton")
SearchButton.RobloxLocked = true
SearchButton.Name = "SearchButton"
SearchButton.Size = UDim2.new(0,25,0,25)
SearchButton.BackgroundTransparency = 1
SearchButton.Image = "rbxasset://textures/ui/SearchIcon.png"
SearchButton.Parent = SearchFrame
local SearchBoxFrame = Instance.new("TextButton")
SearchBoxFrame.RobloxLocked = true
SearchBoxFrame.Position = UDim2.new(0,26,0,0)
SearchBoxFrame.Size = UDim2.new(0,121,0,25)
SearchBoxFrame.Name = "SearchBoxFrame"
SearchBoxFrame.Text = ""
SearchBoxFrame.Style = Enum.ButtonStyle.RobloxButton
SearchBoxFrame.Parent = SearchFrame
-- SearchBoxFrame Children
local SearchBox = Instance.new("TextBox")
SearchBox.RobloxLocked = true
SearchBox.Name = "SearchBox"
SearchBox.BackgroundTransparency = 1
SearchBox.Font = Enum.Font.ArialBold
SearchBox.FontSize = Enum.FontSize.Size12
SearchBox.Position = UDim2.new(0,-5,0,-5)
SearchBox.Size = UDim2.new(1,10,1,10)
SearchBox.TextColor3 = Color3.new(1,1,1)
SearchBox.TextXAlignment = Enum.TextXAlignment.Left
SearchBox.ZIndex = 2
SearchBox.TextWrap = true
SearchBox.Text = "Search..."
SearchBox.Parent = SearchBoxFrame
local GearButton = Instance.new("ImageButton")
GearButton.RobloxLocked = true
GearButton.Visible = false
GearButton.Name = "GearButton"
GearButton.Size = UDim2.new(0,64,0,64)
GearButton.Style = Enum.ButtonStyle.RobloxButton
GearButton.Parent = GearGrid
-- GearButton Children
local GearReference = Instance.new("ObjectValue")
GearReference.RobloxLocked = true
GearReference.Name = "GearReference"
GearReference.Parent = GearButton
local GreyOutButton = Instance.new("Frame")
GreyOutButton.RobloxLocked = true
GreyOutButton.Name = "GreyOutButton"
GreyOutButton.BackgroundTransparency = 0.5
GreyOutButton.Size = UDim2.new(1,0,1,0)
GreyOutButton.Active = true
GreyOutButton.Visible = false
GreyOutButton.ZIndex = 3
GreyOutButton.Parent = GearButton
local GearText = Instance.new("TextLabel")
GearText.RobloxLocked = true
GearText.Name = "GearText"
GearText.BackgroundTransparency = 1
GearText.Font = Enum.Font.Arial
GearText.FontSize = Enum.FontSize.Size14
GearText.Position = UDim2.new(0,-8,0,-8)
GearText.Size = UDim2.new(1,16,1,16)
GearText.Text = ""
GearText.ZIndex = 2
GearText.TextColor3 = Color3.new(1,1,1)
GearText.TextWrap = true
GearText.Parent = GearButton
local GearGridScrollingArea = Instance.new("Frame")
GearGridScrollingArea.RobloxLocked = true
GearGridScrollingArea.Name = "GearGridScrollingArea"
GearGridScrollingArea.Position = UDim2.new(0.7,0,0,0)
GearGridScrollingArea.Size = UDim2.new(0,17,1,0)
GearGridScrollingArea.BackgroundTransparency = 1
GearGridScrollingArea.Parent = Gear
local GearLoadouts = Instance.new("Frame")
GearLoadouts.RobloxLocked = true
GearLoadouts.Name = "GearLoadouts"
GearLoadouts.BackgroundTransparency = 1
GearLoadouts.Position = UDim2.new(0.7,23,0.5,1)
GearLoadouts.Size = UDim2.new(0.3,-23,0.5,-1)
GearLoadouts.Parent = Gear
GearLoadouts.Visible = false
-- GearLoadouts Children
local GearLoadoutsHeader = Instance.new("Frame")
GearLoadoutsHeader.RobloxLocked = true
GearLoadoutsHeader.Name = "GearLoadoutsHeader"
GearLoadoutsHeader.BackgroundColor3 = Color3.new(0,0,0)
GearLoadoutsHeader.BackgroundTransparency = 0.2
GearLoadoutsHeader.BorderColor3 = Color3.new(1,0,0)
GearLoadoutsHeader.Size = UDim2.new(1,2,0.15,-1)
GearLoadoutsHeader.Parent = GearLoadouts
-- GearLoadoutsHeader Children
local LoadoutsHeaderText = Instance.new("TextLabel")
LoadoutsHeaderText.RobloxLocked = true
LoadoutsHeaderText.Name = "LoadoutsHeaderText"
LoadoutsHeaderText.BackgroundTransparency = 1
LoadoutsHeaderText.Font = Enum.Font.ArialBold
LoadoutsHeaderText.FontSize = Enum.FontSize.Size18
LoadoutsHeaderText.Size = UDim2.new(1,0,1,0)
LoadoutsHeaderText.Text = "Loadouts"
LoadoutsHeaderText.TextColor3 = Color3.new(1,1,1)
LoadoutsHeaderText.Parent = GearLoadoutsHeader
local GearLoadoutsScrollingArea = GearGridScrollingArea:clone()
GearLoadoutsScrollingArea.RobloxLocked = true
GearLoadoutsScrollingArea.Name = "GearLoadoutsScrollingArea"
GearLoadoutsScrollingArea.Position = UDim2.new(1,-15,0.15,2)
GearLoadoutsScrollingArea.Size = UDim2.new(0,17,0.85,-2)
GearLoadoutsScrollingArea.Parent = GearLoadouts
local LoadoutsList = Instance.new("Frame")
LoadoutsList.RobloxLocked = true
LoadoutsList.Name = "LoadoutsList"
LoadoutsList.Position = UDim2.new(0,0,0.15,2)
LoadoutsList.Size = UDim2.new(1,-17,0.85,-2)
LoadoutsList.Style = Enum.FrameStyle.RobloxSquare
LoadoutsList.Parent = GearLoadouts
local GearPreview = Instance.new("Frame")
GearPreview.RobloxLocked = true
GearPreview.Name = "GearPreview"
GearPreview.Position = UDim2.new(0.7,23,0,0)
GearPreview.Size = UDim2.new(0.3,-23,0.5,-1)
GearPreview.Style = Enum.FrameStyle.RobloxRound
GearPreview.Parent = Gear
-- GearPreview Children
local GearStats = Instance.new("Frame")
GearStats.RobloxLocked = true
GearStats.Name = "GearStats"
GearStats.BackgroundTransparency = 1
GearStats.Position = UDim2.new(0,0,0.75,0)
GearStats.Size = UDim2.new(1,0,0.25,0)
GearStats.Parent = GearPreview
-- GearStats Children
local GearName = Instance.new("TextLabel")
GearName.RobloxLocked = true
GearName.Name = "GearName"
GearName.BackgroundTransparency = 1
GearName.Font = Enum.Font.ArialBold
GearName.FontSize = Enum.FontSize.Size18
GearName.Position = UDim2.new(0,-3,0,0)
GearName.Size = UDim2.new(1,6,1,5)
GearName.Text = ""
GearName.TextColor3 = Color3.new(1,1,1)
GearName.TextWrap = true
GearName.Parent = GearStats
local GearImage = Instance.new("ImageLabel")
GearImage.RobloxLocked = true
GearImage.Name = "GearImage"
GearImage.Image = ""
GearImage.BackgroundTransparency = 1
GearImage.Position = UDim2.new(0.125,0,0,0)
GearImage.Size = UDim2.new(0.75,0,0.75,0)
GearImage.Parent = GearPreview
--GearImage Children
local GearIcons = Instance.new("Frame")
GearIcons.BackgroundColor3 = Color3.new(0,0,0)
GearIcons.BackgroundTransparency = 0.5
GearIcons.BorderSizePixel = 0
GearIcons.RobloxLocked = true
GearIcons.Name = "GearIcons"
GearIcons.Position = UDim2.new(0.4,2,0.85,-2)
GearIcons.Size = UDim2.new(0.6,0,0.15,0)
GearIcons.Visible = false
GearIcons.Parent = GearImage
-- GearIcons Children
local GenreImage = Instance.new("ImageLabel")
GenreImage.RobloxLocked = true
GenreImage.Name = "GenreImage"
GenreImage.BackgroundColor3 = Color3.new(102/255,153/255,1)
GenreImage.BackgroundTransparency = 0.5
GenreImage.BorderSizePixel = 0
GenreImage.Size = UDim2.new(0.25,0,1,0)
GenreImage.Parent = GearIcons
local AttributeOneImage = GenreImage:clone()
AttributeOneImage.RobloxLocked = true
AttributeOneImage.Name = "AttributeOneImage"
AttributeOneImage.BackgroundColor3 = Color3.new(1,51/255,0)
AttributeOneImage.Position = UDim2.new(0.25,0,0,0)
AttributeOneImage.Parent = GearIcons
local AttributeTwoImage = GenreImage:clone()
AttributeTwoImage.RobloxLocked = true
AttributeTwoImage.Name = "AttributeTwoImage"
AttributeTwoImage.BackgroundColor3 = Color3.new(153/255,1,153/255)
AttributeTwoImage.Position = UDim2.new(0.5,0,0,0)
AttributeTwoImage.Parent = GearIcons
local AttributeThreeImage = GenreImage:clone()
AttributeThreeImage.RobloxLocked = true
AttributeThreeImage.Name = "AttributeThreeImage"
AttributeThreeImage.BackgroundColor3 = Color3.new(0,0.5,0.5)
AttributeThreeImage.Position = UDim2.new(0.75,0,0,0)
AttributeThreeImage.Parent = GearIcons
-- Backpack Resizer (handles all backpack resizing junk)
--game:GetService("ScriptContext"):AddCoreScript(53878053,Backpack,"BackpackResizer")
dofile("rbxasset://scripts\\cores\\BackpackResizer.lua")
end)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,730 @@
delay(0, function()
if game.CoreGui.Version < 3 then return end -- peace out if we aren't using the right client
-- A couple of necessary functions
local function waitForChild(instance, name)
while not instance:FindFirstChild(name) do
instance.ChildAdded:wait()
end
end
local function waitForProperty(instance, property)
while not instance[property] do
instance.Changed:wait()
end
end
--- Begin Locals
waitForChild(game,"Players")
waitForProperty(game.Players,"LocalPlayer")
local player = game.Players.LocalPlayer
waitForChild(game, "LocalBackpack")
game.LocalBackpack:SetOldSchoolBackpack(false)
local currentLoadout = game:GetService("CoreGui").RobloxGui:FindFirstChild("CurrentLoadout")
local maxNumLoadoutItems = 10
local guiBackpack = currentLoadout.Parent.Backpack
local characterChildAddedCon = nil
local keyPressCon = nil
local backpackChildCon = nil
local debounce = currentLoadout.Debounce
local waitingOnEnlarge = nil
local enlargeFactor = 1.18
local buttonSizeEnlarge = UDim2.new(1 * enlargeFactor,0,1 * enlargeFactor,0)
local buttonSizeNormal = UDim2.new(1,0,1,0)
local enlargeOverride = true
local guiTweenSpeed = 0.5
for i = 0, 9 do
game:GetService("GuiService"):AddKey(tostring(i)) -- register our keys
end
local gearSlots = {}
for i = 1, maxNumLoadoutItems do
gearSlots[i] = "empty"
end
local inventory = {}
--- End Locals
-- Begin Functions
local function kill(prop,con,gear)
if con then con:disconnect() end
if prop == true and gear then
reorganizeLoadout(gear,false)
end
end
function removeGear(gear)
local emptySlot = nil
for i = 1, #gearSlots do
if gearSlots[i] == gear and gear.Parent ~= nil then
emptySlot = i
break
end
end
if emptySlot then
if gearSlots[emptySlot].GearReference.Value then
if gearSlots[emptySlot].GearReference.Value.Parent == game.Players.LocalPlayer.Character then -- if we currently have this equipped, unequip it
gearSlots[emptySlot].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack
end
if gearSlots[emptySlot].GearReference.Value:IsA("HopperBin") and gearSlots[emptySlot].GearReference.Value.Active then -- this is an active hopperbin
gearSlots[emptySlot].GearReference.Value:Disable()
gearSlots[emptySlot].GearReference.Value.Active = false
end
end
gearSlots[emptySlot] = "empty"
local centerizeX = gear.Size.X.Scale/2
local centerizeY = gear.Size.Y.Scale/2
gear:TweenSizeAndPosition(UDim2.new(0,0,0,0),
UDim2.new(gear.Position.X.Scale + centerizeX,gear.Position.X.Offset,gear.Position.Y.Scale + centerizeY,gear.Position.Y.Offset),
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,guiTweenSpeed/4,true)
delay(guiTweenSpeed/2,
function()
gear:remove()
end)
end
end
function insertGear(gear, addToSlot)
local pos = nil
if not addToSlot then
for i = 1, #gearSlots do
if gearSlots[i] == "empty" then
pos = i
break
end
end
if pos == 1 and gearSlots[1] ~= "empty" then gear:remove() return end -- we are currently full, can't add in
else
pos = addToSlot
-- push all gear down one slot
local start = 1
for i = 1, #gearSlots do
if gearSlots[i] == "empty" then
start = i
break
end
end
for i = start, pos + 1, -1 do
gearSlots[i] = gearSlots[i - 1]
if i == 10 then
gearSlots[i].SlotNumber.Text = "0"
gearSlots[i].SlotNumberDownShadow.Text = "0"
gearSlots[i].SlotNumberUpShadow.Text = "0"
else
gearSlots[i].SlotNumber.Text = i
gearSlots[i].SlotNumberDownShadow.Text = i
gearSlots[i].SlotNumberUpShadow.Text = i
end
end
end
gearSlots[pos] = gear
if pos ~= maxNumLoadoutItems then
if(type(tostring(pos)) == "string") then
local posString = tostring(pos)
gear.SlotNumber.Text = posString
gear.SlotNumberDownShadow.Text = posString
gear.SlotNumberUpShadow.Text = posString
end
else -- tenth gear doesn't follow mathematical pattern :(
gear.SlotNumber.Text = "0"
gear.SlotNumberDownShadow.Text = "0"
gear.SlotNumberUpShadow.Text = "0"
end
gear.Visible = true
local con = nil
con = gear.Kill.Changed:connect(function(prop) kill(prop,con,gear) end)
end
function reorganizeLoadout(gear, inserting, equipped, addToSlot)
if inserting then -- add in gear
insertGear(gear, addToSlot)
else
removeGear(gear)
end
if gear ~= "empty" then gear.ZIndex = 1 end
end
function checkToolAncestry(child,parent)
if child:FindFirstChild("RobloxBuildTool") then return end -- don't show roblox build tools
if child:IsA("Tool") or child:IsA("HopperBin") then
for i = 1, #gearSlots do
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then
if parent == nil then
gearSlots[i].Kill.Value = true
return false
elseif child.Parent == player.Character then
gearSlots[i].Selected = true
return true
elseif child.Parent == player.Backpack then
if child:IsA("Tool") then gearSlots[i].Selected = false end
return true
else
gearSlots[i].Kill.Value = true
return false
end
return true
end
end
end
end
function removeAllEquippedGear(physGear)
local stuff = player.Character:GetChildren()
for i = 1, #stuff do
if ( stuff[i]:IsA("Tool") or stuff[i]:IsA("HopperBin") ) and stuff[i] ~= physGear then
if stuff[i]:IsA("Tool") then stuff[i].Parent = player.Backpack end
if stuff[i]:IsA("HopperBin") then
stuff[i]:Disable()
end
end
end
end
function hopperBinSwitcher(numKey, physGear)
if not physGear then return end
physGear:ToggleSelect()
if gearSlots[numKey] == "empty" then return end
if not physGear.Active then
gearSlots[numKey].Selected = false
normalizeButton(gearSlots[numKey])
else
gearSlots[numKey].Selected = true
enlargeButton(gearSlots[numKey])
end
end
function toolSwitcher(numKey)
if not gearSlots[numKey] then return end
local physGear = gearSlots[numKey].GearReference.Value
if physGear == nil then return end
removeAllEquippedGear(physGear) -- we don't remove this gear, as then we get a double switcheroo
local key = numKey
if numKey == 0 then key = 10 end
for i = 1, #gearSlots do
if gearSlots[i] and gearSlots[i] ~= "empty" and i ~= key then
normalizeButton(gearSlots[i])
gearSlots[i].Selected = false
if gearSlots[i].GearReference.Value:IsA("HopperBin") and gearSlots[i].GearReference.Value.Active then
gearSlots[i].GearReference.Value:ToggleSelect()
end
end
end
if physGear:IsA("HopperBin") then
hopperBinSwitcher(numKey,physGear)
else
if physGear.Parent == player.Character then
physGear.Parent = player.Backpack
gearSlots[numKey].Selected = false
normalizeButton(gearSlots[numKey])
else
physGear.Parent = player.Character
gearSlots[numKey].Selected = true
enlargeButton(gearSlots[numKey])
end
end
end
function activateGear(num)
local numKey = nil
if num == "0" then
numKey = 10 -- why do lua indexes have to start at 1? :(
else
numKey = tonumber(num)
end
if(numKey == nil) then return end
if gearSlots[numKey] ~= "empty" then
toolSwitcher(numKey)
end
end
enlargeButton = function(button)
if button.Size.Y.Scale > 1 then return end
if not button.Parent then return end
if not button.Selected then return end
for i = 1, #gearSlots do
if gearSlots[i] == "empty" then break end
if gearSlots[i] ~= button then
normalizeButton(gearSlots[i])
end
end
if not enlargeOverride then
waitingOnEnlarge = button
return
end
if button:IsA("ImageButton") or button:IsA("TextButton") then
button.ZIndex = 2
local centerizeX = -(buttonSizeEnlarge.X.Scale - button.Size.X.Scale)/2
local centerizeY = -(buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale)/2
button:TweenSizeAndPosition(buttonSizeEnlarge,
UDim2.new(button.Position.X.Scale + centerizeX,button.Position.X.Offset,button.Position.Y.Scale + centerizeY,button.Position.Y.Offset),
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,guiTweenSpeed/5,enlargeOverride)
end
end
normalizeAllButtons = function()
for i = 1, #gearSlots do
if gearSlots[i] == "empty" then break end
if gearSlots[i] ~= button then
normalizeButton(gearSlots[i],0.1)
end
end
end
normalizeButton = function(button, speed)
if not button then return end
if button.Size.Y.Scale <= 1 then return end
if button.Selected then return end
if not button.Parent then return end
local moveSpeed = speed
if moveSpeed == nil or type(moveSpeed) ~= "number" then moveSpeed = guiTweenSpeed/5 end
if button:IsA("ImageButton") or button:IsA("TextButton") then
button.ZIndex = 1
local inverseEnlarge = 1/enlargeFactor
local centerizeX = -(buttonSizeNormal.X.Scale - button.Size.X.Scale)/2
local centerizeY = -(buttonSizeNormal.Y.Scale - button.Size.Y.Scale)/2
button:TweenSizeAndPosition(buttonSizeNormal,
UDim2.new(button.Position.X.Scale + centerizeX,button.Position.X.Offset,button.Position.Y.Scale + centerizeY,button.Position.Y.Offset),
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,moveSpeed,enlargeOverride)
end
end
waitForDebounce = function()
if debounce.Value then
debounce.Changed:wait()
end
end
function pointInRectangle(point,rectTopLeft,rectSize)
if point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then
if point.y > rectTopLeft.y and point.y < (rectTopLeft.y + rectSize.y) then
return true
end
end
return false
end
function swapGear(gearClone,toFrame)
local toFrameChildren = toFrame:GetChildren()
if #toFrameChildren == 1 then
if toFrameChildren[1]:FindFirstChild("SlotNumber") then
local toSlot = tonumber(toFrameChildren[1].SlotNumber.Text)
local gearCloneSlot = tonumber(gearClone.SlotNumber.Text)
if toSlot == 0 then toSlot = 10 end
if gearCloneSlot == 0 then gearCloneSlot = 10 end
gearSlots[toSlot] = gearClone
gearSlots[gearCloneSlot] = toFrameChildren[1]
toFrameChildren[1].SlotNumber.Text = gearClone.SlotNumber.Text
toFrameChildren[1].SlotNumberDownShadow.Text = gearClone.SlotNumber.Text
toFrameChildren[1].SlotNumberUpShadow.Text = gearClone.SlotNumber.Text
local subString = string.sub(toFrame.Name,5)
gearClone.SlotNumber.Text = subString
gearClone.SlotNumberDownShadow.Text = subString
gearClone.SlotNumberUpShadow.Text = subString
gearClone.Position = UDim2.new(gearClone.Position.X.Scale,0,gearClone.Position.Y.Scale,0)
toFrameChildren[1].Position = UDim2.new(toFrameChildren[1].Position.X.Scale,0,toFrameChildren[1].Position.Y.Scale,0)
toFrameChildren[1].Parent = gearClone.Parent
gearClone.Parent = toFrame
end
else
local slotNum = tonumber(gearClone.SlotNumber.Text)
if slotNum == 0 then slotNum = 10 end
gearSlots[slotNum] = "empty" -- reset this gear slot
local subString = string.sub(toFrame.Name,5)
gearClone.SlotNumber.Text = subString
gearClone.SlotNumberDownShadow.Text = subString
gearClone.SlotNumberUpShadow.Text = subString
local toSlotNum = tonumber(gearClone.SlotNumber.Text)
if toSlotNum == 0 then toSlotNum = 10 end
gearSlots[toSlotNum] = gearClone
gearClone.Position = UDim2.new(gearClone.Position.X.Scale,0,gearClone.Position.Y.Scale,0)
gearClone.Parent = toFrame
end
end
function resolveDrag(gearClone,x,y)
local mousePoint = Vector2.new(x,y)
local frame = gearClone.Parent
local frames = frame.Parent:GetChildren()
for i = 1, #frames do
if frames[i]:IsA("Frame") then
if pointInRectangle(mousePoint, frames[i].AbsolutePosition,frames[i].AbsoluteSize) then
swapGear(gearClone,frames[i])
return true
end
end
end
if x < frame.AbsolutePosition.x or x > ( frame.AbsolutePosition.x + frame.AbsoluteSize.x ) then
reorganizeLoadout(gearClone,false)
return false
elseif y < frame.AbsolutePosition.y or y > ( frame.AbsolutePosition.y + frame.AbsoluteSize.y ) then
reorganizeLoadout(gearClone,false)
return false
else
if dragBeginPos then gearClone.Position = dragBeginPos end
return -1
end
end
function unequipAllItems(dontEquipThis)
for i = 1, #gearSlots do
if gearSlots[i] == "empty" then break end
if gearSlots[i].GearReference.Value ~= dontEquipThis then
if gearSlots[i].GearReference.Value:IsA("HopperBin") then
gearSlots[i].GearReference.Value:Disable()
elseif gearSlots[i].GearReference.Value:IsA("Tool") then
gearSlots[i].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack
end
gearSlots[i].Selected = false
end
end
end
local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton)
waitForDebounce()
debounce.Value = true
if child:FindFirstChild("RobloxBuildTool") then debounce.Value = false return end -- don't show roblox build tools
if not child:IsA("Tool") then
if not child:IsA("HopperBin") then
debounce.Value = false
return -- we don't care about anything besides tools (sigh...)
end
end
if not addToSlot then
for i = 1, #gearSlots do
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then -- we already have gear, do nothing
debounce.Value = false
return
end
end
end
local gearClone = currentLoadout.TempSlot:clone()
gearClone.Name = child.Name
gearClone.GearImage.Image = child.TextureId
if gearClone.GearImage.Image == "" then
gearClone.GearText.Text = child.Name
end
gearClone.GearReference.Value = child
gearClone.RobloxLocked = true
local slotToMod = -1
if not addToSlot then
for i = 1, #gearSlots do
if gearSlots[i] == "empty" then
slotToMod = i
break
end
end
else
slotToMod = addToSlot
end
if slotToMod == - 1 then debounce.Value = false print("no slots!") return end -- No available slot to add in!
local slotNum = slotToMod % 10
local parent = currentLoadout:FindFirstChild("Slot"..tostring(slotNum))
gearClone.Parent = parent
if inventoryGearButton then
local absolutePositionFinal = inventoryGearButton.AbsolutePosition
local currentAbsolutePosition = gearClone.AbsolutePosition
local diff = absolutePositionFinal - currentAbsolutePosition
gearClone.Position = UDim2.new(gearClone.Position.X.Scale,diff.x,gearClone.Position.Y.Scale,diff.y)
gearClone.ZIndex = 4
end
if addToSlot then
reorganizeLoadout(gearClone, true, equipped, addToSlot)
else
reorganizeLoadout(gearClone, true)
end
if gearClone.Parent == nil then debounce.Value = false return end -- couldn't fit in (hopper is full!)
if equipped then
gearClone.Selected = true
unequipAllItems(child)
delay(guiTweenSpeed + 0.01,function() -- if our gear is equipped, we will want to enlarge it when done moving
if (gearClone.GearReference.Value:IsA("Tool") and gearClone:FindFirstChild("GearReference") and gearClone.GearReference.Value.Parent == player.Character) or
(gearClone.GearReference.Value:IsA("HopperBin") and gearClone.GearReference.Value.Active == true) then
enlargeButton(gearClone)
end
end)
end
local dragBeginPos = nil
local clickCon, buttonDeleteCon, mouseEnterCon, mouseLeaveCon, dragStop, dragBegin = nil
clickCon = gearClone.MouseButton1Click:connect(function() if not gearClone.Draggable then activateGear(gearClone.SlotNumber.Text) end end)
mouseEnterCon = gearClone.MouseEnter:connect(function()
if guiBackpack.Visible then
gearClone.Draggable = true
end
end)
dragBegin = gearClone.DragBegin:connect(function(pos)
dragBeginPos = pos
gearClone.ZIndex = 7
local children = gearClone:GetChildren()
for i = 1, #children do
if children[i]:IsA("TextLabel") then
if string.find(children[i].Name,"Shadow") then
children[i].ZIndex = 8
else
children[i].ZIndex = 9
end
elseif children[i]:IsA("Frame") or children[i]:IsA("ImageLabel") then
children[i].ZIndex = 7
end
end
end)
dragStop = gearClone.DragStopped:connect(function(x,y)
if gearClone.Selected then
gearClone.ZIndex = 2
else
gearClone.ZIndex = 1
end
local children = gearClone:GetChildren()
for i = 1, #children do
if children[i]:IsA("TextLabel") then
if string.find(children[i].Name,"Shadow") then
children[i].ZIndex = 3
else
children[i].ZIndex = 4
end
elseif children[i]:IsA("Frame") or children[i]:IsA("ImageLabel") then
children[i].ZIndex = 2
end
end
resolveDrag(gearClone,x,y)
end)
mouseLeaveCon = gearClone.MouseLeave:connect(function()
gearClone.Draggable = false
end)
buttonDeleteCon = gearClone.AncestryChanged:connect(function()
if gearClone.Parent and gearClone.Parent.Parent == currentLoadout then return end
if clickCon then clickCon:disconnect() end
if buttonDeleteCon then buttonDeleteCon:disconnect() end
if mouseEnterCon then mouseEnterCon:disconnect() end
if mouseLeaveCon then mouseLeaveCon:disconnect() end
if dragStop then dragStop:disconnect() end
if dragBegin then dragBegin:disconnect() end
end) -- this probably isn't necessary since objects are being deleted (probably), but this might still leak just in case
local childCon = nil
local childChangeCon = nil
childCon = child.AncestryChanged:connect(function(newChild,parent)
if not checkToolAncestry(newChild,parent) then
if childCon then childCon:disconnect() end
if childChangeCon then childChangeCon:disconnect() end
removeFromInventory(child)
elseif parent == game.Players.LocalPlayer.Backpack then
normalizeButton(gearClone)
end
end)
childChangeCon = child.Changed:connect(function(prop)
if prop == "Name" then
if gearClone and gearClone.GearImage.Image == "" then
gearClone.GearText.Text = child.Name
end
end
end)
debounce.Value = false
end
function addToInventory(child)
if not child:IsA("Tool") or not child:IsA("HopperBin") then return end
local slot = nil
for i = 1, #inventory do
if inventory[i] and inventory[i] == child then return end
if not inventory[i] then slot = i end
end
if slot then
inventory[slot] = child
elseif #inventory < 1 then
inventory[1] = child
else
inventory[#inventory + 1] = child
end
end
function removeFromInventory(child)
for i = 1, #inventory do
if inventory[i] == child then
table.remove(inventory,i)
inventory[i] = nil
end
end
end
-- these next two functions are used for safe guarding
-- when we are waiting for character to come back after dying
function activateLoadout()
keyPressCon = game:GetService("GuiService").KeyPressed:connect(function(key) activateGear(key) end)
currentLoadout.Visible = true
end
function deactivateLoadout()
if keyPressCon then keyPressCon:disconnect() end
currentLoadout.Visible = false
end
function setupBackpackListener()
if backpackChildCon then backpackChildCon:disconnect() end
backpackChildCon = player.Backpack.ChildAdded:connect(function(child)
addingPlayerChild(child)
addToInventory(child)
end)
end
function playerCharacterChildAdded(child)
addingPlayerChild(child,true)
addToInventory(child)
end
-- End Functions
-- Begin Script
wait() -- let stuff initialize incase this is first heartbeat...
waitForChild(player,"Backpack")
local backpackChildren = player.Backpack:GetChildren()
local size = math.min(10,#backpackChildren)
for i = 1, size do
addingPlayerChild(backpackChildren[i],false)
end
setupBackpackListener()
waitForProperty(player,"Character")
for i,v in ipairs(player.Character:GetChildren()) do
playerCharacterChildAdded(v)
end
characterChildAddedCon = player.Character.ChildAdded:connect(function(child) playerCharacterChildAdded(child) end)
waitForChild(player.Character,"Humanoid")
humanoidDiedCon = player.Character.Humanoid.Died:connect(function() deactivateLoadout() end)
player.CharacterRemoving:connect(function()
if characterChildAddedCon then characterChildAddedCon:disconnect() end
if humanoidDiedCon then humanoidDiedCon:disconnect() end
if backpackChildCon then backpackChildCon:disconnect() end
deactivateLoadout()
end)
player.CharacterAdded:connect(function()
player = game.Players.LocalPlayer -- make sure we are still looking at the correct character
for i = 1, #gearSlots do
if gearSlots[i] ~= "empty" then
gearSlots[i].Parent = nil
gearSlots[i] = "empty"
end
end
waitForChild(player,"Backpack")
local backpackChildren = player.Backpack:GetChildren()
local size = math.min(10,#backpackChildren)
for i = 1, size do
addingPlayerChild(backpackChildren[i])
end
setupBackpackListener()
characterChildAddedCon =
player.Character.ChildAdded:connect(function(child)
addingPlayerChild(child,true)
end)
waitForChild(player.Character,"Humanoid")
humanoidDiedCon =
player.Character.Humanoid.Died:connect(function()
deactivateLoadout()
end)
activateLoadout()
end)
waitForChild(guiBackpack,"SwapSlot")
guiBackpack.SwapSlot.Changed:connect(function()
if guiBackpack.SwapSlot.Value then
local swapSlot = guiBackpack.SwapSlot
local pos = swapSlot.Slot.Value
if pos == 0 then pos = 10 end
if gearSlots[pos] then
reorganizeLoadout(gearSlots[pos],false)
end
if swapSlot.GearButton.Value then
addingPlayerChild(swapSlot.GearButton.Value.GearReference.Value,false,pos)
end
guiBackpack.SwapSlot.Value = false
end
end)
keyPressCon = game:GetService("GuiService").KeyPressed:connect(function(key) activateGear(key) end)
end)

View File

@ -0,0 +1,563 @@
delay(0, function()
function waitForProperty(instance, name)
while not instance[name] do
instance.Changed:wait()
end
end
function waitForChild(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 screenGui
local chatNotificationGui
local messageDialog
local timeoutScript
local reenableDialogScript
local dialogMap = {}
local dialogConnections = {}
local gui = nil
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
function currentTone()
if currentConversationDialog then
return currentConversationDialog.Tone
else
return Enum.DialogTone.Neutral
end
end
function createChatNotificationGui()
chatNotificationGui = Instance.new("BillboardGui")
chatNotificationGui.Name = "ChatNotificationGui"
chatNotificationGui.ExtentsOffset = Vector3.new(0,1,0)
chatNotificationGui.Size = UDim2.new(4, 0, 5.42857122, 0)
chatNotificationGui.SizeOffset = Vector2.new(0,0)
chatNotificationGui.StudsOffset = Vector3.new(0.4, 4.3, 0)
chatNotificationGui.Enabled = true
chatNotificationGui.RobloxLocked = true
chatNotificationGui.Active = true
local image = Instance.new("ImageLabel")
image.Name = "Image"
image.Active = false
image.BackgroundTransparency = 1
image.Position = UDim2.new(0,0,0,0)
image.Size = UDim2.new(1.0,0,1.0,0)
image.Image = ""
image.RobloxLocked = true
image.Parent = chatNotificationGui
local button = Instance.new("ImageButton")
button.Name = "Button"
button.AutoButtonColor = false
button.Position = UDim2.new(0.0879999995, 0, 0.0529999994, 0)
button.Size = UDim2.new(0.829999983, 0, 0.460000008, 0)
button.Image = ""
button.BackgroundTransparency = 1
button.RobloxLocked = true
button.Parent = image
end
function getChatColor(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
function styleChoices(tone)
for i, obj in pairs(choices) do
resetColor(obj, tone)
end
resetColor(lastChoice, tone)
end
function styleMainFrame(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
styleChoices(tone)
end
function setChatNotificationTone(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
function createMessageDialog()
messageDialog = Instance.new("Frame");
messageDialog.Name = "DialogScriptMessage"
messageDialog.Style = Enum.FrameStyle.RobloxRound
messageDialog.Visible = false
local text = Instance.new("TextLabel")
text.Name = "Text"
text.Position = UDim2.new(0,0,0,-1)
text.Size = UDim2.new(1,0,1,0)
text.FontSize = Enum.FontSize.Size14
text.BackgroundTransparency = 1
text.TextColor3 = Color3.new(1,1,1)
text.RobloxLocked = true
text.Parent = messageDialog
end
function showMessage(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
end
function variableDelay(str)
local length = math.min(string.len(str), 100)
wait(0.75 + ((length/75) * 1.5))
end
function resetColor(frame, tone)
if tone == Enum.DialogTone.Neutral then
frame.BackgroundColor3 = Color3.new(0/255, 0/255, 179/255)
frame.Number.TextColor3 = Color3.new(45/255, 142/255, 245/255)
elseif tone == Enum.DialogTone.Friendly then
frame.BackgroundColor3 = Color3.new(0/255, 77/255, 0/255)
frame.Number.TextColor3 = Color3.new(0/255, 190/255, 0/255)
elseif tone == Enum.DialogTone.Enemy then
frame.BackgroundColor3 = Color3.new(140/255, 0/255, 0/255)
frame.Number.TextColor3 = Color3.new(255/255,88/255, 79/255)
end
end
function highlightColor(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/255, 128/255, 0/255)
frame.Number.TextColor3 = Color3.new(1, 1, 1)
elseif tone == Enum.DialogTone.Enemy then
frame.BackgroundColor3 = Color3.new(204/255, 0/255, 0/255)
frame.Number.TextColor3 = Color3.new(1, 1, 1)
end
end
function wanderDialog()
print("Wander")
mainFrame.Visible = false
endDialog()
showMessage(characterWanderedOffMessage, characterWanderedOffSize)
end
function timeoutDialog()
print("Timeout")
mainFrame.Visible = false
endDialog()
showMessage(conversationTimedOut, conversationTimedOutSize)
end
function normalEndDialog()
print("Done")
endDialog()
end
function endDialog()
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
function sanitizeMessage(msg)
if string.len(msg) == 0 then
return "..."
else
return msg
end
end
function selectChoice(choice)
renewKillswitch(currentConversationDialog)
--First hide the Gui
mainFrame.Visible = false
if choice == lastChoice then
game.Chat:Chat(game.Players.LocalPlayer.Character, "Goodbye!", getChatColor(currentTone()))
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)
presentDialogChoices(currentConversationPartner, dialogChoice:GetChildren())
end
end
function newChoice(numberText)
local frame = Instance.new("TextButton")
frame.BackgroundColor3 = Color3.new(0/255, 0/255, 179/255)
frame.AutoButtonColor = false
frame.BorderSizePixel = 0
frame.Text = ""
frame.MouseEnter:connect(function() highlightColor(frame, currentTone()) end)
frame.MouseLeave:connect(function() resetColor(frame, currentTone()) end)
frame.MouseButton1Click:connect(function() selectChoice(frame) end)
frame.RobloxLocked = true
local number = Instance.new("TextLabel")
number.Name = "Number"
number.TextColor3 = Color3.new(127/255, 212/255, 255/255)
number.Text = numberText
number.FontSize = Enum.FontSize.Size14
number.BackgroundTransparency = 1
number.Position = UDim2.new(0,4,0,2)
number.Size = UDim2.new(0,20,0,24)
number.TextXAlignment = Enum.TextXAlignment.Left
number.TextYAlignment = Enum.TextYAlignment.Top
number.RobloxLocked = true
number.Parent = frame
local prompt = Instance.new("TextLabel")
prompt.Name = "UserPrompt"
prompt.BackgroundTransparency = 1
prompt.TextColor3 = Color3.new(1,1,1)
prompt.FontSize = Enum.FontSize.Size14
prompt.Position = UDim2.new(0,28, 0, 2)
prompt.Size = UDim2.new(1,-32, 1, -4)
prompt.TextXAlignment = Enum.TextXAlignment.Left
prompt.TextYAlignment = Enum.TextYAlignment.Top
prompt.TextWrap = true
prompt.RobloxLocked = true
prompt.Parent = frame
return frame
end
function initialize(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 = Instance.new("Frame")
mainFrame.Name = "UserDialogArea"
mainFrame.Size = UDim2.new(0, 350, 0, 200)
mainFrame.Style = Enum.FrameStyle.ChatBlue
mainFrame.Visible = false
imageLabel = Instance.new("ImageLabel")
imageLabel.Name = "Tail"
imageLabel.Size = UDim2.new(0,62,0,53)
imageLabel.Position = UDim2.new(1,8,0.25)
imageLabel.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png"
imageLabel.BackgroundTransparency = 1
imageLabel.RobloxLocked = true
imageLabel.Parent = mainFrame
for n, obj in pairs(choices) do
obj.RobloxLocked = true
obj.Parent = mainFrame
end
lastChoice.RobloxLocked = true
lastChoice.Parent = mainFrame
mainFrame.RobloxLocked = true
mainFrame.Parent = parent
end
function presentDialogChoices(talkingPart, dialogChoices)
if not currentConversationDialog then
return
end
currentConversationPartner = talkingPart
sortedDialogChoices = {}
for n, 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 n, obj in pairs(choices) do
obj.Visible = false
end
for n, obj in pairs(sortedDialogChoices) do
if pos <= #choices then
--3 lines is the maximum, set it to that temporarily
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.0, -mainFrame.Size.Y.Offset-20)
styleMainFrame(currentTone())
mainFrame.Visible = true
end
function doDialog(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)
presentDialogChoices(dialog.Parent, dialog:GetChildren())
end
function renewKillswitch(dialog)
if currentAbortDialogScript then
currentAbortDialogScript:Remove()
currentAbortDialogScript = nil
end
currentAbortDialogScript = timeoutScript:Clone()
currentAbortDialogScript.archivable = false
currentAbortDialogScript.Disabled = false
currentAbortDialogScript.Parent = dialog
end
function checkForLeaveArea()
while currentConversationDialog do
if currentConversationDialog.Parent and (player:DistanceFromCharacter(currentConversationDialog.Parent.Position) >= currentConversationDialog.ConversationDistance) then
wanderDialog()
end
wait(1)
end
end
function startDialog(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)
doDialog(dialog)
end
end
function removeDialog(dialog)
if dialogMap[dialog] then
dialogMap[dialog]:Remove()
dialogMap[dialog] = nil
end
if dialogConnections[dialog] then
dialogConnections[dialog]:disconnect()
dialogConnections[dialog] = nil
end
end
function addDialog(dialog)
if dialog.Parent and 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() 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
--This handles the reparenting case, seperate from removal case
removeDialog(dialog)
addDialog(dialog)
elseif prop == "InUse" then
chatGui.Enabled = not currentConversationDialog and not dialog.InUse
if dialog == currentConversationDialog then
timeoutDialog()
end
elseif prop == "Tone" or prop == "Purpose" then
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
end
end)
end
end
function fetchScripts()
--[[local model = game:GetService("InsertService"):LoadAsset(39226062)
if type(model) == "string" then -- load failed, lets try again
wait(0.1)
model = game:GetService("InsertService"):LoadAsset(39226062)
end
if type(model) == "string" then -- not going to work, lets bail
return
end
waitForChild(model,"TimeoutScript")
timeoutScript = model.TimeoutScript
waitForChild(model,"ReenableDialogScript")
reenableDialogScript = model.ReenableDialogScript]]
--if not game.Lighting:FindFirstChild("CoreDialogScripts") then
--game.Workspace:InsertContent("rbxasset://scripts\\cores\\MainBotSupport.rbxm")
--end
waitForChild(game.Lighting,"CoreDialogScripts")
local model = game.Lighting.CoreDialogScripts
waitForChild(model,"TimeoutScript")
timeoutScript = model.TimeoutScript:Clone()
waitForChild(model,"ReenableDialogScript")
reenableDialogScript = model.ReenableDialogScript:Clone()
end
function onLoad()
waitForProperty(game.Players, "LocalPlayer")
player = game.Players.LocalPlayer
waitForProperty(player, "Character")
--print("Fetching Scripts")
fetchScripts()
--print("Creating Guis")
createChatNotificationGui()
--print("Creating MessageDialog")
createMessageDialog()
messageDialog.RobloxLocked = true
messageDialog.Parent = gui
--print("Waiting for BottomLeftControl")
waitForChild(gui, "BottomLeftControl")
--print("Initializing Frame")
local frame = Instance.new("Frame")
frame.Name = "DialogFrame"
frame.Position = UDim2.new(0,0,0,0)
frame.Size = UDim2.new(0,0,0,0)
frame.BackgroundTransparency = 1
frame.RobloxLocked = true
frame.Parent = gui.BottomLeftControl
initialize(frame)
--print("Adding Dialogs")
game.CollectionService.ItemAdded:connect(function(obj) if obj:IsA("Dialog") then addDialog(obj) end end)
game.CollectionService.ItemRemoved:connect(function(obj) if obj:IsA("Dialog") then removeDialog(obj) end end)
for i, obj in pairs(game.CollectionService:GetCollection("Dialog")) do
if obj:IsA("Dialog") then
addDialog(obj)
end
end
end
onLoad()
end)

View File

@ -0,0 +1,218 @@
delay(0, function()
function waitForProperty(instance, property)
while not instance[property] do
instance.Changed:wait()
end
end
function waitForChild(instance, name)
while not instance:FindFirstChild(name) do
instance.ChildAdded:wait()
end
end
waitForProperty(game.Players,"LocalPlayer")
waitForChild(game:GetService("CoreGui").RobloxGui,"Popup")
waitForChild(game:GetService("CoreGui").RobloxGui.Popup,"AcceptButton")
game:GetService("CoreGui").RobloxGui.Popup.AcceptButton.Modal = true
local localPlayer = game.Players.LocalPlayer
local acceptedTeleport = Instance.new("IntValue")
local friendRequestBlacklist = {}
local teleportEnabled = true
local makePopupInvisible = function()
if game:GetService("CoreGui").RobloxGui.Popup then game:GetService("CoreGui").RobloxGui.Popup.Visible = false end
end
function makeFriend(fromPlayer,toPlayer)
local popup = game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup")
if popup == nil then return end -- there is no popup!
if popup.Visible then return end -- currently popping something, abort!
if friendRequestBlacklist[fromPlayer] then return end -- previously cancelled friend request, we don't want it!
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 then yesCon:disconnect() end
if noCon then noCon:disconnect() end
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 then yesCon:disconnect() end
if noCon then noCon:disconnect() end
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 this doesn't involve me, then do nothing
if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then return end
if fromPlayer == localPlayer then
if event == Enum.FriendRequestEvent.Accept then
game:GetService("GuiService"):SendNotification("You are Friends",
"With " .. 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 -- previously cancelled friend request, we don't want it!
game:GetService("GuiService"):SendNotification("Friend Request",
"From " .. fromPlayer.Name,
"http://www.roblox.com/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=48&y=48",
8,
function()
makeFriend(fromPlayer,toPlayer)
end)
elseif event == Enum.FriendRequestEvent.Accept then
game:GetService("GuiService"):SendNotification("You are Friends",
"With " .. fromPlayer.Name .. "!",
"http://www.roblox.com/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=48&y=48",
5,
function()
end)
end
end
end)
function showOneButton()
local popup = script.Parent:FindFirstChild("Popup")
if popup then
popup.OKButton.Visible = true
popup.DeclineButton.Visible = false
popup.AcceptButton.Visible = false
end
end
function showTwoButtons()
local popup = script.Parent:FindFirstChild("Popup")
if popup then
popup.OKButton.Visible = false
popup.DeclineButton.Visible = true
popup.AcceptButton.Visible = true
end
end
if teleportEnabled then
game:GetService("TeleportService").ErrorCallback = function(message)
local popup = game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup")
showOneButton()
popup.PopupText.Text = message
local clickCon
clickCon = popup.OKButton.MouseButton1Click:connect(function()
if clickCon then clickCon:disconnect() end
game.GuiService:RemoveCenterDialog(game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup"))
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
end)
game.GuiService:AddCenterDialog(game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog,
--ShowFunction
function()
showOneButton()
game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup").Visible = true
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
end,
--HideFunction
function()
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 = game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup")
popup.PopupText.Text = message
popup.PopupImage.Image = ""
local yesCon, noCon
local function killCons()
if yesCon then yesCon:disconnect() end
if noCon then noCon:disconnect() end
game.GuiService:RemoveCenterDialog(game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup"))
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 = pcall(function() 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 then clickCon:disconnect() end
game.GuiService:RemoveCenterDialog(game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup"))
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
end)
game.GuiService:AddCenterDialog(game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog,
--ShowFunction
function()
showOneButton()
game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup").Visible = true
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
end,
--HideFunction
function()
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()
local success = pcall(function() game:GetService("TeleportService"):TeleportCancel() end)
end)
local centerDialogSuccess = pcall(function() game.GuiService:AddCenterDialog(game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog,
--ShowFunction
function()
showTwoButtons()
popup.AcceptButton.Text = "Leave"
popup.DeclineButton.Text = "Stay"
game:GetService("CoreGui").RobloxGui:FindFirstChild("Popup").Visible = true
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
end,
--HideFunction
function()
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
end)
end)
if centerDialogSuccess == false then
game:GetService("CoreGui").RobloxGui: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
end)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
--build our gui
delay(0, function()
local popupFrame = Instance.new("Frame")
popupFrame.Position = UDim2.new(0.5,-165,0.5,-175)
popupFrame.Size = UDim2.new(0,330,0,350)
popupFrame.Style = Enum.FrameStyle.RobloxRound
popupFrame.ZIndex = 4
popupFrame.Name = "Popup"
popupFrame.Visible = false
popupFrame.Parent = game:GetService("CoreGui").RobloxGui
local darken = popupFrame:clone()
darken.Size = UDim2.new(1,16,1,16)
darken.Position = UDim2.new(0,-8,0,-8)
darken.Name = "Darken"
darken.ZIndex = 1
darken.Parent = popupFrame
local acceptButton = Instance.new("TextButton")
acceptButton.Position = UDim2.new(0,20,0,270)
acceptButton.Size = UDim2.new(0,100,0,50)
acceptButton.Font = Enum.Font.ArialBold
acceptButton.FontSize = Enum.FontSize.Size24
acceptButton.Style = Enum.ButtonStyle.RobloxButton
acceptButton.TextColor3 = Color3.new(248/255,248/255,248/255)
acceptButton.Text = "Yes"
acceptButton.ZIndex = 5
acceptButton.Name = "AcceptButton"
acceptButton.Parent = popupFrame
local declineButton = acceptButton:clone()
declineButton.Position = UDim2.new(1,-120,0,270)
declineButton.Text = "No"
declineButton.Name = "DeclineButton"
declineButton.Parent = popupFrame
local okButton = acceptButton:clone()
okButton.Name = "OKButton"
okButton.Text = "OK"
okButton.Position = UDim2.new(0.5,-50,0,270)
okButton.Visible = false
okButton.Parent = popupFrame
local popupImage = Instance.new("ImageLabel")
popupImage.BackgroundTransparency = 1
popupImage.Position = UDim2.new(0.5,-140,0,0)
popupImage.Size = UDim2.new(0,280,0,280)
popupImage.ZIndex = 3
popupImage.Name = "PopupImage"
popupImage.Parent = popupFrame
local backing = Instance.new("ImageLabel")
backing.BackgroundTransparency = 1
backing.Size = UDim2.new(1,0,1,0)
backing.Image = "rbxasset://textures/ui/backing.png"
backing.Name = "Backing"
backing.ZIndex = 2
backing.Parent = popupImage
local popupText = Instance.new("TextLabel")
popupText.Name = "PopupText"
popupText.Size = UDim2.new(1,0,0.8,0)
popupText.Font = Enum.Font.ArialBold
popupText.FontSize = Enum.FontSize.Size36
popupText.BackgroundTransparency = 1
popupText.Text = "Hello I'm a popup"
popupText.TextColor3 = Color3.new(248/255,248/255,248/255)
popupText.TextWrap = true
popupText.ZIndex = 5
popupText.Parent = popupFrame
end)

View File

@ -0,0 +1,73 @@
-- this script is responsible for keeping the gui proportions under control
delay(0, function()
local screen = game:GetService("CoreGui").RobloxGui
local BottomLeftControl
local BottomRightControl
local TopLeftControl
local BuildTools
local controlFrame = screen:FindFirstChild("ControlFrame")
local loadoutPadding = 43
local currentLoadout
BottomLeftControl = controlFrame:FindFirstChild("BottomLeftControl")
BottomRightControl = controlFrame:FindFirstChild("BottomRightControl")
TopLeftControl = controlFrame:FindFirstChild("TopLeftControl")
currentLoadout = screen:FindFirstChild("CurrentLoadout")
BuildTools = controlFrame:FindFirstChild("BuildTools")
function makeYRelative()
BottomLeftControl.SizeConstraint = 2
BottomRightControl.SizeConstraint = 2
if TopLeftControl then TopLeftControl.SizeConstraint = 2 end
if currentLoadout then currentLoadout.SizeConstraint = 2 end
if BuildTools then BuildTools.Frame.SizeConstraint = 2 end
BottomLeftControl.Position = UDim2.new(0,0,1,-BottomLeftControl.AbsoluteSize.Y)
BottomRightControl.Position = UDim2.new(1,-BottomRightControl.AbsoluteSize.X,1,-BottomRightControl.AbsoluteSize.Y)
end
function makeXRelative()
BottomLeftControl.SizeConstraint = 1
BottomRightControl.SizeConstraint = 1
if TopLeftControl then TopLeftControl.SizeConstraint = 1 end
if currentLoadout then currentLoadout.SizeConstraint = 1 end
if BuildTools then BuildTools.Frame.SizeConstraint = 1 end
BottomLeftControl.Position = UDim2.new(0,0,1,-BottomLeftControl.AbsoluteSize.Y)
BottomRightControl.Position = UDim2.new(1,-BottomRightControl.AbsoluteSize.X,1,-BottomRightControl.AbsoluteSize.Y)
end
local function resize()
if screen.AbsoluteSize.x > screen.AbsoluteSize.y then
makeYRelative()
else
makeXRelative()
end
if currentLoadout then
currentLoadout.Position =
UDim2.new(0,screen.AbsoluteSize.X/2 -currentLoadout.AbsoluteSize.X/2,currentLoadout.Position.Y.Scale,-currentLoadout.AbsoluteSize.Y - loadoutPadding)
end
end
screen.Changed:connect(function(property)
if property == "AbsoluteSize" then
wait()
resize()
end
end)
wait()
resize()
end)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
-- Creates all neccessary scripts for the gui on initial load, everything except build tools
-- Created by Ben T. 10/29/10
-- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
delay(0, function()
print("Accurate CS by Matt Brown.")
local function waitForChild(instance, name)
while not instance:FindFirstChild(name) do
instance.ChildAdded:wait()
end
end
local function waitForProperty(instance, property)
while not instance[property] do
instance.Changed:wait()
end
end
local backpackTestPlaces = {41324860,87241143,1818,65033,25415,14403,33913,21783593,17467963,3271,16184658}
waitForChild(game:GetService("CoreGui"),"RobloxGui")
local screenGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui")
local scriptContext = game:GetService("ScriptContext")
-- Resizer (dynamically resizes gui)
dofile("rbxasset://scripts\\cores\\Resizer.lua")
-- SubMenuBuilder (builds out the material,surface and color panels)
dofile("rbxasset://scripts\\cores\\SubMenuBuilder.lua")
-- ToolTipper (creates tool tips for gui)
dofile("rbxasset://scripts\\cores\\ToolTipper.lua")
--[[if game.CoreGui.Version < 2 then
-- (controls the movement and selection of sub panels)
-- PaintMenuMover
scriptContext:AddCoreScript(36040464,screenGui.BuildTools.Frame.PropertyTools.PaintTool,"PaintMenuMover")
-- MaterialMenuMover
scriptContext:AddCoreScript(36040495,screenGui.BuildTools.Frame.PropertyTools.MaterialSelector,"MaterialMenuMover")
-- InputMenuMover
scriptContext:AddCoreScript(36040483,screenGui.BuildTools.Frame.PropertyTools.InputSelector,"InputMenuMover")
end]]
-- SettingsScript
dofile("rbxasset://scripts\\cores\\SettingsScript.lua")
-- MainBotChatScript
dofile("rbxasset://scripts\\cores\\MainBotChatScript.lua")
if game.CoreGui.Version >= 2 then
-- New Player List
dofile("rbxasset://scripts\\cores\\PlayerlistScript.lua")
-- Popup Script
dofile("rbxasset://scripts\\cores\\PopupScript.lua")
-- Friend Notification Script (probably can use this script to expand out to other notifications)
dofile("rbxasset://scripts\\cores\\NotificationScript.lua")
end
if game.CoreGui.Version >= 3 then
waitForProperty(game,"PlaceId")
local inRightPlace = false
for i,v in ipairs(backpackTestPlaces) do
if v == game.PlaceId then
inRightPlace = true
break
end
end
waitForChild(game,"Players")
waitForProperty(game.Players,"LocalPlayer")
if game.Players.LocalPlayer.userId == 7210880 or game.Players.LocalPlayer.userId == 0 then inRightPlace = true end
--if not inRightPlace then return end -- restricting availability of backpack
-- Backpack Builder
dofile("rbxasset://scripts\\cores\\BackpackBuilder.lua")
waitForChild(screenGui,"CurrentLoadout")
waitForChild(screenGui.CurrentLoadout,"TempSlot")
waitForChild(screenGui.CurrentLoadout.TempSlot,"SlotNumber")
-- Backpack Script
dofile("rbxasset://scripts\\cores\\BackpackScript.lua")
end
end)

View File

@ -0,0 +1,50 @@
-- Creates all neccessary scripts for the gui on initial load, everything except build tools
-- Created by Ben T. 10/29/10
-- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
delay(0, function()
print("Accurate CS by Matt Brown.")
local function waitForChild(instance, name)
while not instance:FindFirstChild(name) do
instance.ChildAdded:wait()
end
end
local function waitForProperty(instance, property)
while not instance[property] do
instance.Changed:wait()
end
end
waitForChild(game:GetService("CoreGui"),"RobloxGui")
local screenGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui")
local scriptContext = game:GetService("ScriptContext")
-- Resizer (dynamically resizes gui)
dofile("rbxasset://scripts\\cores\\Resizer.lua")
-- SubMenuBuilder (builds out the material,surface and color panels)
dofile("rbxasset://scripts\\cores\\SubMenuBuilder.lua")
-- ToolTipper (creates tool tips for gui)
dofile("rbxasset://scripts\\cores\\ToolTipper.lua")
--[[if game.CoreGui.Version < 2 then
-- (controls the movement and selection of sub panels)
-- PaintMenuMover
scriptContext:AddCoreScript(36040464,screenGui.BuildTools.Frame.PropertyTools.PaintTool,"PaintMenuMover")
-- MaterialMenuMover
scriptContext:AddCoreScript(36040495,screenGui.BuildTools.Frame.PropertyTools.MaterialSelector,"MaterialMenuMover")
-- InputMenuMover
scriptContext:AddCoreScript(36040483,screenGui.BuildTools.Frame.PropertyTools.InputSelector,"InputMenuMover")
end]]
-- SettingsScript
dofile("rbxasset://scripts\\cores\\SettingsScript.lua")
-- MainBotChatScript
dofile("rbxasset://scripts\\cores\\MainBotChatScript.lua")
end)

View File

@ -0,0 +1,294 @@
-- creates the in-game gui sub menus for property tools
-- written 9/27/2010 by Ben (jeditkacheff)
delay(0, function()
local gui = game:GetService("CoreGui").RobloxGui
if gui:FindFirstChild("ControlFrame") then
gui = gui:FindFirstChild("ControlFrame")
end
local currentlySelectedButton = nil
local localAssetBase = "rbxasset://textures/ui/"
local selectedButton = Instance.new("ObjectValue")
selectedButton.RobloxLocked = true
selectedButton.Name = "SelectedButton"
selectedButton.Parent = gui.BuildTools
local closeButton = Instance.new("ImageButton")
closeButton.Name = "CloseButton"
closeButton.RobloxLocked = true
closeButton.BackgroundTransparency = 1
closeButton.Image = localAssetBase .. "CloseButton.png"
closeButton.ZIndex = 2
closeButton.Size = UDim2.new(0.2,0,0.05,0)
closeButton.AutoButtonColor = false
closeButton.Position = UDim2.new(0.75,0,0.01,0)
function setUpCloseButtonState(button)
button.MouseEnter:connect(function()
button.Image = localAssetBase .. "CloseButton_dn.png"
end)
button.MouseLeave:connect(function()
button.Image = localAssetBase .. "CloseButton.png"
end)
button.MouseButton1Click:connect(function()
button.ClosedState.Value = true
button.Image = localAssetBase .. "CloseButton.png"
end)
end
-- nice selection animation
function fadeInButton(button)
if currentlySelectedButton ~= nil then
currentlySelectedButton.Selected = false
currentlySelectedButton.ZIndex = 2
currentlySelectedButton.Frame.BackgroundTransparency = 1
end
local speed = 0.1
button.ZIndex = 3
while button.Frame.BackgroundTransparency > 0 do
button.Frame.BackgroundTransparency = button.Frame.BackgroundTransparency - speed
wait()
end
button.Selected = true
currentlySelectedButton = button
selectedButton.Value = currentlySelectedButton
end
------------------------------- create the color selection sub menu -----------------------------------
local paintMenu = Instance.new("ImageLabel")
local paintTool = gui.BuildTools.Frame.PropertyTools.PaintTool
paintMenu.Name = "PaintMenu"
paintMenu.RobloxLocked = true
paintMenu.Parent = paintTool
paintMenu.Position = UDim2.new(-2.7,0,-3,0)
paintMenu.Size = UDim2.new(2.5,0,10,0)
paintMenu.BackgroundTransparency = 1
paintMenu.ZIndex = 2
paintMenu.Image = localAssetBase .. "PaintMenu.png"
local paintColorButton = Instance.new("ImageButton")
paintColorButton.RobloxLocked = true
paintColorButton.BorderSizePixel = 0
paintColorButton.ZIndex = 2
paintColorButton.Size = UDim2.new(0.200000003, 0,0.0500000007, 0)
local selection = Instance.new("Frame")
selection.RobloxLocked = true
selection.BorderSizePixel = 0
selection.BackgroundColor3 = Color3.new(1,1,1)
selection.BackgroundTransparency = 1
selection.ZIndex = 2
selection.Size = UDim2.new(1.1,0,1.1,0)
selection.Position = UDim2.new(-0.05,0,-0.05,0)
selection.Parent = paintColorButton
local header = 0.08
local spacing = 18
local count = 1
function findNextColor()
colorName = tostring(BrickColor.new(count))
while colorName == "Medium stone grey" do
count = count + 1
colorName = tostring(BrickColor.new(count))
end
return count
end
for i = 0,15 do
for j = 1, 4 do
newButton = paintColorButton:clone()
newButton.RobloxLocked = true
newButton.BackgroundColor3 = BrickColor.new(findNextColor()).Color
newButton.Name = tostring(BrickColor.new(count))
count = count + 1
if j == 1 then newButton.Position = UDim2.new(0.08,0,i/spacing + header,0)
elseif j == 2 then newButton.Position = UDim2.new(0.29,0,i/spacing + header,0)
elseif j == 3 then newButton.Position = UDim2.new(0.5,0,i/spacing + header,0)
elseif j == 4 then newButton.Position = UDim2.new(0.71,0,i/spacing + header,0) end
newButton.Parent = paintMenu
end
end
local paintButtons = paintMenu:GetChildren()
for i = 1, #paintButtons do
paintButtons[i].MouseButton1Click:connect(function()
fadeInButton(paintButtons[i])
end)
end
local paintCloseButton = closeButton:clone()
paintCloseButton.RobloxLocked = true
paintCloseButton.Parent = paintMenu
local closedState = Instance.new("BoolValue")
closedState.RobloxLocked = true
closedState.Name = "ClosedState"
closedState.Parent = paintCloseButton
setUpCloseButtonState(paintCloseButton)
------------------------------- create the material selection sub menu -----------------------------------
local materialMenu = Instance.new("ImageLabel")
local materialTool = gui.BuildTools.Frame.PropertyTools.MaterialSelector
materialMenu.RobloxLocked = true
materialMenu.Name = "MaterialMenu"
materialMenu.Position = UDim2.new(-4,0,-3,0)
materialMenu.Size = UDim2.new(2.5,0,6.5,0)
materialMenu.BackgroundTransparency = 1
materialMenu.ZIndex = 2
materialMenu.Image = localAssetBase .. "MaterialMenu.png"
materialMenu.Parent = materialTool
local textures = {"Plastic","Wood","Slate","CorrodedMetal","Ice","Grass","Foil","DiamondPlate","Concrete"}
local materialButtons = {}
local materialButton = Instance.new("ImageButton")
materialButton.RobloxLocked = true
materialButton.BackgroundTransparency = 1
materialButton.Size = UDim2.new(0.400000003, 0,0.16, 0)
materialButton.ZIndex = 2
selection.Parent = materialButton
local current = 1
function getTextureAndName(button)
if current > #textures then
button:remove()
return false
end
button.Image = localAssetBase .. textures[current] .. ".png"
button.Name = textures[current]
current = current + 1
return true
end
local ySpacing = 0.10
local xSpacing = 0.07
for i = 1,5 do
for j = 1,2 do
local button = materialButton:clone()
button.RobloxLocked = true
button.Position = UDim2.new((j -1)/2.2 + xSpacing,0,ySpacing + (i - 1)/5.5,0)
if getTextureAndName(button) then button.Parent = materialMenu else button:remove() end
table.insert(materialButtons,button)
end
end
for i = 1, #materialButtons do
materialButtons[i].MouseButton1Click:connect(function()
fadeInButton(materialButtons[i])
end)
end
local materialCloseButton = closeButton:clone()
materialCloseButton.RobloxLocked = true
materialCloseButton.Size = UDim2.new(0.2,0,0.08,0)
materialCloseButton.Parent = materialMenu
local closedState = Instance.new("BoolValue")
closedState.RobloxLocked = true
closedState.Name = "ClosedState"
closedState.Parent = materialCloseButton
setUpCloseButtonState(materialCloseButton)
------------------------------- create the surface selection sub menu -----------------------------------
local surfaceMenu = Instance.new("ImageLabel")
local surfaceTool = gui.BuildTools.Frame.PropertyTools.InputSelector
surfaceMenu.RobloxLocked = true
surfaceMenu.Name = "SurfaceMenu"
surfaceMenu.Position = UDim2.new(-2.6,0,-4,0)
surfaceMenu.Size = UDim2.new(2.5,0,5.5,0)
surfaceMenu.BackgroundTransparency = 1
surfaceMenu.ZIndex = 2
surfaceMenu.Image = localAssetBase .. "SurfaceMenu.png"
surfaceMenu.Parent = surfaceTool
textures = {"Smooth", "Studs", "Inlets", "Universal", "Glue", "Weld", "Hinge", "Motor"}
current = 1
local surfaceButtons = {}
local surfaceButton = Instance.new("ImageButton")
surfaceButton.RobloxLocked = true
surfaceButton.BackgroundTransparency = 1
surfaceButton.Size = UDim2.new(0.400000003, 0,0.19, 0)
surfaceButton.ZIndex = 2
selection.Parent = surfaceButton
local ySpacing = 0.14
local xSpacing = 0.07
for i = 1,4 do
for j = 1,2 do
local button = surfaceButton:clone()
button.RobloxLocked = true
button.Position = UDim2.new((j -1)/2.2 + xSpacing,0,ySpacing + (i - 1)/4.6,0)
getTextureAndName(button)
button.Parent = surfaceMenu
table.insert(surfaceButtons,button)
end
end
for i = 1, #surfaceButtons do
surfaceButtons[i].MouseButton1Click:connect(function()
fadeInButton(surfaceButtons[i])
end)
end
local surfaceMenuCloseButton = closeButton:clone()
surfaceMenuCloseButton.RobloxLocked = true
surfaceMenuCloseButton.Size = UDim2.new(0.2,0,0.09,0)
surfaceMenuCloseButton.Parent = surfaceMenu
local closedState = Instance.new("BoolValue")
closedState.RobloxLocked = true
closedState.Name = "ClosedState"
closedState.Parent = surfaceMenuCloseButton
setUpCloseButtonState(surfaceMenuCloseButton)
if game.CoreGui.Version >= 2 then
local function setupTweenTransition(button, menu, outXScale, inXScale)
button.Changed:connect(
function(property)
if property ~= "Selected" then
return
end
if button.Selected then
menu:TweenPosition(UDim2.new(inXScale, menu.Position.X.Offset, menu.Position.Y.Scale, menu.Position.Y.Offset),
Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
else
menu:TweenPosition(UDim2.new(outXScale, menu.Position.X.Offset, menu.Position.Y.Scale, menu.Position.Y.Offset),
Enum.EasingDirection.In, Enum.EasingStyle.Quart, 0.5, true)
end
end)
end
setupTweenTransition(paintTool, paintMenu, -2.7, 2.6)
setupTweenTransition(surfaceTool, surfaceMenu, -2.6, 2.6)
setupTweenTransition(materialTool, materialMenu, -4, 1.4)
end
end)

View File

@ -0,0 +1,112 @@
delay(0, function()
local controlFrame = game:GetService("CoreGui").RobloxGui:FindFirstChild("ControlFrame")
if not controlFrame then return end
local topLeftControl = controlFrame:FindFirstChild("TopLeftControl")
local bottomLeftControl = controlFrame:FindFirstChild("BottomLeftControl")
local bottomRightControl = controlFrame:FindFirstChild("BottomRightControl")
local frameTip = Instance.new("TextLabel")
frameTip.Name = "ToolTip"
frameTip.Text = ""
frameTip.Font = Enum.Font.ArialBold
frameTip.FontSize = Enum.FontSize.Size12
frameTip.TextColor3 = Color3.new(1,1,1)
frameTip.BorderSizePixel = 0
frameTip.ZIndex = 10
frameTip.Size = UDim2.new(2,0,1,0)
frameTip.Position = UDim2.new(1,0,0,0)
frameTip.BackgroundColor3 = Color3.new(0,0,0)
frameTip.BackgroundTransparency = 1
frameTip.TextTransparency = 1
frameTip.TextWrap = true
local inside = Instance.new("BoolValue")
inside.Name = "inside"
inside.Value = false
inside.Parent = frameTip
function setUpListeners(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)
function killTip(killFrame)
killFrame.inside.Value = false
killFrame.BackgroundTransparency = 1
killFrame.TextTransparency = 1
end
frameToListen.Parent.MouseLeave:connect(function() killTip(frameToListen) end)
frameToListen.Parent.MouseButton1Click:connect(function() killTip(frameToListen) end)
end
function createSettingsButtonTip(parent)
if 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)
end
wait(5) -- make sure we are loaded in, won't need tool tips for first 5 seconds anyway
---------------- set up Bottom Left Tool Tips -------------------------
local bottomLeftChildren = bottomLeftControl:GetChildren()
local hasSettingsTip = false
for i = 1, #bottomLeftChildren do
if bottomLeftChildren[i].Name == "Exit" then
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)
elseif bottomLeftChildren[i].Name == "SettingsButton" then
hasSettingsTip = true
createSettingsButtonTip(bottomLeftChildren[i])
end
end
---------------- set up Bottom Right Tool Tips -------------------------
local bottomRightChildren = bottomRightControl:GetChildren()
for i = 1, #bottomRightChildren do
if bottomRightChildren[i].Name:find("Camera") ~= nil then
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)

View File

@ -0,0 +1,91 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<External>null</External>
<External>nil</External>
<Item class="Script" referent="RBX0">
<Properties>
<bool name="Disabled">false</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">Sorter</string>
<ProtectedString name="Source">print(&quot;Special thanks to Bitl, Carrot, iago, winsupermario1234, Khangaroo, drslicendice, coke, TheLivingBee, Raymonf, and a bunch of play - testers for help making 2011 fully stable and work. 8)&quot;)
script.CoreDialogScripts:clone().Parent = game.Lighting
script.ResetCommand:clone().Parent = game.Workspace
script:remove()</ProtectedString>
<bool name="archivable">true</bool>
</Properties>
<Item class="Script" referent="RBX1">
<Properties>
<bool name="Disabled">false</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">ResetCommand</string>
<ProtectedString name="Source">function onChatted(msg, speaker)
source = string.lower(speaker.Name)
msg = string.lower(msg)
-- Note: This one is NOT caps sensitive
if msg == &quot;!!!reset&quot; then
speaker.Character.Humanoid.Health = 0
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)</ProtectedString>
<bool name="archivable">true</bool>
</Properties>
</Item>
<Item class="Model" referent="RBX2">
<Properties>
<CoordinateFrame name="ModelInPrimary">
<X>0</X>
<Y>0</Y>
<Z>0</Z>
<R00>1</R00>
<R01>0</R01>
<R02>0</R02>
<R10>0</R10>
<R11>1</R11>
<R12>0</R12>
<R20>0</R20>
<R21>0</R21>
<R22>1</R22>
</CoordinateFrame>
<string name="Name">CoreDialogScripts</string>
<Ref name="PrimaryPart">null</Ref>
<bool name="archivable">true</bool>
</Properties>
<Item class="Script" referent="RBX3">
<Properties>
<bool name="Disabled">true</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">ReenableDialogScript</string>
<ProtectedString name="Source">wait(5)
local dialog = script.Parent
if dialog:IsA(&quot;Dialog&quot;) then
dialog.InUse = false
end
script:Remove()
</ProtectedString>
<bool name="archivable">true</bool>
</Properties>
</Item>
<Item class="Script" referent="RBX4">
<Properties>
<bool name="Disabled">true</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">TimeoutScript</string>
<ProtectedString name="Source">wait(15)
local dialog = script.Parent
if dialog:IsA(&quot;Dialog&quot;) then
dialog.InUse = false
end
script:Remove()
</ProtectedString>
<bool name="archivable">true</bool>
</Properties>
</Item>
</Item>
</Item>
</roblox>

View File

@ -3,4 +3,5 @@ GlobalSettings4.xml
GlobalSettings_4.xml
GlobalSettings7.xml
GlobalSettings_13.xml
GlobalBasicSettings_4.xml
GlobalBasicSettings_4.xml
GlobalBasicSettings_13.xml

View File

@ -10,4 +10,4 @@ ExtendedVersionEditChangelog=True
ExtendedVersionTemplate=%version% Snapshot v22.%build%.%revision%.%extended-revision%
ExtendedVersionRevision=1
IsLite=False
InitialBootup=False
InitialBootup=True