players roll on a ball to get around the map, and they are able to get off of the ball and collect the coins, but i'd like to make it so they can just roll over the coin and collect it as well
the ball the players spawn on is in serverstorage so i dont really know how to reference it like that since im newer to scripting
this is my code right now that only lets humanoids collect coins:
local db = true
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if db == true then
db = false
script.Parent.Transparency = 1
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.leaderstats.Orbs.Value = player.leaderstats.Orbs.Value + 1
script.Parent.Transparency = 1
wait(5)
db = true
script.Parent.Transparency = 0
end
end
end)
