Use brackets to access a name directly that has spaces, shown below.
game.Workspace.p.Character["Right Leg"]:Destroy()
Also, you script has several minor errors.
Your script runs when the player is added, and it runs PlayerJoined. When this happens, it passes the player itself to your function.
"p" in your function is the player, so you do not need to go game.Workspace.p.Character
Also, players in a game are stored in game.Players the characters are in Workspace
Your code should then be as follows
function PlayerJoined(p)
p.Character["Right Leg"]:Destroy()
end
game.Players.PlayerAdded:connect(PlayerJoined)
I would also add a check to make sure the character exists, just in case.
function PlayerJoined(p)
repeat wait() until p.Character
p.Character["Right Leg"]:Destroy()
end
game.Players.PlayerAdded:connect(PlayerJoined)
1 comment
For the record, this type of question has been asked several times.