Last active
February 26, 2019 21:06
-
-
Save uruskan/95c5a0c5d2464ad360b5b150ea6c9374 to your computer and use it in GitHub Desktop.
Getting Local Player (2 Ways)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--WaitForChild() isminden anlaşılabileceği gibi Child objeleri bekler, Character bir child obje değil Player Objesinin bir Propertysidir. | |
--------------------------------------------- | |
local player = game.Players.LocalPlayer | |
local character = player.Character or player.CharacterAdded:wait() | |
repeat wait() until character.Humanoid | |
local human = character.Humanoid | |
human.Health = 0 | |
---------------------------------------------- | |
local rep = game:GetService("ReplicatedStorage") | |
local player = game:GetService("Players").LocalPlayer | |
local char = player.Character or player.CharacterAdded:wait() | |
repeat wait() until char:FindFirstChild("Humanoid") | |
local human = char.Humanoid | |
------------------------------------- | |
local player = game.Players.LocalPlayer | |
local character = player.Character or player.CharacterAdded:wait() | |
local human = character:WaitForChild("Humanoid",5) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment