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

Why isn't :GetPlayerFromCharacter() working?

This is my leaderboard script:

function playerJoined(player)
	local inGame = Instance.new('BoolValue')
	inGame.Name = 'isPlayerIngame'
	inGame.Parent = player
	inGame.Value = false
end
game.Players.PlayerAdded:connect(playerJoined)

This is another script that keeps breaking:

function onTouch(hit)
	local hum = hit.Parent
	if hit ~= nil then
		if hum ~= nil then
			local plr = game.Players:GetPlayerFromCharacter(hum)
			plr.leaderstats.isPlayerIngame.Value = true
		end
	end
end
script.Parent.Touched:connect(onTouch)

Error: 11:48:04.886 - isPlayerIngame is not a valid member of IntValue 11:48:04.888 - Script 'Workspace.valuegiver.Script', Line 6 11:48:04.889 - Stack End

1 answer

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