Free scripts
Poggy Skillcheck
A circular timing minigame: a needle sweeps round a ring and the player presses Space inside the zone. Other scripts call it with one line and get pass, fail and "great" hits back.
Overview#
Poggy Skillcheck is a small minigame library. It does nothing on its own: other scripts ask for a skillcheck when a player does something that should take a bit of skill, and the player answers it.
A ring appears on screen with a turning needle. The player presses Space while the needle is inside the white zone. Inside that zone is a smaller gold "great" zone, which scripts can reward with a bonus. The game keeps running while the ring is up; the player is not locked into a menu.
Poggy scripts that use it:
- Poggy Fishing needs it: reeling in a fish is a skillcheck.
- Poggy Crafting can use it for recipes that ask for a skillcheck instead of a progress bar. It is optional there.
What it can do:
- Needle speed and zone size from 1 (easy) to 5 (hard).
- Several hits in a row (up to 10), with a counter on screen. One miss fails the whole check.
- A gold "great" zone of any size, or none.
- Clockwise, anticlockwise or random direction, a random start position, a shake, and a ring that can appear away from the centre of the screen.
- A warning tone one second before the ring appears, and sounds for hits and great hits.
- It follows the Poggy theme chosen in poggy_core (0.23.0 or newer).
It is free. It is not open source: please do not resell or re-upload it.
Requirements#
| What | Why |
|---|---|
| RedM with VORP Core, RSG Core or QBCore RedM | It runs on any of the three. |
| poggy_core 0.13.0 or newer | Every Poggy script needs it. It must start first. |
No database tables, no items and no server-side setup. Everything runs on the player's game.
Installation#
- Download
poggy_skillcheckfrom your Cfx portal and put the folder in your server'sresourcesfolder. - In
server.cfg, start it after poggy_core and before any script that uses it:ensure poggy_core ensure poggy_skillcheck ensure poggy_fishing - Restart the server.
Configuration#
Every setting is in the /poggy settings hub under Skillcheck, or in config.lua if you prefer to edit the file. Restart the script after a change.
The difficulty settings are only defaults. A script that sets its own value for an option always wins, so changing a default only changes checks that leave that option out. Poggy Fishing, for example, sets nearly every option itself, so these defaults barely change fishing.
General
| Setting | Default | What it does |
|---|---|---|
Skillchecks enabled (Enabled) | true | Master switch. When off, no ring is shown and every check passes at once, so players always succeed at whatever the check was guarding. |
Test command (TestCommand) | false | Adds the /skillcheck command for trying settings in game. Any player can use it while it is on, so leave it off on a live server. |
Default difficulty (Config.SkillCheck.Defaults)
| Setting | Default | Range | What it does |
|---|---|---|---|
Needle speed (speed) | 3 | 1 – 5 | How fast the needle turns. 1 is about 3.5 seconds a lap; 5 is under one second. |
Zone size (difficulty) | 3 | 1 – 5 | How big the success zone is. 1 is about a quarter of the ring; 5 is about a fourteenth. |
Great zone size (great) | 30 | 0 – 100 | How much of the success zone is gold, in percent. 0 turns great hits off; 100 makes every hit great. |
Repetitions (repetition) | 1 | 1 – 10 | Hits in a row needed to pass. |
Pause between repetitions (timeBetween) | 250 | 100 – 500 | Milliseconds between one repetition and the next. |
Needle direction (direction) | "cw" | cw, ccw, rand | Clockwise, anticlockwise, or a new random direction for every repetition. |
Start position scatter (startOffset) | 20 | 0 – 50 | The needle starts opposite the zone, moved by a random amount up to this percent of the ring. 0 always starts in the same place, so players learn the timing. |
Screen position scatter (randomizer) | 0 | 0 – 5 | 0 is always the centre of the screen. Each step lets the ring appear up to 10% of the screen further away. |
Shake the ring (shake) | false | on / off | Makes the ring shake while the needle turns. |
Shake speed (shakeSpeed) | 2 | 1 – 5 | How fast it shakes. |
Shake distance (shakeDist) | 2 | 1 – 5 | How far it shakes, about 1 to 8 pixels. |
Speed, zone size, shake speed and shake distance are whole numbers. A value outside its range is pulled back to the nearest end.
Making it harder without making it frustrating
- Change speed or zone size, not both. A fast needle and a small zone together is very hard.
- Ask for 2 or 3 repetitions instead.
- Set the direction to random, or raise the start position scatter, so players cannot learn one rhythm.
Sounds (Config.SkillCheck.Sounds)
| Setting | Default | What it does |
|---|---|---|
Volume (Volume) | 0.1 | Volume of the sounds, from 0 (silent) to 1 (full). Quiet on purpose. |
Warning tone boost (IncomingBoost) | 1 | Multiplies the warning tone's volume. 2 is twice as loud as the hit sounds. It never goes above full volume. |
Incoming, Good, Great | file names | Not used by this version. |
To use your own sounds, replace the files in ui/sfx/skillcheck/ and keep their names: incoming.mp3, good.mp3, great.mp3.
Commands#
| Command | Who | What it does |
|---|---|---|
/skillcheck [options] | Everyone, only while Test command is on | Starts a test skillcheck with the values you type. Anything you leave out uses the defaults. |
/skillcheck off / /skillcheck on | Everyone, only while Test command is on | Turns your own skillcheck sounds off or on until you reconnect. |
The options go in this order; give as many as you like:
/skillcheck [speed] [difficulty] [repetition] [randomizer] [shake] [shakeSpeed] [shakeDist] [timeBetween] [direction] [great]
| Example | Meaning |
|---|---|
/skillcheck | All defaults |
/skillcheck 4 4 2 | Speed 4, zone 4, two hits in a row |
/skillcheck 4 4 3 0 true 3 3 300 cw 50 | Every option set |
The command is only added when the script starts with Test command on, so restart the script after switching it. It has no permission check: turn it off again when you are done.
Key: Space (the game's context control) hits the ring. It is not rebindable.
Using it in game#
What a player sees:
- A warning tone plays. About one second later the ring fades in.
- Press Space while the needle is in the white zone. In the gold part it is a great hit.
- If the check needs several hits, a counter shows progress, for example
2 / 3, and the ring resets after a short pause. The needle may change direction between hits. - Pressing outside the zone, or letting the needle go round without pressing, fails the whole check.
| Event | You see | You hear |
|---|---|---|
| Skillcheck coming | Ring fades in | Warning tone |
| Hit | White flash | Hit sound |
| Great hit | Gold flash | Great sound |
| Miss | Red tint | Nothing |
What happens after a pass or a fail is up to the script that asked for the check.
For developers#
Call it from client-side Lua. The call waits until the player finishes (about one second of warning, then the ring), so always run it inside a thread or a callback.
CreateThread(function()
local result = exports.poggy_skillcheck:StartSkillCheck({
speed = 3,
difficulty = 3,
repetition = 2,
})
if result.success then
-- passed: reward the player from your own server code
end
end)
Make poggy_skillcheck a dependency in your manifest if your script cannot work without it, or check that it is running first if it is optional.
Exports
| Export | Returns | What it does |
|---|---|---|
StartSkillCheck(options) | table | Shows a skillcheck and waits for the result. options is optional. |
IsSkillCheckBusy() | boolean | true while a skillcheck is running. |
CancelSkillCheck() | boolean | Stops the running skillcheck. false if nothing was running. The waiting StartSkillCheck call then returns success = false. |
Options
Every option can be left out; anything left out uses the server's defaults from Configuration.
| Option | Values | Meaning |
|---|---|---|
speed | 1 – 5 | Needle speed. 1 is slow. |
difficulty | 1 – 5 | Zone size. 1 is large and easy. |
repetition | 1 – 10 | Hits in a row needed to pass. |
randomizer | 0 – 5 | How far from the screen centre the ring may appear. |
shake | true / false | Shake the ring. |
shakeSpeed | 1 – 5 | How fast it shakes. |
shakeDist | 1 – 5 | How far it shakes. |
timeBetween | 100 – 500 | Milliseconds between repetitions. |
direction | "cw", "ccw", "rand" | Needle direction. |
great | 0 – 100 | Percent of the zone that is a great hit. 0 turns great hits off. |
startOffset | 0 – 50 | Random start position, in percent of the ring. |
The result
| Field | Meaning |
|---|---|
success | true when every repetition was hit. |
great | true only when every repetition was a great hit. |
greatCount | Great hits across all repetitions, including those before a miss. |
cancelled | true when the check was stopped with CancelSkillCheck. |
Treat any success = false as a fail. greatCount is only filled in when the ring was actually played, so write result.greatCount or 0.
Good to know
- One at a time. A call made while another skillcheck is running returns
success = falseat once; it does not wait. CheckIsSkillCheckBusy()first. - Switched off. When the server owner turns Skillchecks enabled off, every call returns
success = trueat once. - Client only. There are no server events. Never trust the client's result for anything valuable without your own server-side checks.
Examples
Hard crafting, three hits, a bonus for all great:
local result = exports.poggy_skillcheck:StartSkillCheck({
speed = 5,
difficulty = 5,
repetition = 3,
timeBetween = 300,
})
if result.success then
if result.great then
TriggerServerEvent('myscript:bonusItem')
else
TriggerServerEvent('myscript:normalItem')
end
end
Shake and a random direction:
local result = exports.poggy_skillcheck:StartSkillCheck({
repetition = 5,
shake = true,
shakeSpeed = 3,
shakeDist = 3,
direction = "rand",
great = 20,
}) Troubleshooting#
Every skillcheck passes straight away
Skillchecks enabled is off. Turn it on and restart the script.
A skillcheck fails at once without showing
Another skillcheck was still running on that player's game. Scripts should check IsSkillCheckBusy() before asking for one.
Changing a default made no difference
The script asking for the check sets that option itself, and its value wins. Change it in that script's settings instead.
No sound
Check Volume is above 0. A player who typed /skillcheck off has muted their own sounds until they reconnect or type /skillcheck on.
/skillcheck does nothing
Test command is off, or was switched on without restarting the script, or Skillchecks enabled is off.
Poggy Fishing will not start
Fishing needs this script running first. Put ensure poggy_skillcheck above ensure poggy_fishing.
Updating#
poggy_core's updater keeps it up to date, and your config.lua settings are kept: see Updates. If you replaced the sound files with your own, keep a copy of them somewhere safe.