Roblox Studio

Scripting Examples

Roblox Studio

Roblox Stuido is a programing environment that allows users to create thier own roblox games using the programming language Lua.

Here you will find a collection of scripting examples broken down into easy to find categories

Animations

Use the animation editor to create an animation and then write a script that plays your animation

Doorways

Open a doorway by touching a part near the door

Open a doorway by paying a certain amount.

Open a doorway by touching a a key to the door

Fire, Light, Explosions

If a simple oof just isn't cutting it for you try explosions instead!

First Person Shooter

How to make a gun


Make Bullets do Damage


Kills / Deaths Leaderboard


Reload, Zoom, Mouse Icon


Ammo GUI


Health GUI


Ammo Drop


Shift to Sprint


Kill Streaks


GUI

A menu that appears when the player clicks on a GUI button.

A series on how to set up a shop GUI

Run/Walk Button

Switch between running and walking with the simple click of a button!

Allows players to sprint by pressing a GUI button. Allows the player to increase and decrease the sprint speed.

Allows players to sprint by pressing a GUI button.

A way to open a GUI menu such as a shop by clicking on a part in the shop model.

A menu that appears when the players first join the game.

Open up your own shop to sell power ups that can be used in your game!

Item Collection

Obby

This script can be added to a part and will cause the player to oof when they touch it! Good for obbies or just to add a "surprise" to your game.

Just like the die on touch script but spinning! Great for adding an extra challenge to get around.

This script allow you to move parts around during your game. Can be used in combination with die on touch script to create all sorts of oofing fun!

This script sets up a leader board system in your game that can be customize to your games currency or point system!

Cool magic trick to show your friends. Step on a part and watch as a new one appears out of thin air!

Allows players to sprint by using the shift button on the keyboard.

Storing game data on Roblox data store servers to get players game data between sessions.

A leaderboard system that keeps track of how long players have been in the game.

Sends a message through the chat system when a player touches a certain part in the game such as a level ending part.

Power-Ups

Add a little pep to your step with a dose of speed boost! Use with caution, or don't, it's just a game after all

Allows players to sprint by pressing a GUI button.

This script allows you to wait for it . . . double jump!

I believe I can fly ♫ . . . wait how do I get back down again?

A tool that when equipped allows the player to click and teleport the position of the mouse.

Remote Events

Connect events that happen on the client side to actions on the server.

Connect server events to a particular client or player

Connect server events to all clients or players in the game

Simulators

A series on how to create a mining simulator game. How to make tools, how to mine rocks, how to sell resources, and a simple shop system.

Click a button get points, simple enough?

Tired of clicking your mouse for points? Press a key instead!

Storing game data on Roblox data store servers to get players game data between sessions.

This script sets up a leader board system in your game that can be customize to your games currency or point system!

Teleport

This script turns a part into a teleportation pad that can be used to teleport players to another part of your game .... or into a dark pit, your choice!

Similar to the teleportation pad, but instead you click a button on the screen. Useful if you have multiple locations players teleport to regularly such as shops, lobbies, or checkpoints!

Another teleportation method, because why not? Now you can teleport by pressing a key on your keyboard!

A tool that when equipped allows the player to click and teleport the position of the mouse.





Weapons, Enemies, and Combat

Introduction to weapon making! Covers how to make a tool and a basic script that plays an animation and deals damage.

Make a tool shoot lasers by using ray casting (client side only).

Series on pathfinding that covers the basics of pathfinding service and how to move humanoind objects. Intro to AI.

A part that when touched gives the player health. Can be one time use or as a healing zone.

Like the health pickup but gives the player a force field instead.

Doorway that clears tools players have in their hands or in their backpack. Tools can be deleted or returned to a set location.

A script that assigns players to separate spawn locations in the game

Sends a message through the chat system when a player in the game has died.

A leaderboard system that keeps track of how many times the players in a game die.

Enemies spawn in the game when a player touches a part. Limits on how many enemies can be set.

Other

I . . . don't want to talk about it