Tool not loading scripts

  1. What do you want to achieve? Whenever I get the tool I want it so it loads the scripts

  2. What is the issue? whenever I click with the tool it doesn’t shoot the gun for some reason (and I suspect it’s because it’s not loading the scripts?)

  3. What solutions have you tried so far? I tried a lot of stuff but it didnt work

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function(click)
	if player.leaderstats.Rings.Value >= 50 then
		player.leaderstats.Rings.Value = player.leaderstats.Rings.Value - 50
		
		game.ReplicatedStorage.Tools.ToyGun:Clone().Parent = player:WaitForChild("Backpack")
	end
end)

First of all, use print statements to find which line stops executing. Two, you are doing this in a local script. You should do the money changing and cloning things in server side.

1 Like

This is because localplayer are used in localscripts, not a script. I sure that it wont work! because to make a gun you need a local scripts and a script. If you trying to do this, the result will be:
USING SERVERSCRIPTS:
-it will not given because a localplayer is in client

USING LOCALSCRIPTS
-it will give but it gives in a client only so it wont work!

Try finding a player instance in other way! (or just use a click then fire from client to server!)