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

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

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

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

1 answer

Instead, try this:

local part = workspace.Part
part.Touched:Connect(function()
game.ServerStorage.IntValue.Value = 1
game.ServerStorage.IntValue.Changed:Connect(function()
if game.ServerStorage.IntValue.Value==1 then
part.Color = BrickColor.new("Really red")
end
end
end)

1 comment

1

Thanks!

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