Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

i'm having trouble opening and closing a frame am i missing something?

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)

1 answer

✓ Accepted answer

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

11 comments

0

Thank you!

0

np

0

ok sorry to come back to this topic but, it now only works in studios and not in game.. buttons are local script and serverscriptserv is a reg script.

0

whats the "reg" script

0

because this would work, its probably that your using it wrong

0

serverscript

0

so whats the serverscript suppose to do

0

thats whats in the serverscriptservices which is how i get the which is where i trigger the event or something like that. but i don't see any errors and it does work the way i want it to work but only in studios

0

you dont need a remote event as i said in my answer

0

only if it was something that could be done by the server only you would need remote events, if there isnt just use a local script

0

i'll figure it out, thanks for the help. :)

This discussion is preserved as it was. New answers, comments, and votes are closed.