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

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

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

2 comments

0

Change game.Players.LocalPlayer with game.Players.PlayerName

0

That doesnt work

1 answer

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 ^

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