Don't know how to get position of the otherpart's character

I’m making a script where if you step on a button, a part will appear above the character that touched the part.

local players = game:GetService("Players")
local part = script.Parent



part.Touched:Connect(function (otherpart)
	local player = otherpart.Parent
	player:GetChildren("Humanoid")
	players:GetPlayerFromCharacter(otherpart)
	local Brick = Instance.new("Part")
	if Brick then
		print("the part has been created")
	end
	Brick.Position = player.Humanoid.Position
	Brick.position.Y = Brick.Position.Y+10
	Brick.Color = Color3.new(0.333333, 0, 0)
	Brick.Material = Brick
	Brick.Anchored = true
	Brick.CanCollide = false
	task.wait()
end)

I need to get the position of the other part’s character to have the part spawn above the character.

Another issue is that “Y cannot be assigned” I’m lost as to why that happened.

2 Likes

pretty sure you cant edit the part y position only, meaning you would have to do something like this

Brick.Position = Vector3.new(player.HumanoidRootPart.Position.X, player.HumanoidRootPart.Position.Y + 10, player.HumanoidRootPart.Position.Z)

hope I understood this correctly, let me know if you need any more help