|
| 21 May 2015 06:55 PM |
Script:
gun = script.Parent
local event1 = Instance.new("RemoteEvent") event1.Parent = gun event1.Name = "FireEvent" event1.OnServerEvent:connect(function(player, mouse) if mouse and gun.Equipped then script.Parent.Handle.NormalFire:Play() local hit = Instance.new("Part") hit.Position = mouse.Hit.p hit.Anchored = true hit.CanCollide = false hit.FormFactor = "Custom" hit.Size = Vector3.new(0.2, 0.2, 0.2) hit.TopSurface = "Smooth" hit.BottomSurface = "Smooth" hit.BrickColor = game.Players.LocalPlayer.TeamColor hit.Material = "Metal" hit.Name = "Bullet" hit.Parent = game.Workspace local damage = script.Parent.DamageScript:Clone() damage.Disabled = false damage.Parent = hit local cleanup = script.Parent.BulletCleanup:Clone() cleanup.Disabled = false cleanup.Parent = hit end end)
local event2 = Instance.new("RemoteEvent") event2.Parent = gun event2.Name = "BombEvent" event2.OnServerEvent:connect(function(player, mouse, key) key = key:lower() if key == "q" and gun.Equipped then script.Parent.Handle.BombFire:play() local bomb = Instance.new("Part") bomb.Position = mouse.Hit.p bomb.Anchored = true bomb.FormFactor = "Custom" bomb.Size = Vector3.new(0.2, 0.2, 0.2) bomb.TopSurface = "Smooth" bomb.BottomSurface = "Smooth" bomb.BrickColor = game.Players.LocalPlayer.TeamColor bomb.Material = "Metal" bomb.Name = "Bomb" bomb.Parent = game.Workspace local prep = Instance.new("Sound") prep.Parent = bomb prep.Name = "PreparationSound" prep.Volume = 0.5 prep.SoundId = "rbxassetid://138931042" local boom = Instance.new("Sound") boom.Parent = bomb boom.Name = "ExplosionSound" boom.Volume = 1 boom.SoundId = "rbxassetid://168208736" local airhorn = script.Parent.AirhornBombScript:Clone() airhorn.Disabled = false airhorn.Parent = bomb end end)
Output:
20:16:55.943 - Players.Player1.Backpack.8Shooter.Events:10: attempt to index field 'Hit' (a nil value) 20:16:55.949 - Stack Begin 20:16:55.949 - Script 'Players.Player1.Backpack.8Shooter.Events', Line 10 20:16:55.949 - Stack End 20:16:56.373 - Players.Player1.Backpack.8Shooter.Events:36: attempt to index local 'key' (a nil value) 20:16:56.374 - Stack Begin 20:16:56.374 - Script 'Players.Player1.Backpack.8Shooter.Events', Line 36 20:16:56.374 - Stack End |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 May 2015 05:50 PM |
| You can't use the mouse in a server script, idiot. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 22 May 2015 05:50 PM |
| No need to be a moron nQz... |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 05:52 PM |
| There is always reason to be a moron. |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 May 2015 05:56 PM |
| Just send the mouses position. |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 05:57 PM |
| What should I replace mouse.Hit.p? |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 06:13 PM |
I put mouse.Position but it didn't work. The output says:
20:11:34.555 - Players.Player1.Backpack.8Shooter.Events:10: attempt to index local 'mouse' (a nil value) 20:11:34.555 - Stack Begin 20:11:34.556 - Script 'Players.Player1.Backpack.8Shooter.Events', Line 10 20:11:34.556 - Stack End |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 May 2015 07:10 PM |
| I said send the mouse's position. |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 May 2015 07:18 PM |
| In the localscript, just send the mouse.Hit to the server. |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 09:45 AM |
Another message on the output appeared:
11:45:27.521 - Players.Player1.Backpack.8Shooter.Events:10: attempt to index local 'mouse' (a nil value) 11:45:27.521 - Stack Begin 11:45:27.522 - Script 'Players.Player1.Backpack.8Shooter.Events', Line 10 11:45:27.522 - Stack End |
|
|
| Report Abuse |
|
|
| |
|
Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 23 May 2015 10:31 AM |
mouse is obviously freaking nil (not defined). you need to define it.
~ᵂʰᵒ ᵃʳᵉ ʸᵒᵘ ᵗᵒᵈᵃʸ﹖~ |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 23 May 2015 10:33 AM |
You're attempting to get the mouse from a server script and wat intern33t sed |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 10:35 AM |
| I don't know how to define it. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 23 May 2015 11:08 AM |
| I thing I am going to cry. |
|
|
| Report Abuse |
|
|
| |
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 23 May 2015 11:43 AM |
| this may to advance for youlol |
|
|
| Report Abuse |
|
|