Author Topic: Customized Balls  (Read 1972 times)

0 Members and 2 Guests are viewing this topic.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Customized Balls
« on: April 11, 2016, 02:11:31 PM »
Hai, hasn't been a while since I posted help or asked for help, so here ye go ^-^

I have hit an unfortunate bump in my code right now and since it's not ULX related I've put it in off-topic. (And cause I know you guys are smart and are possibly able to help!) Is there an easy way for me to be able to spawn a ball (With a swep I have made), upon secondary fire (right click) it cycles through a few colours (which would be printed in chat of the colour thats being set), and when reloading it changes the size in chunks of 16. (Maybe 8, GMod base ball code size is 4-128 [pixels?]) And a surprise command that changes the gravity the ball has. (I can code this, I just need to get pointed in the colour changing/size changing/spawning direction.)

All thanks given now, and I appreciate the help if you tackle this :)

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Customized Balls
« Reply #1 on: April 11, 2016, 04:27:06 PM »
These wiki pages should get you going in the right direction:

ents.Create

Entity:SetColor

Entity:SetModelScale

I suggest that in the future you also post questions in the Facepunch Garry's Mod Development Problems That Don't Need Their Own Thread. Not that people here are any worse than those on Facepunch (this forum usually seems to be nicer), it's just that Facepunch has many more users and thus you are more likely to get an answer faster.

(if any mods have an issue with me promoting a FP thread, feel free to ask me to/just remove it)
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given