Hi - seeing as my previous post about this problem remains unanswered (see htts://scriptinghelpers.org/questions/9281/why-is-the-tool-not-being-distributed - I felt it would be necessary to pick out the problematic area, or where I believe the problem is originated.
Perhaps I should explain in more detail what the problem is - The GameTool (Hopperbin) is inside of a script that distributes most of the scripts information - and the maps. This script works by copying the GameTool from the Workspace (Workspace.Distribution, more accurately), and putting it into the backpack of the player. The script inside of the Hopperbin then loads the rest of the game, including it's GUI(s), and such.
The first player to connect is getting the tool, while all other players after him/her are not.
I believe the problem is originating from -
game.Players.PlayerAdded:connect(function(player) consoleMessage(player.Name.." has connected.","Toothpaste") player.CharacterAdded:connect(function() gtool:clone().Parent = player.Backpack player.Backpack["GameTool"].Archivable = false player.Backpack["GameTool"]["woop"].Archivable = false end)
A note to administrators: If you plan on deleting this post, please delete the older one and leave the more explained one here.
Thanks in advance, -Dragon
'gtool' is specified here -
gtool = script.GameTool:clone() script:remove()
in the same script.
EDIT: For Dominic and dueling
remove() is not present in the script, as the script (from the point above) continues to do
local warning = game.Lighting.Resources.GUI.Warning:clone() Spawn(function() repeat wait(0) until player:findFirstChild("PlayerGui") and player.PlayerGui:findFirstChild("Menu") warning.Parent = player.PlayerGui local leedstat = Instance.new("BoolValue",player) leedstat.Name = "leaderstats" Instance.new("StringValue",leedstat).Name = "Users" wait(4) warning.Agree:TweenPosition(UDim2.new(0.35,0,.7,0),"Out","Quad",1,true) warning.Agree.MouseButton1Click:connect(function() warning.Agree:TweenPosition(UDim2.new(0.5,-100,2,0),"Out","Quad",1,true) warning.Frame:TweenPosition(UDim2.new(0,0,2,0),"Out","Quad",0.7,true) game.Debris:AddItem(warning,2) player.PlayerGui.Menu.Frame.Active = true end) end) end)
which is unrelated (I think) to the problem I am having.
You are going to have to remove line two, as line two is removing the script and stopping the code.
replace line 1 and two with:
gtool = script:FindFirstChild("GameTool") gtoolC = gtool:clone()
gtool:clone().Parent = player.Backpack
gtool = script.GameTool:clone()
Remove the :clone() from the gtool variable.
EDIT:
game.Players.PlayerAdded:connect(function(player) consoleMessage(player.Name.." has connected.","Toothpaste") player.CharacterAdded:connect(function() local tool = gtool:clone() tool.Parent = player.Backpack tool.Archivable = false end) end)
I will refer to my own knowledge on this one.
This is how I see your script now:
gtool = script.GameTool:clone() game.Players.PlayerAdded:connect(function(player) consoleMessage(player.Name.." has connected.","Toothpaste") player.CharacterAdded:connect(function() gtool:clone().Parent = player.Backpack player.Backpack["GameTool"].Archivable = false player.Backpack["GameTool"]["woop"].Archivable = false end) script:remove()
There are a couple things I noticed right off the bat:
You stated gtool as: gtool = script.GameTool:clone()
and then later on in the code, you stated to gtool:clone()
. Basically this is what the code reads: script.GameTool:clone():clone().Parent = player.Backpack
and messes up at :clone():clone()
.
I suggest you define "gtool" as an object, instead of a clone. Then clone it under the actual function.
You also should have a second end)
due to the fact you have two functions.
another thing is remove()
has been deprecated. This means it no longer works. What you should use instead is :Destroy()
. If you destroy the script, it will not run again.
I hope this helped. I will be glad to assist you if you have any further questions on this topic.