I’m trying to fire a remote event to tell the client to empty the players backpack if they hit a part but it won’t receive anything(i use prints to tell if it works)
Blockquote script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local event = game:GetService(“ReplicatedStorage”).Events:WaitForChild(“CheeseDeposit”)
event:FireClient(plr)
print(“sent”)
end
end)
When you receive a RemoteEvent from the server on the Client, you don’t get passed the player argument. If you want the player on the Client you can use, game:GetService("Players").LocalPlayer. Though, why not just remove the backpack contents on the server?
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if not plr then return end
plr.Backpack:ClearAllChildren()
end
end)
The player was me messing around and i tried the server but it didn’t work, i had another post about it and nobody could figure it out… + i still need to update the CheeseCount
and i know it sends because the sent print statement prints