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

brick properties wont change after stringvalue changed?

I have a door type wall set to detect if an npc is in the current location, when the server first starts the door is open, but when I change the value to something else through console the door wont close. How do I fix this?

my code:

if game.Workspace.NPCs.Collector.CurrentWell.Value == "Beach" then
	wait(20)
	script.Parent.Transparency = 1
	script.Parent.CanCollide = false
else
	script.Parent.Transparency = 0
	script.Parent.CanCollide = true
end

1 answer

The solution is the changed function.

well = game.Workspace.NPCs.Collector.CurrentWell
well.Changed:Connect(function()
if well.Value == "Beach" then
		script.Parent.Transparency = 1
	script.Parent.CanCollide = false
else
	script.Parent.Transparency = 0
	script.Parent.CanCollide = true
	end
	end)

1 comment

0

do you still need help or did you solve it yourself?

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