Drop System Doesn't Work

hello, im creating a system for drops and when i try to pick it up it gives this message

i found the issue but i can’t fix it!

here the code for reference

RunService.Stepped:Connect(function()
	for _, Drop in WorkspaceDrops:GetChildren() do
		for i, Player in Players:GetChildren() do
			local Character = Player.Character or Player.CharacterAdded:Wait()
			if Character and Drop and Drop.Parent ~= nil then
				if (Character.PrimaryPart.Position - Drop.PrimaryPart.Position).Magnitude < 10 and Drop.CanCollect.Value == true then
					if Character:WaitForChild("Humanoid").Health ~= 0 then
						Drop.PrimaryPart.CFrame = Drop.PrimaryPart.CFrame:Lerp(Character.PrimaryPart.CFrame, 0.1)
						if (Character.PrimaryPart.Position - Drop.PrimaryPart.Position).Magnitude < 2 then
							if not Debounces[Drop] then
								Debounces[Drop] = true
						
								local d = ReplicatedStorage.Remotes.CollectDrop:FireServer(Player,Drop.Name) or ReplicatedStorage.Remotes.CollectDrop:FireClient(Player,Drop.Name) -- the issue is here
						
								task.wait(3)
						
								Debounces[Drop] = nil
							end
							Drop:Destroy()
						end
					end
				end
			end
		end
	end
end)

return module

if you can find something im here to see

ot before closing i wanted to say: all the code works but it gives error

1 Like

Well, you’re trying to use FireServer from the server (A remote event is only client-to-server or server-to-client communication). Instead of that, try to use a bindable event for server-to-server communication.

the module uses server and local on the same function
wait…
bindable… i didn’t think that ill try and see because i never used an bindable event in the project im creating :smiling_face_with_tear:

Then the issue is that it’s using the server at all. FireServer cannot be called from the server.

oh im wrong is all server sided :face_with_spiral_eyes:
testing…

WORKS

but…

i need to test for multiplayer

works! but i found another issue…

im gonna create a post

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.