Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a brick always appear on the right side of my avatar?

Asked by 8 years ago

I tried CFraming the position of the brick, but when i turn around and open the screen it appears on my left or right in front of me.. Could you guide me please?

01function openScreen()
02    if deb == false then deb = true
03        wait()
04        chr.Humanoid.WalkSpeed = 0
05        local sb = game.ReplicatedStorage.inventoryScreen
06        local sb2 = sb:Clone()
07        sb2.Parent = chr
08        sb2.CFrame = chr.Head.CFrame + Vector3.new(6,0,-2) --Right here is the prob
09        plr.PlayerGui.UI.Adornee = sb2
10        plr.PlayerGui.UI.container.Visible = true
11    end
12end

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

Try using CFrame.new instead of Vector3.new. Like this

01function openScreen()
02    if deb == false then deb = true
03        wait()
04        chr.Humanoid.WalkSpeed = 0
05        local sb = game.ReplicatedStorage.inventoryScreen
06        local sb2 = sb:Clone()
07        sb2.Parent = chr
08        sb2.CFrame = chr.Head.CFrame + CFrame.new(6,0,-2) --Right here is the prob
09        plr.PlayerGui.UI.Adornee = sb2
10        plr.PlayerGui.UI.container.Visible = true
11    end
12end

If that does not work, then your facing the wrong way. Either way. I hope this helps!

Ad

Answer this question