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

I cant possible know why this is happening?

So ya im making a value script and i dont really know why it wont work to make a new value into the player

game.Players.PlayerAdded:connect(function(p)
	Instance.new("IntValue")
end)

2 answers

✓ Accepted answer

Easy, you are not setting the parent of the IntValue that you have just made. Try this:

game.Players.PlayerAdded:connect(function(p)
local lvl = Instance.new("IntValue") -- Creates the IntValue.
lvl.Name = "level4" -- Sets the name of the IntValue.
lvl.Value = 0 -- Sets the value of the IntValue to 0.
lvl.Parent = p -- Sets the newly created IntValue's parent to the player.
end)

Hoped this helped.

3 comments

0

yup, thanks but i need to name it to like level4

0

Edited

0

Thanks

Based off of what UltChowsk gave you can re-name the value quite easily. Your best bet would make the whole thing a variable and change it that way.

game.Players.PlayerAdded:connect(function(p) --Create the function
	local val = Instance.new("IntValue",p) --Add IntValue to the player
	val.Name = "Level4" -- Rename it to Level4
end)

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