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 6 years ago

** Please note I have filtered enabled on **

--// Local Script

--// Variables
local Button = script.Parent.TextButton
local visibleOptions = game.ReplicatedStorage:WaitForChild("visibleOptions")

--// Scripting
Button.MouseButton1Click:Connect(function()
    visibleOptions:FireServer()
end)

--// Script

--// Variables
local visibleOptions = game.ReplicatedStorage:WaitForChild("visibleOptions")

--// Scripting
visibleOptions.OnServerEvent:Connect(function(player)
    player.PlayerGui.optionsGui.Frame.Visible = true    
end)

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

1 answer

Log in to vote
0
Answered by
OfcPedroo 396 Moderation Voter
6 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:

repeat wait() game.Players.LocalPlayer:WaitForChild("PlayerGui") --Roblox Bug :I

--// Variables
local Button = script.Parent.TextButton
local visibleOptions = game.ReplicatedStorage:WaitForChild("visibleOptions")

--// Scripting
Button.MouseButton1Click:connect(function() --I'm not sure if you need, but always put "connect" with lower case.
    game.Players.LocalPlayer.PlayerGui.optionsGui.Frame.Visible = true
end)

If this works, mark as the solution please!

As always, good scripting!

Ad

Answer this question