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.