Ok so I am using a Global Script that is inside of a part, that has a click detector
Script:
script.Parent.ClickDetector.MouseClick:connect(function() script.Parent:FindFirstChild("RemoteEvent"):FireClient() end)
It is giving me Argument 1 is missing or nil, why? [Part Answered ]
The local script won't work, I got the thing to fire but the following local script won't do a thing any ideas on how to fix it?
Local Script:
enabled = true game.Workspace.Lantern.Bulb.RemoteEvent.OnClientEvent:connect(function() if enabled == true then enabled = false local StarterGui = game:GetService('StarterGui') StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) end end)
FireClient has to have a Player as an argument, RemoteEvent:FireClient(Player)
As far as the local script goes, you could try printing out something. If it runs then you'll know that the event fired. If not then try searching the developer console for any errors that occur.
Server Script:
script.Parent.ClickDetector.MouseClick:Connect(function(Player) script.Parent:FindFirstChild("RemoteEvent"):FireClient(Player) end)
Local Script:
local enabled = true local StarterGui = game:GetService('StarterGui') workspace:WaitForChild("Lantern").Bulb.RemoteEvent.OnClientEvent:Connect(function() if enabled then enabled = false StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) end end)