Remote event not firing

I am trying to enable some particle emitters in a part called ‘VaterTrigger’.

My issue is that my remote event is not firing from the client to the server.

I have tried changing the parameters of the remote events, I have tried changing the name of the parameters and I have double checked the spelling in the script.

I have no idea how to fix this, please help, these are my scripts:

local script (which works absolutely fine):

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character
local UserInputService = game:GetService("UserInputService")
local Dragging = false
local vaterworksgui = plr.PlayerGui["Vaterworks gui"]
local actualpercent = 0
local ReplicatedStorage = game:GetService("ReplicatedStorage")

game:GetService("Workspace").VaterTrigger.ClickDetector.MouseClick:Connect(function()
	vaterworksgui.Enabled = true
end)

script.Parent.TextButton.MouseButton1Down:Connect(function()
	Dragging = true
end)
-- this is the section with the remote event \/
vaterworksgui.Frame.TextButton.MouseButton1Down:Connect(function()
	ReplicatedStorage:FindFirstChild("Vaterworksevent"):FireServer(actualpercent)
	vaterworksgui.Enabled = false
	print(actualpercent)
end)
--                                                                /\
-- this is my slider gui script which does work (totally not yoinked)
UserInputService.InputChanged:Connect(function()
	if Dragging then
		local MousePos = UserInputService:GetMouseLocation()+Vector2.new(0,36)
		local RelPos = MousePos-script.Parent.AbsolutePosition
		local percent = math.clamp(RelPos.X/script.Parent.AbsoluteSize.X,0,1)
		script.Parent.TextButton.Position = UDim2.new(percent,0,0.5,0)
		vaterworksgui.Frame.Percent.Text = math.round(percent*100)
		actualpercent = math.round(percent*100)
	end
end)

UserInputService.InputEnded:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		Dragging = false
	end
end)

server script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
ReplicatedStorage:FindFirstChild("Vaterworksevent").OnServerEvent:Connect(function(percentage)
	print(percentage)
	if percentage == Workspace.VaterTrigger.RequiredVater.Value then
		print("hmm")
			for i,v in pairs(Workspace.VaterTrigger:GetChildren()) do
				if v:IsA("ParticleEmitter") then
					v.Enabled = true
					wait(1)
					v.Enabled = false
			end
	    	end
    	end
    end)

Please help.

1 Like

The first parameter of RemoteEvent | Roblox Creator Documentation is the player that fired the remote event and the second parameter is the arguments you passed.

1 Like

Incorrect, the way he did it is fine.

Axel beat me to the issue.

I have now made the event a variable, which is ReplicatedStorage.Vaterworksevent, then put it in the place of the script ReplicatedStorage:FindFirstChild("Vaterworksevent"), it did not do anything

https://gyazo.com/dea7d1e71162ecc45ba0d3146b38baa9
I have done that now yet it still does not fire.

Can you screen shot the remote in replicatedStorage? Are you sure that you are referencing the same remote on the client and server?

Is there any errors in the output? If so, could you show a screenshot?

here

the api error thing did not bother me when I made previous remote events.

no no no, i meant is there any errors from the scripts you have provided?

no, and if there are any, I can’t see them.

oh wait a minute, I found this error when I got out of test mode image
is this of any significance or importance?

1 Like

This is not detecting because the while what is up of the script doesnt let it detect if there is a remote event firing, basically move the remote event script to the top of the script.

1 Like

it worked, thank you for the help.

1 Like