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

Is there anyway to load the value in a script?

so i get this blue line under "Units" so i wounder how do i load the Units value cus it only exist in the player when that player is playing. But if i do "Units = game.Players.LocalPlayer" then i get and i dont know heres the script.

14:23:07.646 - Value is not a valid member of Player
Units = game.Players.LocalPlayer
Button = script.Parent.TextButton
Player = game.Players.LocalPlayer
Button.MouseButton1Down:connect(function()
	Player.leaderstats.Units.Value = Player.leaderstats.Units.Value + 1
	if Units.Value == 50 then
		script.Parent.Script.Disabled = true
	end
end)

1 answer

✓ Accepted answer

Do

Local Units = game.Players.LocalPlayer

2 comments

0

it still gives me this error "14:29:32.896 - Value is not a valid member of Player"

0

got it working

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