Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How come this isnt finding the player?

It says InLobby doesnt exist in player.

local deb = false
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function(click)
	if deb == false then deb = true
		if player.InLobby == true then
			player.InLobby = false
			player.Character.Torso.CFrame = game.Workspace.stp.CFrame + Vector3.new(0,3,0)
			player.PlayerGui.tpShop.Tp.Text = "Teleport to Lobby"
		else
			player.Character.Torso.CFrame = game.Workspace.ltp.CFrame + Vector3.new(0,3,0)
			player.InLobby = true
		end
		wait(2)
		deb = false
	end
end)

2 answers

I also did this in another script.

`~~~~~~~~~~~~~~~~~ game.Players.PlayerAdded:connect(function(plr) local il = Instance.new("BoolValue", plr) il.Name = "InLobby" il.Value = true end)

`

use FindFirstChild for this line

if deb == false then deb = true
	        if player.InLobby == true then

This discussion is preserved as it was. New answers, comments, and votes are closed.