local pl = script.Parent.Parent.TextBox.Text local topkek = script.Parent.Text script.Parent.MouseButton1Down:connect(function() game:GetService('TeleportService'):Teleport(471383497, game.Players.pl) end)
I'm not sure as to why an error is occuring.
*13:01:22.378 - pl is not a valid member of Players 13:01:22.379 - Stack Begin 13:01:22.380 - Script 'Players.derfvb123.PlayerGui.ScreenGui.lel.LocalScript', Line 10 13:01:22.381 - Stack End *
The problem is that you are trying to find a member of players called pl
. You need to find the player whose name is equal to the value of pl
, using the index operator:
local pl = script.Parent.Parent.TextBox.Text local topkek = script.Parent.Text script.Parent.MouseButton1Down:connect(function() game:GetService('TeleportService'):Teleport(471383497, game.Players[pl]) end)