I created a script that is supposed to do if you activate a Proximityprompt that it will move the model called "Lasers" in Workspace to Lighting if you are on the team called "Prisoners". The color of the team is "deep orange"

Ive tried using a Remotevent to trigger it in Replicated storage,events. The Script doesnt give any error in the output but when I try it it doesnt work. I hope that anybody can help me with this.

local detector = script.Parent.ProximityPrompt
local requiredTeam = game.Teams.Prisoners

game.ReplicatedStorage.Events.Lasers.OnServerEvent:Connect(function(player)		
	if player.Team == requiredTeam then					

		detector.Triggered:Connect(function(plr)							

			game.Workspace.Lasers.Parent = game.Lighting
			wait (8)
			game.Lighting.Lasers.Parent = game.Workspace

			print("worky work")	

		end)
	end
end)

2 comments

0

Can you confirm that the event is received on the server? I have had instances where, for whatever reason, an event could not be received (likely a bug).

0

Not really since im new to scripting.