|
| 21 Jun 2012 03:44 PM |
Apparently output says something when the function has mouse as a variable. I made a comment saying where it is
Players.Player.Backpack.Gourd.Script:19: attempt to index local 'mouse' (a nil value)
local player=game.Players.LocalPlayer local char=player.Character
function Stream(mouse) local b=Instance.new("Part") b.BrickColor= BrickColor.new("Bright red") b.Reflectance=0 b.Transparency=1 b.Size=Vector3.new(2,2,2) b.Shape="Ball" b.CanCollide=false b.TopSurface="Smooth" b.Position=char.Head.Position b.BottomSurface="Smooth" b.Friction=0 b.Touched:connect(function(h) Hit(h) end) local bo=Instance.new("BodyVelocity") bo.maxForce=Vector3.new(9999,9999,9999) bo.velocity=(mouse.Hit.p-char.Head.Position).unit*60 --Problem over here bo.Parent=b b.Parent=Gourd local Bo=b while Bo.Parent and Up==false do wait() if mouse.Target and (Bo.Position-mouse.Target.Position).magnitude<7 then Hit(mouse.Target) else Bo.CFrame=b.CFrame bo.velocity=(mouse.Hit.p-Bo.Position).unit*150 end local b=Instance.new("Part") b.BrickColor=Color b.Reflectance=0 b.Transparency=0.2 b.Touched:connect(Hit) b.Size=Vector3.new(2,2,2) b.CanCollide=false b.Anchored=true b.TopSurface="Smooth" b.Parent=Gourd b.CFrame=Bo.CFrame*CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360))) b.BottomSurface="Smooth" Delay(0,function() local p=b for i=1,5 do wait(0.05) p.Transparency=i/5 end p:remove() end) end pcall(function() Bo:remove() end) end
script.Parent.Selected:connect(function(mouse) mouse.Button1Down:connect(Stream) end)
|
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 21 Jun 2012 03:48 PM |
script.Parent.Selected:connect(function(mouse) mouse.Button1Down:connect(function() Stream(mouse) end) end) |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 21 Jun 2012 03:49 PM |
script.Parent.Selected:connect(function(mouse) mouse.Button1Down:connect(function() Stream(mouse) end) end) |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
| |
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 21 Jun 2012 03:51 PM |
I laik to nom on late toast
|
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 04:03 PM |
This is supposed to make a brick and follow the mouse around, but noting happens, and output says nothing. When I press down the mouse it should work and when I let go it should disappear. Help?
local player=game.Players.LocalPlayer local char=player.Character Up = false
function Stream(mouse) local b=Instance.new("Part") b.BrickColor= BrickColor.new("Bright red") b.Reflectance=0 b.Transparency=1 b.Size=Vector3.new(2,2,2) b.Shape="Ball" b.CanCollide=false b.TopSurface="Smooth" b.Position=char.Head.Position b.BottomSurface="Smooth" b.Friction=0 b.Touched:connect(function(h) Hit(h) end) local bo=Instance.new("BodyVelocity") bo.maxForce=Vector3.new(9999,9999,9999) bo.velocity=(mouse.Hit.p-char.Head.Position).unit*60 --Right here bo.Parent=b b.Parent=Gourd local Bo=b while Bo.Parent and Up==false do wait() if mouse.Target and (Bo.Position-mouse.Target.Position).magnitude<7 then Hit(mouse.Target) else Bo.CFrame=b.CFrame bo.velocity=(mouse.Hit.p-Bo.Position).unit*150 end local b=Instance.new("Part") b.BrickColor=Color b.Reflectance=0 b.Transparency=0.2 b.Touched:connect(Hit) b.Size=Vector3.new(2,2,2) b.CanCollide=false b.Anchored=true b.TopSurface="Smooth" b.Parent=Gourd b.CFrame=Bo.CFrame*CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360))) b.BottomSurface="Smooth" Delay(0,function() local p=b for i=1,5 do wait(0.05) p.Transparency=i/5 end p:remove() end) end pcall(function() Bo:remove() end) end
script.Parent.Selected:connect(function(mouse) mouse.Button1Down:connect(function() Stream(mouse) end) end)
function Hit(p) if p.Parent.Name~=Name and p.Parent.Parent.Name~=Name and p.Name~="Base" and p.Name~="Sand" and p.Parent then Delay(0,function() p.Anchored=true p.Name="Sand" p.BrickColor=Color for i=1,5 do p.Transparency=i/5 wait(0.1) end p:remove() end) end end |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 21 Jun 2012 04:05 PM |
| I think you can't use mouse object outside Selected/Equipped function. |
|
|
| Report Abuse |
|
|