Alright so I attempted to do everything as I was instructed. The brick or the "Handle" will not follow the mouse. I checked my output box and it replied "Bad Cast" The brick would then fly off somewhere beyond the horizon. When I want to follow the mouse. I do believe I did the Loop function incorrectly, help would be appreciated! :D
bin = script.Parent
player = script.Parent.Parent.Parent
me = script.Parent.Parent.Parent
local LocalPlayer = game.Players.LocalPlayer
Mouse = LocalPlayer:GetMouse()
function Talk(msg)
game:GetService("Chat"):Chat(player.Character.Head, msg, Enum.ChatColor.Red)
end
function onButton1Down(mouse)
if not enabled then
return
end
local player = game.Players.LocalPlayer
if player == nil then return end
enabled = false
enabled = false
for i = 1, 1 do
local x2 = script.Handle:clone()
x2.Name = "Fire"
x2.CanCollide = false
x2.Anchored = false
x2.Transparency = 0
x2.Parent = game.Workspace
game.Debris:AddItem(x2, 4)
x2.CFrame = game.Players.LocalPlayer.Character.Head.CFrame*CFrame.new(0,0,0)
local BodyGyro = Instance.new("BodyGyro")
BodyGyro.Parent = x2
BodyGyro.D = 5000
BodyGyro.MaxTorque = Vector3.new(90,90,90)
BodyGyro.P = 300
local BodyPos = Instance.new("BodyPosition")
BodyPos.Parent = x2
BodyPos.D = 1250
BodyPos.maxForce = Vector3.new (2000,2000,2000)
BodyPos.P = 1000
BodyPos.Position = Vector3.new (mouse)
end
while true do
mouse.target = Mouse
mouse.hit.p = Mouse
wait(.1)
end
wait()
wait(5)
enabled = true
end
enabled = true
function onS(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onS)
