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

Help with this IntValue script?

game.Players.PlayerAdded:connect(function(player)
	    player.CharacterAdded:wait() --Waits until the CharacterAdded event has fired.
	    wait(1)
	    local Quest=Instance.new("IntValue") -- New IntValue
	    Quest.Parent = player
	    Quest.Name = "Quest" --Give a name to the IntValue, so you can easily identify it in other scrip
		Quest.Value=1
	end)

This works and puts a IntValue in the player, but how would I change that IntValue? I'm stuck on the parenting of Quest, bearing in mind it will be Unique for each player. I know I can do this:

Quest.Value=Quest.Value+.1

2 comments

0

What do you mean by "change"?

0

Increase/Decrease it. I'll add to the script.

2 answers

✓ Accepted answer

I'm not quite sure if this is what you mean, but if you would access it from another script, this would be it:

game.Players.PLAYERNAME:WaitForChild("Quests") --This is accessing "Quests".

1 comment

0

How would I get the local PLAYERNAME?

This is fairly simple.

Quest.Value = Quest.Value + 1 --Add

Quest.Value = Quest.Value - 1 --Subtract

Quest.Value = Quest.Value * 1 --Multiply

Quest.Value = Quest.Value 1/1 --Divide

1 comment

0

Afraid not. As stated above it is the parenting I am stuck on not the changing of the value.

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