Why wont this script work?

credit to HeyWhatsHisFace

local DialogLocation = script.Parent.Parent.Parent.Parent --Define Dialog Location here
local UnveilingDialogOption = script.Parent --Define the Location of the DialogChoice that would open a wall or whatever you want it to do.
DialogLocation.DialogChoiceSelected:connect(function(Plr, DialogOption)
	if DialogLocation == UnveilingDialogOption then
		game.Workspace.WallTransparent.CanCollide = false--Do stuff here, such as remove the wall or whatever you want it to do. 
		--You can also make it do certain things specifically for the player by utilizing the Plr variable.
		--If you want the wall to be removed/whatever other changes to effect that player ONLY, put this in a LocalScript.
	end
end)

im trying to make it when a player answers yes to a npc a invisible walls CanCollide is set to false.
this is a localscript inside of the dialogchoice.

LocalScripts don’t run inside of Workspace except when they are in a player’s character. You will need to move it to StarterPlayerSctipts and change thescript.Parent bit, or make it a Script.

1 Like