Hello, I have a placement system but it causes one error and I don’t understand why
Script:
function setup()
temp = mort[current]:clone()
temp.Parent = workspace.CurrentCamera
for i,v in pairs(temp:GetChildren()) do
v.Transparency = 0.8
v.CanCollide = false
end
mouse.TargetFilter = temp
while wait() and temp do
temp:SetPrimaryPartCFrame(CFrame.new(mouse.Hit.p)*CFrame.Angles(0,math.rad(angle),0))
ok = temp.PrimaryPart.CFrame
end
end
script.Parent.Equipped:connect(function(m)
uis = game:GetService("UserInputService")
mouse = m
d = mouse.Button1Up:connect(dostuff)
mouse.Button2Up:connect(function()
if mouse.Target.Parent.Name == "Barricade" then
script.Parent.R:FireServer(mouse.Target.Parent)
end
end)
c = uis.InputBegan:connect(function(k)
if k.KeyCode == Enum.KeyCode.R then
if angle < 360 then
angle = angle + 10
else
angle = 0
end
elseif k.KeyCode == Enum.KeyCode.T then
if angle > 0 then
angle = angle - 10
else
angle = 360
end
elseif k.KeyCode == Enum.KeyCode.F then
current = current - 1
if current == -1 then
current = 10
end
temp:destroy()
setup()
elseif k.KeyCode == Enum.KeyCode.G then
current = current + 1
if current == 10 then
current = 0
end
Would anyone have any Ideas on what is whrong?