Where is the bouncy ball in files?

Hey guys i am helping a friend with a gamemode and what to know what the bouncy ball is under?
thanks,
brad

Its hidden in the garry’smod GCF file under lua, let me go check to see if I can find it…

EDIT: hmm, couldn’t find the bouncy ball, but I did find these on garry’smod.org http://www.garrysmod.org/downloads/?a=view&id=7637

Download gcfscape,open garrysmodcontent.gcf,go to the addons folder,default sent pack,and then drag n drop it in your addons folder,here you go,modify it as you like.

Also,don’t upload your modified version on garrysmod.org,this should remain a secret :ssh:

Wow, how did I miss that?

Thanks,

[editline]01:46PM[/editline]

Where does it say about the model :open_mouth: ?

[editline]01:47PM[/editline]

Wait i think i no would you do
local bob = ents.Create( “sent_ball” )
bob:SetModel(“modelpath”)?

[editline]01:49PM[/editline]

i need to turn it into a soccer ball i need the bouncy bit :stuck_out_tongue:
can someone help me take the colours of and set the model

The bouncy ball has no model(Well it has one but it only uses it for the shadow). It’s actually simulating the physics of a sphere and it’s model is a sprite.

So to make your soccer ball you would change it’s model in init.lua to your soccer ball and replace all of cl_init.lua with this :

[lua]include(‘shared.lua’)

function ENT:Draw()
self.Entity:DrawModel()
end
[/lua]

draw model i put the model?

[editline]03:15PM[/editline]

[LUA]
function ENT:SpawnFunction( ply, tr )

if ( !tr.Hit ) then return end

local SpawnPos = tr.HitPos + tr.HitNormal * 16

local ent = ents.Create( "sent_ball" )
	ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()[/LUA]

Would i set it as ent:SetModel?? btw thats in init.lua

Here are the files to the ball. You’ll want to recreate them with a different folder name then sent_ball.

Then open cl_init.lua and replace it with this :
[lua]include(‘shared.lua’)

function ENT:Draw()
self.Entity:DrawModel()
end
[/lua]

Then open init.lua and go to line 35 (first useful line in ENT:Initialize() ) and change the model that’s being set :
self.Entity:SetModel( “models/Combine_Helicopter/helicopter_bomb01.mdl” )

Change that to your soccer ball model.

Ok thanks a million!

[editline]12:28AM[/editline]

Also how would i go about spawning it in the map?
would i do it in the init.lua of the gamemode folder?

[editline]12:32AM[/editline]

and do it like this like you would spawn a npc?
bob = ents.Create( “sent_soccerball” )
bob:SetPos()
bob:Spawn()
Like that?

You can also use this site http://luabin.foszor.com/code to browse default lua files.

If you install it properly and set it’s spawnable and adminspawnable properties to true you can spawn it from the spawn menu, if it’s not available you can use what you posted in your script or simply use a console command, here’s an example :

[lua]
local function SpawnSoccer( ply )

local tr = ply:GetEyeTrace() // Trace to where the player is looking 

if !tr.HitWorld then return end // If it hit anything else then the world (ground) stop execution

bob = ents.Create( "sent_soccerball" )
bob:SetPos(tr.HitPos) (Set it's pos where the trace hit)
bob:Spawn()

end

concommand.Add( “soccer”, SpawnSoccer )[/lua]

Wrote in the reply window so no warranty. :smile: