I am trying to use the value to teleport to a place. For some reason this script does not work!
Here is my script (its in a button of a gui) LOCAL SCRIPT
local button = script.Parent button.MouseButton1Click:connect(function() if game.Players.LocalPlayer.leaderstats.Coins.Value >= 5 then game.Workspace.Tp1.tppart.Value.Value = game.Players.LocalPlayer.leaderstats.Coins.Value -5 print("Success") script.Parent.Parent.Visible = false else script.Parent.Parent.TextBox.Text = ("You don't have enough coins!") end end)
btw this is the other script: NORMAL SCRIPT
function onTouched(hit) character = hit.Parent if character then game:GetService("TeleportService"):Teleport(script.Parent.Value.Value, character) end end script.Parent.Touched:connect(onTouched)
End when the value does work then it gives a warning: Cannot teleport to invalid place id 0. Aborting teleport.