Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Currently working on first person arms, does anybody know how I can fix this?

Asked by 3 years ago
Edited 3 years ago

I've been making a game, and have made some first person arms after watching a tutorial. When the player dies, the arms stay floating midair when they respawn, but they still have the arms on their screen. Does anybody know how I can add to the script so when they die, the arms disappear?

This is the script:

local player = game.Players.LocalPlayer

local char = script.Parent

local cam = workspace.Camera

local run = game:GetService("RunService")

local arms = game.ReplicatedFirst.Arms:Clone()

run.RenderStepped:Connect(function()

    arms:SetPrimaryPartCFrame(cam.CFrame * CFrame.new(0,-1.5,0))

end)

arms.Parent = cam

1 answer

Log in to vote
0
Answered by 3 years ago
char.Humanoid.Died:Connect(function()
    arms.Parent = nil
end)
Ad

Answer this question