Skip to main content
Discovery icon for Retro Dev Discord server

Retro Dev

4,787 Online
44,296 Members
retro-chat3 people

scripting leaderstats on part touch

Update leaderstats upon touching a part by finding the character's humanoid, verifying the player, and matching stat names.

  • Detect contact using the part's touched event, check for a humanoid in the hit object's parent, and then locate the player
  • Add a debounce check to prevent the touch event from spamming increments repeatedly
  • Ensure the leaderstat name targeted in the touch block script exactly matches the stat defined in the leaderstats script
Summarized from recent messages, might be inaccurate

More conversations

general

evaluating conditions in Lua

retro-chat

how logic gates evaluate data

retro-chat

scripting hot potato bomb transfers

general

insert gear remains accessible via admin

Talk, Play, &
Hang Out

Find your space to hang out, discuss the latest updates with the party chat, and see who's down to join your next match.
Get App