Hello, I made a Touch Event that whenever the player's character touches the part, it will fire a RemoteEvent. Easy right? Wrong. I put the FireServer script in a local script because Firing the server only works on clients.
FireServer Local Script:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
game.ReplicatedStorage.ShowCodeGUI:FireServer()
end
end)
OnServer Script:
game.ReplicatedStorage.ShowCodeGUI.OnServerEvent:Connect(function(player)
local playerGUI = player:WaitForChild("PlayerGui")
local CodeFrame = playerGUI:FindFirstChild("CodeGUI"):FindFirstChild("CodeFrame")
CodeFrame.Visible = true
end)
Also CodeGUI is located in StarterGUI, meaning it will get cloned and will be located in Player's PlayerGUI.

2 comments
omg, tysm!!! :D
no problem