hello beautiful people hope you are having a blessed day i'm making so if the thing is equipped the wall is in front if the player but it is always just next to the player can somebody please help
here is the script
script.Parent.Equipped:Connect(function()
script.Parent.Value.Value = false
wait(0.01)
local building = game.Players.LocalPlayer.PlayerGui.building.Value
local clone = game.ReplicatedStorage[building]:Clone()
clone.Parent = game.Workspace
local guiclone = script.Parent.ScreenGui:Clone()
guiclone.Parent = game.Players.LocalPlayer.PlayerGui
repeat
local X = script.Parent.Part.Position.X
local Y = script.Parent.Part.Position.Y
local Z = script.Parent.Part.Position.Z +5
local x = script.Parent.Part.Orientation.X
local y = script.Parent.Part.Orientation.Y
local z = script.Parent.Part.Orientation.Z
clone:SetPrimaryPartCFrame(CFrame.new(Vector3.new(X,Y,Z)))
wait(0.1)
until script.Parent.Value.Value == true
clone:Destroy()
guiclone:Destroy()
end)
script.Parent.Unequipped:Connect(function()
script.Parent.Value.Value = true
end)
help

1 comment
while true do wait(), a loop can be useful, or render stepped run service, or even check if the player moved.