Could someone guide me in the right direction on how to fix this so when I press the button it opens the frame or is it really unnecessary for there to be a RemoteEvent for that reason?
-- Local Script (In StarterPack)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UIFrameOpenedEvent= ReplicatedStorage:WaitForChild("UIFrameOpenedEvent")
UIFrameOpenedEvent:FireServer()
-- Script (In ServerScriptService)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UIFrameOpenedEvent = Instance.new("RemoteEvent", ReplicatedStorage)
UIFrameOpenedEvent.Name = "UIFrameOpenedEvent"
local UI = game.StarterGui.ScreenUI
local Frame = UI.ActualFrame
local Profile = UI.Profile
local function onUIOpenedFired(player)
UI.Profile.MouseButton1Click:Connect(function(player)
Frame.Visible = not Frame.Visible
end)
end
UIFrameOpenedEvent.OnServerEvent:Connect(onUIOpenedFired)
