So i made a easter egg but if you found it i wanted to give the player coins. But I can't figure out how to do it. so I experimented a little bit but it dosen't seem to work :(
local player leaderstats.Coins.Value = Coins.Value + 10
btw i have a clickdetector before so i don't really need to specify which player clicked it.
edit whole cript
local debounce = false
script.Parent.ClickDetector.MouseClick:Connect(function()
if debounce == false then debounce = true
script.Parent.Size = Vector3.new(3,3,3) else
debounce = false
script.Parent.Size = Vector3.new(4,4,4) debounce = true
if debounce == true then debounce = false
script.Parent.Sound:Play()
game.StarterGui.EasterEgg1.EasterEggText.Visible = true
wait(3)
game.StarterGui.EasterEgg1.EasterEggText.Visible = false
game.Workspace.Wut:Destroy()
end
end
end)
and yes i'm bad at scripting xd

3 comments
okay I'm unsure what this script is that you just posted?? "player" isn't localized in one area you put leaderstats.coins.value then in another you put coins.value i am very confused
Make sure this is in a server script because of filtering enabled, and also, I noticed something weird, as DesiredRep said, for the first one, you specified that "Coins" was a child of "leaderstats", but the second time, you didn't.
So try, "local player leaderstats.Coins.Value = leaderstats.Coins.Value + 10" instead.