my script doesn't work in game and there was no errors in the output and developer console. when I changed it to a local script it caused an error in game in developer console what should I do to fix this here's the script
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
debounce = false
tool.Equipped:connect(function(mouse)
print("Tool equipped!")
mouse.Button1Down:connect(function()
if debounce == true then return end
debounce = true
local original = game.ServerStorage.objects.explosion -- normal explosions don't work in my
-- Game because of my starter character so I have to make my own
local copy = original:Clone() copy.Parent = game.Workspace.objects copy.Position = mouse.Hit.p wait(2) debounce = false end) end)
local tool = script.Parent local player = game:GetService("Players").LocalPlayer debounce = false tool.Equipped:connect(function(mouse) print("Tool equipped!") mouse.Button1Down:connect(function() if debounce == true then return end debounce = true local original = game.ServerStorage.objects.explosion local copy = original:Clone() copy.Parent = game.Workspace.objects copy.Position = mouse.Hit.p wait(2) debounce = false end) end)
You're using a local script to handle something that should be serversided, check out Remote Events and Functions on the wiki, it should tell you all about them.