Yoshirocks90
Member
This is my thread for posting things I make with SOCs and Lua. Right now, I don't have any SOCs to show, but I have Luas:
The only problems these scripts have is as a spectator in multiplayer it gives a small warning, but they work properly afterwards.
Feedback on these/ways to optimize them would be great.
Also... any ideas for something I should try to script? It doesn't matter if it's been done before, I just need something to make to get better.
Code:
--Yoshi's Quick Stop Ability
local CanQuickStop = 1
local HasQuickStopped = 0
addHook ("ThinkFrame",
for player in players.iterate
if player.valid then
if player.mo.skin == "yoshi" and player.mo.health >= 21 and (player.cmd.buttons & BT_USE) and player.mo.z > player.mo.floorz and CanQuickStop == 1 and HasQuickedStopped == 0 and not player.powers[pw_super] then
player.mo.health = player.mo.health -
player.health -
player.mo.momx = 0
player.mo.momy = 0
player.mo.momz = 0
CanQuickStop = 0
HasQuickStopped = 1
elseif player.mo.z == player.mo.floorz and CanQuickStop == 0 then
CanQuickStop = 1
HasQuickStopped = 0
end
end
end
end)
Code:
--Yoshi's Super Floating Script
local PlayerIsFloating = 0
addHook("ThinkFrame", do
for player in players.iterate
if player.valid then
if player.mo.skin == "yoshi" and player.powers[pw_super] and player.mo.z > player.mo.floorz and (player.cmd.buttons & BT_USE) then
player.mo.momz = 0
player.mo.state = 31
PlayerIsFloating = 1
else
PlayerIsFloating = 0
end
if PlayerIsFloating == 1 then
player.charability = 0
end
if player.mo.z == player.mo.floorz and player.mo.skin == "yoshi" then
player.charability = 1
end
end
end
end)
The only problems these scripts have is as a spectator in multiplayer it gives a small warning, but they work properly afterwards.
Feedback on these/ways to optimize them would be great.
Also... any ideas for something I should try to script? It doesn't matter if it's been done before, I just need something to make to get better.
Last edited: