Hello, I have been trying to do something for a while but I cant seem to make it work, so I tried something easier but it still wont work. I have a part called "clicker" in Workspace with a ClickDetector inside. Then, in ReplicatedStorage I have a RemoteEvent that is just called RemoteEvent. Inside of ReplicatedFirst I have a LocalScript that is supposed to know when "clicker" is clicked. the final addition is the regular script in Workspace that is used to print something when the button is pressed. I get as an error, "Argument 1 missing or Nil"
Here is the localscript in ReplicatedFirst:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService()("ReplicatedStorage")
local player = game.Players.LocalPlayer
game.Workspace.clicker:WaitForChild("ClickDetector").MouseClick:Connect(function()
ReplicatedStorage.RemoteEvent:FireServer()
end)
Here is the script in Workspace:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()
print("button pressed")
end)
EDIT: Ok so I tried changing it for what TheIndigoNight said, but I still get the same error.
The localscript is now in ReplicatedStorage and is as follows:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService()("ReplicatedStorage")
local player = game.Players.LocalPlayer
ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()
print("clicked")
end)
And the regular script is now inside of clicker:
script.Parent.ClickDetector.MouseClick:Connect(function()
game.ReplicatedStorage.RemoteEvent:FireClient()
end)
IT STILL DOESNT WORK PLEASE HELP

6 comments
I have edited my response with what is likely the culprit. Just an extra set of parentheses.
Why not put a server script inside of the button and run everything inside the same script when the button is pressed?
well, its going to be putting money into the person and i want it to be filtering enabled
I fixed what I was supposed to fix and now it is saying that RemoteEvent is not even a child of ReplicatedStorage but it is.
Being that you are using a local script, you may need to add a WaitForChild for RemoteEvent. See: https://developer.roblox.com/en-us/api-reference/function/Instance/WaitForChild
yeah i actually did that and still getting issues you know what you can just drop this question im not getting anything out of it and im irritated lmao