Script Breaks When the Parent's Parent Parent Changed

I have a dialoug script that I made which works perfectly fine, Its all good, But when the script parent parent is changed the script just doesnt work, and idk why because the script has nothing to do with the workspace or where it is at the moment
image

the variables in the script dont have anything releating to the workspace(where the npc at in picture)

when I change the npc parent to a folder in the player and back to the workspace the script no longer works
warning video might be loud

1 Like

May I see the script please? There might be something your missing.

Sure but Its long, also the other half is the same so here is the first half

local Proximity = script.Parent
local CrewMemeber = Proximity.Parent
local Persenality = "Friendly"

local PlayerResponses1 = {"want to join my team?", "$500"}
local FriendlyMessages = {"Hello", "You want me on your Team? Sure ill join!"}

local PlayerResponses2 = {"Want to join my team?", "$500"}
local RudeMessages = {"Get away, What you want..", "me? Join your team, Not happening unless you pay me" }


Proximity.Triggered:Connect(function(plr)
	if Persenality == "Friendly" then
		plr.PlayerGui.TeamUp.TextLabel.Text = FriendlyMessages[1]
		plr.PlayerGui.TeamUp.Enabled = true
			
		plr.PlayerGui.TeamUp.Choice1.Visible = true
		plr.PlayerGui.TeamUp.Choice2.Visible = true
		
		plr.PlayerGui.TeamUp.Choice1.Text = PlayerResponses1[1]
		plr.PlayerGui.TeamUp.Choice2.Text = "Have a good day"
			
		plr.PlayerGui.TeamUp.Choice1.MouseButton1Click:Connect(function()
			plr.PlayerGui.TeamUp.Choice1.Visible = false
			plr.PlayerGui.TeamUp.Choice2.Visible = false
			
			plr.PlayerGui.TeamUp.TextLabel.Text = FriendlyMessages[2]
			task.wait(1)
			plr.PlayerGui.TeamUp.Choice1.Visible = true
			plr.PlayerGui.TeamUp.Choice2.Visible = true
			plr.PlayerGui.TeamUp.Choice1.Text = PlayerResponses1[2]
			plr.PlayerGui.TeamUp.Choice2.Text = "Nvm"
			
			plr.PlayerGui.TeamUp.Choice1.MouseButton1Click:Connect(function()
				CrewMemeber.Parent = plr.Team_Members
				plr.PlayerGui.TeamUp.Enabled = false
				plr.PlayerGui.TeamUp.Choice1.Visible = false
				plr.PlayerGui.TeamUp.Choice2.Visible = false
			end)
			-------
			plr.PlayerGui.TeamUp.Choice2.MouseButton1Click:Connect(function()
				plr.PlayerGui.TeamUp.Enabled = false
				plr.PlayerGui.TeamUp.Choice1.Visible = false
				plr.PlayerGui.TeamUp.Choice2.Visible = false
			end)
		end)
		----------
		plr.PlayerGui.TeamUp.Choice2.MouseButton1Click:Connect(function()
			plr.PlayerGui.TeamUp.Enabled = false
			plr.PlayerGui.TeamUp.Choice1.Visible = false
			plr.PlayerGui.TeamUp.Choice2.Visible = false
		end)

I did some testing, and I found that - although I don’t think it should matter - the game makes the script repeat when you put it in the player(probably because it stops working in the player). Maybe try and put the script in something outside the player like the replicated storage so that it doesn’t repeat. Again, probably won’t work but it might be worth a shot.

1 Like

it didnt, i put the npc in a folder in the replicated storage but still roblox just dumb sometimes

I’ve been running into a similar problem though I’m not really sure if it’s exactly the same with a script in a “Persistent” model under workspace. I thought that maybe it was just due to it being under workspace but the same behavior applies if I put the model under ServerScriptService and then parent it elsewhere.

I’ve found that the script still “runs” properly (verified through print statements) but it doesn’t really make any of the changes it should.

If this is the same case for you then it might warrant a bug report instead x.x

1 Like