01 | local tool = script.Parent |
02 | local handle = tool.Handle |
03 | local Player = game.Players.LocalPlayer |
04 | local mouse = Player:GetMouse() |
05 | local at = 2 |
06 |
07 | tool.Activated:Connect( function () |
08 | --WEAPON EFFECT |
09 | local expo = Instance.new( "Explosion" , workspace) |
10 | expo.Position = mouse.Hit |
11 | wait(at) |
12 | expo:Destroy() |
13 | end ) |
I tried to do something but it is now broken.
the handle of the tool is not loaded yet so you get an error saying Handle is not a vaild member of Tool and you should say the mouse position like this:
01 | local tool = script.Parent |
02 | local handle = tool:WaitForChild( "Handle" ) |
03 | local Player = game.Players.LocalPlayer |
04 | local mouse = Player:GetMouse() |
05 | local at = 2 |
06 |
07 | tool.Activated:Connect( function () |
08 | --WEAPON EFFECT |
09 | local expo = Instance.new( "Explosion" , workspace) |
10 | expo.Position = mouse.Hit.Position |
11 | wait(at) |
12 | expo:Destroy() |
13 | end ) |
the handle of the tool is not loaded yet so you get an error saying Handle is not a vaild member of Tool and you should say the mouse position like this:
01 | local tool = script.Parent |
02 | local handle = tool:WaitForChild( "Handle" ) |
03 | local Player = game.Players.LocalPlayer |
04 | local mouse = Player:GetMouse() |
05 | local at = 2 |
06 |
07 | tool.Activated:Connect( function () |
08 | --WEAPON EFFECT |
09 | local expo = Instance.new( "Explosion" , workspace) |
10 | expo.Position = mouse.Hit.Position |
11 | wait(at) |
12 | expo:Destroy() |
13 | end ) |