Hello! I made a cash system once you touch it, you teleport to the spawnpoint however, it doesn’t teleport you, it just grants you cash.
local folder = script.Parent:GetChildren()
local SpawnFolder = workspace.MainSpawns:GetChildren()
local GetMoney = false
for i, Money in pairs(folder) do
if Money:IsA("Part") then
Money.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if GetMoney == false then
GetMoney = true
plr.leaderstats:WaitForChild("💰 Money").Value += Money.Money.Value
hit.Parent:WaitForChild("HumanoidRootPart").CFrame = SpawnFolder[math.random(#SpawnFolder)].CFrame
wait(1.3)
GetMoney = false
end
end
end)
end
end
It’s not that. I have the exact same teleporter and that works fine, it’s just this one that doesn’t work. What if I teleport another body part? What body part should I teleport?