Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Coin is not working?

Asked by 7 years ago
Edited by Pyrondon 7 years ago

I need help (obviously). I made a coin that is spinning (in a serperate script) that is suppose to get touched by a player give the player that touched it +1 in the leaderstat called "Money". I cannot find why it is not working. I check spelling and made sure everything was in the correct order but it is still not working help

coin = script.Parent
player = game.Players.LocalPlayer
hum = player.Character.Humanoid
function money(part)
    local parent = part.Parent
    local human = game.Players:GetPlayerFromCharacter(parent)
    local player = game.Players.LocalPlayer
local debounce = true
    if debounce == true and human and parent.Humanoid.Health > 0 then
        debounce = false
        player.leaderstats.Money.Value = player.leaderstats.Money.Value + 1
        coin.Transperancy = 1
        wait(5)
        coin.Transperancy = 0
        debounce = true
    end
end
coin.Touched:connect(money)
--// In the future, please put your code within a code block. You can do this by pressing the blue button in the editor, and placing your code between the tildes (~).
1
"coin.Transperancy = 1", "coin.Transperancy = 0" Link150 1355 — 7y
1
Also, please use code blocks next time when posting a question. You can insert a code block by clicking the small Lua logo button. Link150 1355 — 7y

Answer this question