Hey guys. im learning how to become an advanced scripter. would anyone mind helping me out?
So… im working on making new things and trying things out. but, i have ran into a problem. i have no idea how to make this click detector give my currency"Candy" whenever the door is clicked. and also show my popup gui. plus, id like it to be a random amount of robux. here of some screen shots of my progress!
well, you don’t need to put function into while loops.(this is updated door script)
script.Parent.ClickDetector.MouseClick:Connect(function(player) --function will run whenever player clicks the door, and it even detects which player clicked it
local gui = player:WaitForChild("PlayerGui") -- variables will make script shorter
local popupGui = gui:WaitForChild("PopUpGui")
popupGui.PopUpText.CandyCorn.Value = popupGui.PopUpText.CandyCorn.Value + 3 -- every click will add some candy corns
end)
if you want to make it show how much candy you have on gui, you can try this
--put this in PopUpText
while wait(0.1) do
script.Parent.Text = script.Parent.CandyCorn.Value
end