so i am making a new game again and i have gems as a currency but the map is very big so i want some gems to give players speed instead but i don't know how, so here is my regular gem script, how do i change it to be what i want?
currency = "Gems"
amnt = 60
debounce = false
function onTouch(hit)
if hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == false then
if game.Players:findFirstChild(hit.Parent.Name) ~= nil then
ThisPlayer = game.Players:findFirstChild(hit.Parent.Name)
ThisPlayer.leaderstats:findFirstChild(currency).Value = ThisPlayer.leaderstats:findFirstChild(currency).Value + amnt
script.Parent.Transparency = 1
script.Parent.CanCollide = false
debounce = true
wait(21) --NOTE Respawn time
script.Parent.Transparency = 0
script.Parent.CanCollide = true
debounce = false
end
end
end
script.Parent.Touched:connect(onTouch)

4 comments
you probably will need to make another script that checks if, and how many gems of different types a players has.Otherwise you could have a player variable that your add to when a speed gem is picked up.
???
Just make it whenever you touch a gem the walkspeed of the player gets larger. Not that hard
i tried that idiot!why do you think im here!