Questions tagged [roblox]

Roblox is an online development platform, created in 2006, and targeted at children and youth. Roblox uses a modified version of Lua, known as Luau, to support Roblox games.

Roblox is a free user-generated gaming site that makes players the architects of their own 3D worlds. Parts of the platform are a variety of objects, a scripting language and a website to host games. With a free account, one gets a character and a place, that can be customized. [ Source: developer.roblox.com ]

Roblox uses Lua, a lightweight programming language embedded into each game. It is easy to use and allows users to manipulate their games in any way possible. Roblox uses their own version of Lua 5.1, edited to work with the games, called Luau, which features type checking and various optimizations. Luau allows users to do things such as creating their own GUIs, making structures such as sliding doors, adding animation to bricks, teleporting and killing players, etc.

Before posting a question, users should ensure they've used the available debugging tools to collect information about the problem they're encountering.

For more information on Roblox, visit the developer hub.

2196 questions
10
votes
7 answers

How to call functions in other script files in Roblox

I have a script file embedded in the Workspace that contains functions. I would like call these functions from script files embedded in child objects of the Workspace. I don't want to have to copy and paste these functions into multiple script…
Slim
  • 5,635
  • 7
  • 31
  • 30
6
votes
2 answers

Python PIL - Finding Nearest Color (Rounding Colors)

There is a game called Roblox, in which the player makes the game, usually of lego-looking bricks. In Roblox, for the Brick colors, you can use typical RGB values, but that'd require an additional element that is not very efficient when it comes to…
Rontron
  • 3,963
  • 7
  • 26
  • 44
5
votes
2 answers

How to end a looping coroutine in Lua?

I'm currently working on a game using Roblox (which uses Lua). It is a basically made up of several minigames. At the beginning of each round, all the players in game are put in a table and teleported to an area. That is where the coroutine comes…
user3314993
  • 287
  • 1
  • 4
  • 11
4
votes
2 answers

How exactly do Lua asynchronous calls in Roblox work?

I come from Javascript background and very used to the async calls with callbacks. Also well versed with Promise and asynch await. I recently started working on a Roblox game and its Lua SDK provides a bunch of DoSomethingAsync functions that do not…
jiminssy
  • 2,149
  • 6
  • 28
  • 45
4
votes
2 answers

Why is CoreGui RobloxLocked in the DataModel and why can't trusted users use CoreScripts?

We should be able to access some of it so that we can edit the placement of each GUI object inside of CoreGui. So, other than security reasons, why are we not allowed to edit placement of GUI objects? Also, why can't trusted users use CoreScripts? …
blocco
  • 163
  • 9
4
votes
3 answers

How do I use multiple If's in Lua?

I'm trying to make a UFO in my ROBLOX place, and wanted to create a system that would play an audio when the UFO passes overhead. I created a part, inserted an audio into the part, then placed a script in the audio. So it looks…
Marcus
  • 47
  • 1
  • 2
4
votes
1 answer

How to use Web API's with C++ language?

So i've been learning OOP is quite a while now and wanted to test out the little knowledge i have.. I wanted to use some API provided by the website, This API Checks if a username is already been taken. But how will i do it with C++? Where will i…
user5430360
4
votes
3 answers

ROBLOX Lua Error in script: '=' expected near ''

Hello I am writing a scipt on ROBLOX and I have encountered a problem. function showVictoryMessage(playerName) local message = Instance.new("Message") message.Text = playerName .." has won!" message.Parent = game.Workspace wait (2) …
4
votes
1 answer

Can HTML markup be added to a website using a chrome extension?

I am trying to create a Chrome extension that creates a button like a normal one that displays a custom page I made (this has already been done and works on my extension) but the next thing I wish to do, and I am not sure how to implement, is to…
POC0bob
  • 53
  • 3
4
votes
2 answers

How do I get the current time in Roblox (consistent across all servers)?

In my Roblox place, I want to get a value representing the current time which is consistent across all running servers and places in my game. I already know about the Time function, but the documentation for that function seems to indicate that it…
Ajedi32
  • 45,670
  • 22
  • 127
  • 172
3
votes
1 answer

Typechecking not working for generic string keys in Luau?

I'm trying to create a dictionary data structure that contains several CustomType objects that can be associated with any string key. I figured I could just use {[string]: CustomType} as my dictionary type, like this: --!strict type CustomType = { …
3
votes
1 answer

How can you load the player character when they join?

I want to make a Roblox game with multiple scenes that you can load your character into. The problem with this is that I cannot find any way to do this. I’ve done a reasonable amount of research online, but all I get are guides on how to load a…
Buzzyy
  • 111
  • 14
3
votes
1 answer

LUA - How to stop a script from running

Hello I am making a roblox LUA script and I cant figure out how to make the script stop after a if sentence. Here my code. if not newPlayer:GetRankInGroup(workspace.CoreValues.GroupID.Value) then teamName = "Civilian" (STOP) end
Felix
  • 33
  • 6
3
votes
2 answers

Roblox Lua if statement still executing even when the value isn't true

this has been a major problem in my game. I have been trying to make a script that will detect when a value is 1, 2, 3, 4, or 5. However, the if statements will still execute even if the value is 0, making the timer start before anyone can get into…
nezzled
  • 93
  • 10
3
votes
2 answers

Roblox Lua: I can't do arithmetic in the middle of print()

I am trying to put Rich as a variable, in the middle of print("You are" + print(Rich + 1) + "Rich"). It's inside a function so that whenever the player makes a part, which is going to be money in this case, their richness goes up by one: …
1
2 3
99 100