Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isn't this Remote Event firing when I click the part?

Currently, I'm trying to make it so when you click a part it fires a Remote Event, but it isn't working. Can someone help? Here's my script:


local RP = game:GetService("ReplicatedStorage")
local Trigger = RP:WaitForChild("WHYYY")
local ClickDetector = game.Workspace.Sizedparttest.ClickDetector

ClickDetector.MouseClick:Connect(function()
	print("Recived")
	Trigger:FireClient()
	print("Worked")
end)


Thanks!

2 comments

0

Also, the output says "Argument 1 missing or nil"

0

Which line is it saying that?

1 answer

when you use FireClient, the first argument has to be a player, or else the server won't know who to fire the remote to

if you meant to fire the remote to every client, you can use FireAllClients instead of FireClient

if you meant to fire the remote to the client who clicked in the first place, you can do this

local RP = game:GetService("ReplicatedStorage")
local Trigger = RP:WaitForChild("WHYYY")
local ClickDetector = game.Workspace.Sizedparttest.ClickDetector

ClickDetector.MouseClick:Connect(function(player)
    print("Recived")
    Trigger:FireClient(player)
    print("Worked")
end)

but if you wanted to do that you could have just detected the click on the client sooooo :P

This discussion is preserved as it was. New answers, comments, and votes are closed.