Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How come this isnt finding the player?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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) ~~~~~~~~~~~~~~~~~

Ad
Log in to vote
0
Answered by 9 years ago

use FindFirstChild for this line

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

Answer this question