generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: What's wrong with this?

Previous Thread :: Next Thread 
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
26 Jun 2014 12:55 PM
I want this to put a sphere around you that lets you move fast for a bit.
Output is saying line 58, my final connection, but I don't know why.
(And Flame1 is in Lighting!)

bin = script.Parent
me = script.Parent.Parent.Parent

enabled = true

function onButton1Down(mouse)
if not bin.Enabled then
return
end

local player = game.Players.LocalPlayer
if player == nil then return end
enabled = false

mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"

me.Character.Torso.CFrame = me.Character.Torso.CFrame * CFrame.new(Vector3.new(0, 20, 0))

wait(0.5)

p = Instance.new("Part")
p.Parent = me.Character
p.Shape = "Ball"
p.BrickColor = BrickColor.new("Pastel violet")
p.Size = Vector3.new(6, 6, 6)
p.Transparency = 0.4
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.CFrame = me.Character.Torso.CFrame
game:GetService("Debris"):AddItem(a,7)
weld = Instance.new("Weld")
weld.Part0 = me.Character.Torso
weld.Part1 = p
weld.Parent = me.Character.Torso
weld.C0 = CFrame.new(0, 0, 0)*CFrame.fromEulerAnglesXYZ(0, 0, 0)
game.Lighting.Flame1:clone().Parent = p
g = Instance.new("BodyVelocity")
g.Parent = me.Character.Torso
g.maxForce = Vector3.new(math.huge, 0, math.huge)
for i = 1 , 250 do
g.velocity = me.Character.Torso.CFrame.lookVector * 100
wait(0.01)
end

p:Remove()
g:Remove()

wait(8)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
enabled = true

end


function onS(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onS)
Report Abuse
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
26 Jun 2014 01:16 PM
Bump.
Report Abuse
Zecrit is not online. Zecrit
Joined: 24 Jan 2013
Total Posts: 2618
26 Jun 2014 01:24 PM
What does output say because I think I know what it is but not sure?
Report Abuse
Zecrit is not online. Zecrit
Joined: 24 Jan 2013
Total Posts: 2618
26 Jun 2014 01:25 PM
Oh and is this in a localscript and tool?
Report Abuse
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
26 Jun 2014 01:42 PM
I'll clarify a bit.

When it's in a Hopperbin and regular script, it works in Studio's Test Solo, but not in regular servers.

When I change it to a Tool (and still a regular script), it doesn't work at all.
(I thought changing it to a regular tool would work but it didn't)

Output for regular Tool: 15:41:34.655 - Script 'Players.Player1.Backpack.TOOLNAME.Script', Line 58
15:41:34.655 - Stack End
Report Abuse
Zecrit is not online. Zecrit
Joined: 24 Jan 2013
Total Posts: 2618
26 Jun 2014 01:45 PM
bin = script.Parent
me = script.Parent.Parent.Parent

enabled = true

tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if not bin.Enabled then
return
end

local player = game.Players.LocalPlayer
if player == nil then return end
enabled = false

mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"

me.Character.Torso.CFrame = me.Character.Torso.CFrame * CFrame.new(Vector3.new(0, 20, 0))

wait(0.5)

p = Instance.new("Part")
p.Parent = me.Character
p.Shape = "Ball"
p.BrickColor = BrickColor.new("Pastel violet")
p.Size = Vector3.new(6, 6, 6)
p.Transparency = 0.4
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.CFrame = me.Character.Torso.CFrame
game:GetService("Debris"):AddItem(a,7)
weld = Instance.new("Weld")
weld.Part0 = me.Character.Torso
weld.Part1 = p
weld.Parent = me.Character.Torso
weld.C0 = CFrame.new(0, 0, 0)*CFrame.fromEulerAnglesXYZ(0, 0, 0)
game.Lighting.Flame1:clone().Parent = p
g = Instance.new("BodyVelocity")
g.Parent = me.Character.Torso
g.maxForce = Vector3.new(math.huge, 0, math.huge)
for i = 1 , 250 do
g.velocity = me.Character.Torso.CFrame.lookVector * 100
wait(0.01)
end

p:Remove()
g:Remove()

wait(8)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
enabled = true

end




--Try that, put it in a localscript.
Report Abuse
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
26 Jun 2014 02:33 PM
Nothing appears in Output with that one, and there's a red line under Line 7....
Report Abuse
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
26 Jun 2014 02:33 PM
But yeah, it does nothing....
Report Abuse
robotmega is not online. robotmega
Joined: 16 May 2009
Total Posts: 14084
26 Jun 2014 02:36 PM
1. change script to local script
2. ???
3. profit
Report Abuse
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
26 Jun 2014 02:37 PM
What?^
Report Abuse
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
26 Jun 2014 02:40 PM
So I tried my original one with a Local script and Tool, but it still said Line 58 (Last last) of mine in Output was causing the StackEnd.

It seems to only work in a Hopperbin.
Report Abuse
robotmega is not online. robotmega
Joined: 16 May 2009
Total Posts: 14084
26 Jun 2014 02:41 PM
make it a hopperbin and local script and tell me full output
Report Abuse
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
26 Jun 2014 02:49 PM
Oh, you were right. It just needed the Hopperbin+Local script!

Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image