Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't my IntValue change and affect the part? [Answered]

Asked by 5 years ago
Edited by Ziffixture 5 years ago

You see, I have added an IntValue in ServerStorage, and used this script in a Part in workspace:

1local part = workspace.Part
2part.Touched:Connect(function()
3game.ServerStorage.IntValue.Value = 1
4if game.ServerStorage.IntValue.Value==1 then
5part.Color = BrickColor.new("Really red")
6end
7end)

1 answer

Log in to vote
3
Answered by
Slatryte 104
5 years ago

Instead, try this:

1local part = workspace.Part
2part.Touched:Connect(function()
3game.ServerStorage.IntValue.Value = 1
4game.ServerStorage.IntValue.Changed:Connect(function()
5if game.ServerStorage.IntValue.Value==1 then
6part.Color = BrickColor.new("Really red")
7end
8end
9end)
1
Thanks! RealLionie -73 — 5y
Ad

Answer this question