Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why do my tools stop working if I clone them into the backpack from replicatedstorage?

If I were to put them into the StarterPack, they all work perfectly. Also note this game is in FE.

EDIT: I found out that the LocalScript in the tool runs, while the ServerScript in the tool doesn't!

Server Script:

print("hi") --                <-- THIS DOES NOT PRINT
Tool = script.Parent
CB = script.Parent.CreateBrick

CB.OnServerEvent:connect(function(plr,cb,offset,target,mode,block,ts)
	print("hello world".. ts)
end)

EDIT #2: The ServerScript works perfectly. There are no errors. The only problem is that it just isn't running! Disabled is false. I checked.

5 comments

0

What's wrong with the script, are there any errors?

0

You aren't giving us much to work with. Check if it's disabled. If not, we need a lot more info.

0

I was requested to give the ServerScript. Here it is. The only problem is that it doesn't run at all. The LocalScript fires the remoteevent in the tool.

0

Does the tool parts fall off the map when you clone it from ReplicatedStorage to backpack?

0

Are you cloning the tool using a localscript or a server script?

1 answer


First make an script and put in ServerScriptService, you can name it whatever you want put the Tool in ServerStorage then try this:

serverStorage = game:GetService("ServerStorage")-- Gets ServerStorage

while true do
		wait(5)
		Gamers = {}-- name of players(This is a table)
		for _, player in pairs(game.Players:GetPlayers()) do --get the players and makes sure they are alive
			if player and player.Character then
				local humanoid = player.Character:WaitForChild("Humanoid")--looks for humanoid
				if humanoid and humanoid.Health > 0 then -- checks that the health is over 0
					table.insert(Gamers, player)-- inserts players into the table gamers
				end
			end
		end
	end

backpack = game.Workspace.Players:FindFirstChild("Backpack")-- looks for backpack
if backpack and Gamers then --if the player has a backpack and is a player then the tool will get clone into the backpack
local tool = serverStorage:WaitForChild("Tool"):clone()--clones the tool so that we can always have it for a future use
tool.Parent = backpack -- sets the tool parent to the backpack

I not sure if this works, maybe I just wasted my time writting this code. Just Started learning and im trying to help. Cheers!

This discussion is preserved as it was. New answers, comments, and votes are closed.