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

I think I'm not targeting the player?

Asked by
emite1000 335 Moderation Voter
10 years ago

I'm not quite sure what's wrong with this script. Nothing happens at all (not even an error), but I think it might have to do with the script not targeting the player?

game.Players.PlayerAdded:connect(function(player)
    player:WaitForDataReady()
    player.Character.Head:Destroy()
    end)

1 answer

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

Try adding prints

print("Script running")
game.Players.PlayerAdded:connect(function(player)
    print("player added")
    player:WaitForDataReady()
    player.Character.Head:Destroy()
    print("player killed")
end)

Then you can more easily see where the problem is. If NOTHING prints, your script is probably disabled.

0
You were right, I was testing it in Play Solo. However, I just went and tested it in a server and it still doesn't work. even added a few more things to happen but still no results. emite1000 335 — 10y
0
Is there any output? Is the character nil or something? Perci1 4988 — 10y
0
No, it's all clear (aside from some stuff from my other scripts). emite1000 335 — 10y
0
Edited it, read it now. Perci1 4988 — 10y
0
I am such an idiot..... It was disabled this entire time '-_-. Thanks for all your help with stupid old me! emite1000 335 — 10y
Ad

Answer this question