My script in a part isnt working, there isnt any errors in the output but nothing is happening! Thanks
local cooldown = false
script.Parent.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
if not cooldown then
cooldown = true
local rnad = math.random(1000,100000)
player.leaderstats.Candy.Value += rnad
task.wait(20)
cooldown = false
end
end
end)
player.leaderstats.Candy.Value += rnad is the problem in your script, this should fix it: player.leaderstats.Candy.Value = player.leaderstats.Candy.Value + rnad.
Always do Value = Value + what you want to add or subtract.
Excuse me sir. I apologize if you think that I’m unsuccessful. But I was replying for 15-20 minutes if you noticed. I created only 2 posts about scripting support. Please be kind while replying a member of this forum. People have to create formal posts, it is normal that you thought I’m a GPT-3 built AI.
We’ll receive an off-topic feedback if we keep talking about other topics.