A problem with remote events

I’m trying to create a script where when you die it respawns the box. I’ve tried to make it through a normal local script, but it only works globally so now I’m trying to create it through a remote event but I’m not quite understanding it.



Here are my scripts to show you what’s going on. I’m not sure what I’ve done wrong so if you have any feedback or examples that would be great. Thanks.

From what I am seeing, are you trying to respawn the box globally (so everyone can see it respawn) or just the player who dies?

If you put a breakpoint at line 5 in the local script, does it fire when you die? If not, then its likely a problem with the server script.

1 Like

It looks to me that it is supposed to only respawn for the person who died.

1 Like

Instead of firing through remote events. Just use a local script and try:

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.Character:Wait()

char:WaitForChild("Humanoid").Died:Connect(function()
if workspace:FindFirstChild("box") then
	workspace.box:Destroy()
	local copy = game:GetService("ReplicatedStorage").box:Clone()
	copy.Parent = workspace
end
end)
2 Likes

Thank you for your feedback and example I will have to look into later I don’t have much time right now.

i don’t think the box was ever in workspace to begin with

1 Like

yeah, I finally figured it out. it wasn’t and also, I had to tweak one thing. Which makes me very happy because I gave up on it like a month and a half ago but then I was like, I really want to finish this and now I have.
here I’ll mark yours as solution because it pretty much was.