Share Your Scripts
#3
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]
[Image: rogershanksluffy_display.gif]
Reply


Messages In This Thread
Share Your Scripts - by Jacob__mybb_import1 - 04-05-2011, 10:05 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)