#Getting the Players position

1 messages · Page 1 of 1 (latest)

carmine vine
#

how do i get the position of the player?

frank pilot
#

playervariable.Character.HumanoidRootPart.Position

carmine vine
frank pilot
#

yeah sure but you need to define the playervariable variable

#

also it only saves it once

leaden onyx
carmine vine
green harnessBOT
#

studio** You are now Level 3! **studio

frank pilot
#

if its a local script then its game.Players.LocalPlayer

#

if its not then it depends

carmine vine
carmine vine
# frank pilot if its a local script then its game.Players.LocalPlayer

okay so its not working and i dont know w hat im doing worng can you help?

game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode==Enum.KeyCode.E then
local SpawnedPart = Instance.new("Part", workspace)
local playervariable = game.Players.LocalPlayer
local PlayerPosition = playervariable.Character.HumanoidRootPart.Position
SpawnedPart.BrickColor = BrickColor.new("Really red")
SpawnedPart.Shape = "Ball"
SpawnedPart.Material = Enum.Material.SmoothPlastic
SpawnedPart.Position = Vector3.new(PlayerPosition)
end
end)

#

chatgpt helped me nvm

carmine vine
#

@small tartan :(

green harnessBOT
#

studio** You are now Level 4! **studio

plush quarry
#

Start over

deft pewter
#

before learning how to script i suggest learning about a website:

https://google.com

green harnessBOT
#

studio** You are now Level 6! **studio