Okay, so basically what I want to do is make a gui appear as soon as you press a model's button which has a click detector, however for this I need to make a local script and server script communicate with remotefired but whenever I join the game it automatically enables the GUI for all please help. This is the server script:
function onClicked()
script.Parent.Parent.LOUD1.BrickColor = BrickColor.new("Black")
script.Parent.Parent.LOUD2.BrickColor = BrickColor.new("Black")
script.Parent.Parent.LOUD3.BrickColor = BrickColor.new("Black")
script.Parent.Parent.Union2.Smoke.Enabled = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
local hiEvent = Instance.new("RemoteEvent")
hiEvent.Parent = game.ReplicatedStorage
hiEvent.Name = "hiEvent"
local function onPlayerAdded(player)
hiEvent:FireClient(player)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
and this is the local script:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui", 500)
local hiEvent = ReplicatedStorage:WaitForChild("hiEvent")
local weewoo = Instance.new("ScreenGui", playerGui)
local tint = Instance.new("Frame", weewoo)
local blur = Instance.new("ImageLabel", weewoo)
weewoo.Name = "weewoo"
blur.Name = "Blur"
tint.Name = "Tint"
playerGui.weewoo.Enabled = false
tint.BackgroundColor3 = Color3.fromRGB(64,111,52)
tint.BackgroundTransparency = 0.6
tint.Size = UDim2.new(1,0,1,0)
blur.Size = UDim2.new(1,0,1,0)
blur.ImageTransparency = 0.2
blur.BackgroundTransparency = 1
blur.Image = "rbxassetid://204446257"
local function onhiEventFired()
weewoo.Enabled = true
tint.Visible = true
blur.Visible = true
wait(90)
weewoo.Enabled = false
blur.Visible = false
tint.Visible = false
end
hiEvent.OnClientEvent:Connect(onhiEventFired())

6 comments
But now when I try it after changing it to that it doesn't actually pop up the gui anymore when the button is pressed
The hardest thing about this is i want the gui to put up when an ingame model button is pressed not as soon as you join
I mean, the other thing is that you can't listen for clickdetectors on the server
So is there anyway to make it work?
Listen to the clickdetectors on the client? Duh
Listen to the clickdetectors on the client? Duh.