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

How would I get an IntValue inside a player and check if the player has a certain value ?

Asked by 6 years ago

I tried using this script but I know that it wont work in game. I basically need to know how I would access this IntValue from a normal script.

if game.Players.LocalPlayer.AFK.Value == 1 then
    local torso = game.Players.LocalPlayer.Character:WaitForChild('HumanoidRootPart')
    torso.Parent = game.Lighting
    wait(1)
end

0
Change game.Players.LocalPlayer with game.Players.PlayerName lukeb50 631 — 6y
0
That doesnt work 1Messi3903 -5 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

bruh... The player won't load

game.Players.PlayerAdded:connect(function(player)
    local AfkVal = player:WaitForChild("AFK") 
    while wait() do
        if AfkVal.Value == 1 then
        local t = player.CharacterAdded:wait()
        t.Parent = game.Lighting

        end
    end)
end)

Which is why you do that ^

Ad

Answer this question