script is in serverscriptserv and the button in startergui in the screengui called introbeam.
what i'm trying to do is to get this script to visible a frame then invisible a frame. but seems to be not working..
frame = game.StarterGui.IntroBeam Event = game.ReplicatedStorage.BlackEvent Event.OnServerEvent:Connect(function(plr,Gui) if Gui == "On" then if frame.Beam.Visible == false then frame.Beam.Visible = true elseif frame.Beam.Visible == true then frame.Beam.Visible = false end end end)
you cant access a gui using local script which your using a server script in ServerScriptService
which would work in studio but not ingame. just switch the normal script(server script) to a local script inside your gui called Beam. also i wouldnt suggest using StarterGui
to access a gui since its called StarterGui so you would need to reset, just use the player's PlayerGui
like this example:
local player = game.Players.LocalPlayer player.PlayerGui.frame.Beam.Visible = false
also you could use the not
function, so you wouldnt need to use a bool value to toggle or the method of some sort that your using and you dont need remote events for this.
example script
script.Parent.Visible = not script.Parent.Visible -- "not" is like a toggle and you can use it in if statments, but it wouldnt be a toggle
i didnt show the full script since you werent that descriptive and i dont know whats gui and you didnt show the script that fired the event