Value doesn't change with place teleporting?
Asked by
5 years ago Edited 5 years ago
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
01 | local button = script.Parent |
02 | button.MouseButton 1 Click:connect( function () |
03 | if game.Players.LocalPlayer.leaderstats.Coins.Value > = 5 then |
04 | game.Workspace.Tp 1. tppart.Value.Value = game.Players.LocalPlayer.leaderstats.Coins.Value - 5 |
06 | script.Parent.Parent.Visible = false |
08 | script.Parent.Parent.TextBox.Text = ( "You don't have enough coins!" ) |
btw this is the other script:
NORMAL SCRIPT
4 | game:GetService( "TeleportService" ):Teleport(script.Parent.Value.Value, character) |
8 | 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.