04-05-2011, 10:41 PM
Sweet. Here's the script I used for my tool at the end of my falling rocks game. Be sure to put the script in a tool, and also name the Tool "JetBoots".
[lua]
local mode = 1
names = {"JetBoots", "Exploder"}
function md(x,p)
if mode == 1 then
script.Parent.Parent.Parent.Character.Body.Controller.Velocity = Vec2D(0,5)
elseif mode == 2 then
y = create("Explosion")
y.Parent = game.World
y.Position = p
end
end
function mu()
if mode == 1 then
script.Parent.Parent.Parent.Character.Body.Controller.Velocity = Vec2D(0,0)
end
end
function kd(k)
if k == "e" then
if mode == #names then
mode = 1
else
mode = mode + 1
end
script.Parent.Name = names[mode]
elseif k == "q" then
if mode == 1 then
mode = #names
else
mode = mode - 1
end
script.Parent.Name = names[mode]
end
end
link(script.Parent.MouseDown, md)
link(script.Parent.MouseUp, mu)
link(script.Parent.KeyDown, kd)
[/lua]
[lua]
local mode = 1
names = {"JetBoots", "Exploder"}
function md(x,p)
if mode == 1 then
script.Parent.Parent.Parent.Character.Body.Controller.Velocity = Vec2D(0,5)
elseif mode == 2 then
y = create("Explosion")
y.Parent = game.World
y.Position = p
end
end
function mu()
if mode == 1 then
script.Parent.Parent.Parent.Character.Body.Controller.Velocity = Vec2D(0,0)
end
end
function kd(k)
if k == "e" then
if mode == #names then
mode = 1
else
mode = mode + 1
end
script.Parent.Name = names[mode]
elseif k == "q" then
if mode == 1 then
mode = #names
else
mode = mode - 1
end
script.Parent.Name = names[mode]
end
end
link(script.Parent.MouseDown, md)
link(script.Parent.MouseUp, mu)
link(script.Parent.KeyDown, kd)
[/lua]
![[Image: rogershanksluffy_display.gif]](http://i.neoseeker.com/mgv/574413-Mitsuomi/413/43/rogershanksluffy_display.gif)