vince

Data Store

used to save data which should persist between game sessions shared per game essentially a dictionary Each value can be indexed by a unique key which includes the player’s UserId network calls may ...

Lerping

Using a method known as linear interpolation, often referred to as lerp, you can position a CFrame between two points. For instance, the following code positions the redBlock part directly between ...

Pathfinding

find [the closest] path for an NPC to move from point A to point B ```lua local PathfindingService = game:GetService("PathfindingService") -- Variables for the zombie, its humanoid, and destination...

  • Updated 10 days ago by vince
CFrame

short for Coordinate Frame it is a data type used to rotate and position 3D objects contains global X, Y, and Z coordinates as well as rotation data for each axis contains helpful functions for wor...

Module Scripts

code within module scripts can be used by other scripts makes maintaining code easier since changes only need to be made to one module script ServerStorage/MoneyManager ```ruby local MoneyManager =...

Arrays

An array is a simple list of ordered values -- simply store the values sequentially, separated by commas ```ruby local testArray = {"A string", 3.14159, workspace.Part} print(testArray[2]) ```

  • Updated 11 days ago by vince
Tables

A table is a Lua data type that can store multiple values and can behave as either an array or a dictionary ruby local table = {} https://developer.roblox.com/en-us/articles/Table https://educatio...

Dictionary

Dictionaries are an extension of arrays. While an array stores an ordered list of items, a dictionary stores a set of key-value pairs. To create a dictionary table, define each key followed by = an...

Tick()

Tick() tells you how much time has passed since 1 Jan 1970 -- you can use it to figure out how much time has passed since a game started etc Workspace/Part/Script ruby local gameStarted = tick() lo...

  • Updated 11 days ago by vince
Remote Functions

RemoteFunction is a two-way communication (vs one-way for a RemoteEvent) Code that calls it waits to hear back before going to the next line Step 1: Create ReplicatedStorage Event Add RemoteFunctio...

UserInputService

only works as a localscript StarterPlayer/StarterPlayerScripts/LocalScript ```ruby local UIS = game.GetService("UserInputService") function doIt(input, gameProcessedEvent) if input.KeyCode == Enu...

Client-Server Model

Client - your personal computer, phone, tablet, or game console is a client. Every other unique player in the game is also a client. Server - All clients (players) in the game are connected to a Ro...

Learn how to play Texas hold'em

7 cards (eventually) 5 are laid out publicly (eventually) as community cards 2 are your hold (i.e. secret) cards player with best hand wins following example is for 3 players every player takes tur...

Remote Events

Lets you do stuff from the client to the server so everyone sees it Because of filteringEnabled if you delete a part from localScript only you see RemoteEvent is a one-way communication (vs two-way...

Spawn and Delay and Coroutine

Creates a new thread so code can run concurrently ServerScriptService/Script ```ruby local function printHello() while true do wait(1) print("Hello") end end local functio...

  • Updated 22 days ago by vince
Random

Generate a random number between 1 and 20 ruby local randomNumber = math.random(1,20) With no arguments, returns a random number in the range [0, 1). That is, zero up to but excluding 1. With 1 ar...

  • Updated 22 days ago by vince
Lua scripting

Quick and easy examples

Comments

Comments ruby --[[ print("hi") -- no action --]] Now, if we add a single hyphen to the first line, the code is in again: ruby ---[[ print("hi") --> "hi" --]]

  • Updated 22 days ago by vince
GUI

Add ScreenGui to StarterGui rename it to MainGui etc Add TextButton to ScreenGui Add LocalScript to ScreenGui StarterGui/MainGui/LocalScript ```ruby local button = script.Parent.TextButton button.M...

  • Updated 22 days ago by vince
Roblox Studio Explorer

The Explorer window shows a hierarchical list of every object inside a place It uses the concept of parenting to organize all of the objects. If an object has any children, it will show a small arr...

  • Updated 22 days ago by vince