Alright, this script works sort of, but it doesnt generate a message into the playergui after elseif. Does anyone know why? script:
script.Parent.MouseClick:connect(function(open) if script.Parent.Parent.Parent.door.Transparency == 0 and script.Parent.Parent.CanCollide == true then script.Parent.Parent.Parent.door.Transparency = 1 script.Parent.Parent.Parent.door.CanCollide = false wait(5) script.Parent.Parent.Parent.door.CanCollide = true script.Parent.Parent.Parent.door.Transparency = 0 elseif script.Parent.Parent.Transparency == 1 and script.Parent.Parent.CanCollide == false then m = Instance.new("Message", open.PlayerGui) m.Name = "Pm" m.Text = "This door is already open." wait(3) m:Destroy() end end)
script > ClickDetector > door ^ Thats whats in workspace.
Its because when you click the part, and you declare "open", you are meaning the physical person that clicked the part. In short, the open argument is the person in workspace. Somehow, you need to take the persons name, find it in Players, then find their PlayerGui, THEN insert it there.