Skip to content

Instantly share code, notes, and snippets.

@uruskan
Last active February 26, 2019 21:06
Show Gist options
  • Save uruskan/95c5a0c5d2464ad360b5b150ea6c9374 to your computer and use it in GitHub Desktop.
Save uruskan/95c5a0c5d2464ad360b5b150ea6c9374 to your computer and use it in GitHub Desktop.
Getting Local Player (2 Ways)
--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