I'm trying to make a part with a clickdetector on it that sells a Katana for 7 KOs at my game. This isn't working and I'm not receiving an error. Any ideas on how to fix this?
local player = game.Players.LocalPlayer local clickdetector = script.Parent:WaitForChild("ClickDetector") local sword = game.ServerStorage:WaitForChild("Katana") clickdetector.MouseClick:connect(function() if player.leaderstats.KOs.Value >= 7 then player.leaderstats.KOs.Value = player.leaderstats.KOs.Value - 7 local sword1 = sword:Clone() sword1.Parent = player.Backpack local sword2 = sword:Clone() sword2.Parent = player.StarterGear end end)
Local scripts can't access server storage, make it a normal script. Please accept my answer, if i am right.