Scripts › Slime Transformation
Overview
Interactive minigame command! Chatters have a 25% chance of turning into a slime for 3 days with custom persistent JSON storage and role replies.
script.sayl
# Command: !slime
# Description: Random chance (25%) to transform into a slime for 3 days!

# ── 1. Check if viewer is already a slime ─────────────────────────────────────
READ isSlime FROM JSON "slimes.json" KEY "{username}"

IF {isSlime} == 1 THEN
  TIME now
  READ slimeTime FROM JSON "slimes.json" KEY "{username}_time"
  MATH timePassed = {now} - {slimeTime}

  # Expired after 3 days (259,200,000 ms)
  IF {timePassed} >= 259200000 THEN
    WRITE "0" TO JSON "slimes.json" KEY "{username}"
    REPLY "Oh no @{sender}! Your slime form has melted away after 3 days. Try !slime again!"
    EXIT
  END IF

  # Still active: Calculate remaining days
  MATH msRemaining = 259200000 - {timePassed}
  MATH daysRemaining = {msRemaining} / 86400000
  ROUND daysRemaining TO 1

  REPLY "@{sender}, you are already a slime! *jiggles* (You have {daysRemaining} days left)"
  EXIT
END IF

# ── 2. Transformation Roll (25% Chance: 75-100) ───────────────────────────────
RANDOM roll = 1 TO 100

IF {roll} >= 75 THEN
  TIME now
  WRITE "1" TO JSON "slimes.json" KEY "{username}"
  WRITE {now} TO JSON "slimes.json" KEY "{username}_time"
  REPLY "WOW @{sender}! You rolled {roll} (needed 75+) and magically transformed into a slime for 3 days!"
ELSE
  REPLY "Aw @{sender}, you rolled {roll} and failed to become a slime! (Needed 75+) Better luck next time."
END IF
Reviews (0) 4.9 / 5.0
Sign in with Twitch to leave a review.
No reviews yet.
Download .zip
Clicking Install sends the package to your desktop app via the yip:// protocol.
Details