Why my cloned tool scripts doesnt work?


You can see the tool that is cloned by the button, scripts doesnt work, but if i pick up a tool that is an original tool scripts are working-
Thats the script i used.

local tool = game.Workspace.Tools["X-26 1"]
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	local clone = tool:Clone()
	local backpack = player.Backpack
	clone.Parent = backpack
end)

Can you show the Output panel?


I think the error is coming from the tool script, not this script:

Maybe it caused by the duplicated tools cuz idkk… I used this model in the game Tazer - Roblox

No idea. Sometimes when you start the game, the variables are defined without waiting for the game to load, so it would give an error if it did not load correctly. However, by inserting another new tool, it can be used well because things will already be loaded.

i will check the model:

1 Like

If it’s not too much trouble, can you send your roblox map? It’s to check some things

Looks like I got it fixed, the scripts run. However, I think the tazer model is only for R6 characters

1 Like

can you please send the fixed model link?

Yes,
e.rbxl (84.2 KB)

1 Like

Now the scripts are executed, but that does not mean that the tazer only works with the r15 characters.

Basically what you were doing was cloning the tool locally, so it only exists for whoever pressed the button, so I had better clone it from the server

2 Likes

Thank you so much, it works now!!

1 Like