Author Topic: Roll the Dice module  (Read 28664 times)

0 Members and 3 Guests are viewing this topic.

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Roll the Dice module
« on: February 28, 2015, 03:36:30 AM »
Helloo everyone ^-^

I'm pretty new to Lua programming and I just wrote my first semi-useful ULX module. (Yay!) I'd love to get some feedback on it. I hope it's okay if I post it here? :)

I bet most people already know Roll the Dice! You type rtd in the chatbox and you'll receive a random effect from "the dice".

I'm aware that not all effects will work in each gamemode but it's easy to add/delete effects in lua/ulx/modules/sh/trtd.lua.

Console variables
trtd_cooldown - (Default: 90) - Time (in seconds) before a player can roll the dice again
trtd_notifications - (Default: 1) - Broadcast notification to all players when a player rolls the dice

List of effects
Code: [Select]
**Good effects**
* double health
* faster speed
* godmode
* increased armor
* invisibility
* low gravity
* noclip
* nothing
* tiny player

**Bad effects**
* blindness
* confusion
* corporal punishment
* decreased armor
* drugged
* earthquake
* reduced health
* reduced speed
* respawn
* rocket
* spontaneous combustion

Changelog
Code: [Select]
## 1.4.0 (23 Jun 2020) - rewrite

Features:

- New effects: nothing, corporal punishment, increased/decreased armor, respawn

## 1.4.0 (19 Dec 2015) - lost

Features:

- New effects: nothing, corporal punishment, increased/decreased armor, respawn

## 1.3.1 (2 Apr 2015)

Bugfixes:

- Fix invisibility not hiding the players weapon

## 1.3.0 (2 Apr 2015)

Features:

- Improved "randomness" for the Dice

Bugfixes:

- Fix earthquake effect affecting nearby players
- Update blindness effect to use gLua's ScreenFade

## 1.2.1 (24 Mar 2015)

Bugfixes:

- Fix effects getting disabled twice
- Fixed effects giving unexpected results when ran simultaneously

## 1.2.0 (14 Mar 2015)

Features:

- New effects: noclip, confused, drugged

## 1.1.0 (3 Mar 2015)

Features:

- Improved update script

Bugfixes:

- Fix effect notifications not being sent to all players

## 1.0.0 (27 Feb 2015)

Features:

- Roll the dice
- Update checker

Thanks!
« Last Edit: June 23, 2020, 11:13:04 AM by Timmy »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Roll the Dice module
« Reply #1 on: February 28, 2015, 09:54:22 AM »
Looks interesting and I took a look at some of the code and it's well done too.
Nice work!

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: Roll the Dice module
« Reply #2 on: March 01, 2015, 02:39:22 PM »
I was working on one and i see this is done! Love to look at it!

An Error Has Occurred!

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