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

How to destroy a locked character?

Asked by 4 years ago

Is there any way for a client to destroy a character on the server side that is locked? I have been struggling with this and I've come to the conclusion that it may not be possible. Within testing, when the character isn't locked, the client can kill the character just fine, but as soon as it's locked, I have trouble killing it.

0
What are you trying to accomplish with this? Just asking to get a better understanding of why and what you are trying to do. climethestair 1663 — 4y

1 answer

Log in to vote
3
Answered by 4 years ago
Edited 4 years ago

I don't know why would u want to "Destroy" a character, but if you're having problems with killing it on client, do it on the server.

--LocalScript
Remote:FireServer() -- remember the remote variable has to be a RemoteEvent, and it has to be the same instance in client than in server

--ServerScript
Remote.OnServerEvent:Connect(function(player)
    player.Character:Destroy()
    --or
    player.Character.Humanoid.Health = 0
end)

As you haven't explained well, this is all I can help with, I hope this is what u wanted.

0
The Remote variable needs to be a RemoteEvent for this to work, they need to be the same instance on client and server TerrodactyI 173 — 4y
0
Who up voted this guy the answer is incorrect replace Remote.OnClientEvent with Remote.OnServerEvent Prestory 1395 — 4y
Ad

Answer this question