Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Frame won't become visible, what's wrong with my script?

Asked by 7 years ago

** Please note I have filtered enabled on **

01--// Local Script
02 
03--// Variables
04local Button = script.Parent.TextButton
05local visibleOptions = game.ReplicatedStorage:WaitForChild("visibleOptions")
06 
07--// Scripting
08Button.MouseButton1Click:Connect(function()
09    visibleOptions:FireServer()
10end)
1--// Script
2 
3--// Variables
4local visibleOptions = game.ReplicatedStorage:WaitForChild("visibleOptions")
5 
6--// Scripting
7visibleOptions.OnServerEvent:Connect(function(player)
8    player.PlayerGui.optionsGui.Frame.Visible = true   
9end)

https://i.imgur.com/3jEmBcc.png // photo of explorer

1 answer

Log in to vote
0
Answered by
OfcPedroo 396 Moderation Voter
7 years ago

With FE off, you don't need that much. You can do everything in the LocalScript. Here, delete the Script, and put this in the LocalScript:

01repeat wait() game.Players.LocalPlayer:WaitForChild("PlayerGui") --Roblox Bug :I
02 
03--// Variables
04local Button = script.Parent.TextButton
05local visibleOptions = game.ReplicatedStorage:WaitForChild("visibleOptions")
06 
07--// Scripting
08Button.MouseButton1Click:connect(function() --I'm not sure if you need, but always put "connect" with lower case.
09    game.Players.LocalPlayer.PlayerGui.optionsGui.Frame.Visible = true
10end)

If this works, mark as the solution please!

As always, good scripting!

Ad

Answer this question