✓ Accepted answer
Hello. I'm not sure of my answer, but I think the problem is that at lines 2 and 3, you did a variable that get the player and his character. Then, at line 12, you used those variables to spawn that part. But the lines 2 and 3 never RE-NEW, cuz you didn't put them inside a function. So the script will spawn the block every time at the same position. You can put the varibales inside the function like this:
local Tool = script.Parent
Tool.Activated:Connect(function()
local Player = game.Players.LocalPlayer
local Character = Player.Character
local brick = Instance.new("Part")
brick.Parent = game.Workspace
brick.Size = Vector3.new(1, 5, 5)
brick.Anchored = true
brick.CFrame = CFrame.new(Character.LeftFoot.CFrame, 10 , Character.LeftFoot.CFrame)
end)
Also, you wrote at line 12, the CFrame of the two feet. It should be the X, Y or Z value of their positions.
local Tool = script.Parent
Tool.Activated:Connect(function()
local Player = game.Players.LocalPlayer
local Character = Player.Character
local brick = Instance.new("Part")
brick.Parent = game.Workspace
brick.Size = Vector3.new(1, 5, 5)
brick.Anchored = true
brick.CFrame = CFrame.new(Character.LeftFoot.Position.X, 10, Character.LeftFoot.Position.Z)
end)
Hope this helped!
3 comments
you have 2 CFrames inside of CFrame.new.. that's not right
Error messages?
at line 12 were your setting the CFrame do: CFrame.new(brick.Position,Character.LeftFoot.Position)