local Door = game.Workspace.Door
script.Parent.MouseButton1Click:Connect(function()
game.Workspace.Door.Status.SurfaceGui.Closed.Visible=false
game.Workspace.Door.Status.SurfaceGui.Open.Visible=true
Door.Transparency=0.7
Door.CanCollide=false
end)
welcome to the scripting support category
i just lost so many braincells reading this post
this is invalid, you cannot change gui over StarterGui because the visible GUI while playing the game, you must use localscripts to be able to do this
you can use RemoteEvents to order LocalScripts to do certain functions by a ServerScript, or vice versa (in replicatedstorage)
create a remoteevent in ReplicatedStorage and name it to whatever you want
add a local script in StarterGui and do the
local replicated = game:GetService("ReplicatedStorage") --yields script until service is found
local event = replicated:WaitForChild("youraverageevent") --yields the script until an instance is found, replace target with name of remoteevent for now
local frame = script.Parent.Messages.Lockdown:WaitForChild("Lockdown")
--OnClientEvent function
event.OnClientEvent:Connect(function() --if a script fires the client then the script will do the following:
frame.Visible = true --now you "legally" change the visibility of a gui
end)
ok now to the server script
i know you are new to scripting, but there is another way to shorten the length of a script using your brain so it doesn’t consume this much space
but yeah ill just rewrite the script cuz why not
local Doors = {game.Workspace.DrivingTestDoor, game.Workspace.ObbyDoor, game.Workspace.RangeShooting, game.Workspace.Door, game.Workspace.SpawnDoor} --table holds mutple values
script.Parent.MouseButton1Click:Connect(function()
for c = 1, #Doors do -- repeat a certain number of times
if c ~= 4 then -- if agurement is met + ~ is an alternative to not
Doors[c].Transparency = 0.7
else --if agurement is not met
Doors[c].Transparency = 0
end
Doors[c].CanCollide = true --your orginal script had false, which will allow people to clip through the walls
wait()
end
end)
local replicated = game:GetService("ReplicatedStorage") --yields script until service is found
local event = replicated:WaitForChild("youraverageevent") --yields the script until an instance is found, replace target with name of remoteevent for now
local frame = script.Parent.Messages.Lockdown:WaitForChild("Lockdown")
--OnClientEvent function
event.OnClientEvent:Connect(function() --if a script fires the client then the script will do the following:
frame.Visible = true --now you "legally" change the visibility of a gui
script.Parent["Host Panel"].PanelMobile.ScrollFrame.LockDown["Lockdown alarm"]:Play() --play audio
end)