this is my script so far:
Player = script.Parent.Parent mouse = Player:GetMouse() function onKeyDown(key) Key = key:lower() if Key == "r" then x = Instance.new("Part") x.BrickColor = BrickColor.new("Reddish brown") x.Size = Vector3.new(8,1,8) x.Anchored = true x.TopSurface = "Smooth" x.BottomSurface = "Smooth" x.Material = "Brick" x.Parent = Workspace x.CFrame = Player.Character.Torso.CFrame *CFrame.new(0,0,-5) x.Rotation = Vector3.new(Player.Character.Torso.Rotation) game.Debris:AddItem(x,3) end end mouse.KeyDown:connect(onKeyDown)
Effectively i'm trying to make a wall that faces you.
OK, at first your script started off good, but then you got to the CFrame part... You see, CFrame includes rotation, so the next line with Rotation was unnecessary, and should just be removed. And your size is completely wrong. When changing sizes with Vector3.new it goes like this: Vector3.new(xSize, ySize, zSize) and since you wanted a wall, it would've made a square kinda on the ground, because the ySize is height, and you put it as 1. What it should be is this:
x.Size = Vector3.new(8, 8, 1)
And the game.Debris part... Unless Debris is actually IN game, you should change it to
Game:GetService("Debris"):AddItem(x, 3)
Here's the script FIXED.
Script:
Player = script.Parent.Parent mouse = Player:GetMouse() function onKeyDown(key) Key = key:lower() if Key == "r" then x = Instance.new("Part") x.BrickColor = BrickColor.new("Reddish brown") x.Size = Vector3.new(8, 8, 1) x.Anchored = true x.TopSurface = "Smooth" x.BottomSurface = "Smooth" x.Material = "Brick" x.Parent = Workspace x.CFrame = Player.Character.Torso.CFrame *CFrame.new(0,0,-5) Game:GetService("Debris"):AddItem(x, 3) end end mouse.KeyDown:connect(onKeyDown)
Well, I hope I helped.