So im making a Racing game for my Friend (XPrenupX on twitch) and i want to make a end goal that depending on if your 1st or 3rd you get different amounts of cash
this is what i got am im not sure what to do next?
local cashprize = 1000 local player = game.Players.LocalPlayer local recent = 0 -- what ever place is next (1st,2nd,3rd,etc.) script.Parent.Touched:connect(function(hit) local b = hit.Parent:FindFirstChild("Humanoid") if b ~= nil then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + cashprize --for 1st place end end)
i'm thinking of adding a if statement like this but i've done this already and i didnt give me the cash.
if recent == 0 then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + cashprize --for 1st place end if recent == 1 then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + cashprize/2 --for 2nd place end if recent == 2 then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + cashprize/2/2 --for 3rd place end
im not sure what im doing wrong here...