Basically, a door that you need money to use, and it teleports you if you have enough money
local limit = 1000
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.leaderstats.Coins.Value >= limit then
hit.Parent.Head.CFrame = CFrame.new(workspace.TeleportPart.Position + Vector3.new(0,3,0))
end
end
end
end)
local limit = 1000
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.leaderstats.Coins.Value >= limit then
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace.TeleportPart.Position + Vector3.new(0,3,0))
end
end
end)
Something you should always try when your script doesn’t work is to put a lot of: print("…") at pretty much every lines, that way, you can see if you’re script doesn’t work/what’s happening. For example, if now you put tons of print("…") and they’re all showing up, it would means that your script is working, but you’re just setting something the wrong way, for example, not getting the good part of the player to teleport.