Hi,
I apologize if this question breaks the rules, tell me if it does. So, I wrote this script, but when I click on the part, nothing happens and no errors show up. What is wrong?
EDIT: when the player clicks, the leaderstat "Value" is supposed to increase.
teapot=script.Parent function onClicked() teapot.Transparency=1 teapot.CanCollide=false onClicked.leaderstats["Value"].Value = onClicked.leaderstats["Value"].Value + 125 end
Thank you!
I don't want to wait for you to paste your entire script, so I'll just give you a working one.
Note: Script must be a normal script inside a ClickDetector inside the part
local teapot = script.Parent.Parent script.Parent.MouseClick:connect(function(playerWhoClicked) teapot.Transprency = 1 teapot.CanCollide = false playerWhoClicked:FindFirstChild("leaderstats").Value = playerWhoClicked:FindFirstChild("leaderstats").Value + 125 end)