#Make a part destroy on the client roblox studio

1 messages · Page 1 of 1 (latest)

clever rover
#

local part = workspace:WaitForChild("Part")

local player = game.Players.LocalPlayer

part.Touched:Connect(function()
local humanoid = player.Parent:FindFirstChild("Humanoid")
if humanoid then
part:Destroy()
end
end)

-- its in starterplayerscripts as a local script

silk rover
#

sup

#

local part = workspace:WaitForChild("Part")
this part assumes the part is created before the script runs. if it dosen't exist, the script might error

#

game.Players.LocalPlayer.Parent:FindFirstChild("Humanoid") is incorrect because LocalPlayer.Parent does not refer to the character.

#

@clever rover

clever rover
#

yo yo

#

Wiat so

#

i take away the parent from player

#

soits just the player in general

silk rover
#

ok then use findfirstchild

#

and yk "Make a part destroy on the client roblox studio" means to destroy only for you