So I've been trying for an hour or two to try and make a wall appear 5 studs away from the player when they press X, but I'm getting this error "ServerScriptService.sheet:7: attempt to call a CFrame value" and I'm not sure what to do. I also tried making it so it would pop up out of the ground but I couldn't figure that out either so I decided not to. Here's the code
local sheet = game.ServerStorage:WaitForChild("sheet")
game.ReplicatedStorage.Sheet.OnServerEvent:Connect(function(player, CFrame)
local character = player.Character
local newSkill = sheet:Clone()
local offsetCFrame = Instance.new("CFrameValue")
offsetCFrame.CFrame = CFrame(5, 0, 0)
newSkill.CFrame = character.HumanoidRootPart.CFrame:ToWorldSpace(offsetCFrame)
newSkill.CanCollide = true
local skillHit
skillHit = newSkill.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Part") then
hit.Parent.Part:Destroy()
end
end)
end)
