Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
1 vote
1 answer
29 views

Exp bar Gui not updating roblox studio

I have set up a basic exp system with exp, levels, and a Gui. I have the gui set to update when joining, and when gaining exp or a level, but it will only update when joining even though I'm using the ...
Lukas Raby's user avatar
0 votes
2 answers
38 views

Add a docstring to a lua function in Roblox Studio

I want to create a docstring for a Lua function in Roblox Studios so that when i look at that function that i instantly know what this function does. And currently the Popup looks like this: But the ...
Dennis Geisler's user avatar
0 votes
0 answers
98 views

DRY: don't repeat yourself in Lua

There is a way to not rewrite the same part (the cycle for i = 1...end) twice? local function myfunc(frame,method) if frame:IsShown() then for i = 1, #frame.buttons do frame....
user3204810's user avatar
0 votes
0 answers
45 views

How useful is it to make a global function fire a larger local function?

So, this is the thing. In my local script, i've got a global function which recognizes when the user is holding down a key and sets to true a boolean that fires a local function, which is VERY large. ...
Martin's user avatar
  • 9
0 votes
1 answer
54 views

How to save a function of an Object/table to a variable to be called from this variable in Lua?

I'm experimenting with Lua OOP (Object Oriented Programming) but I'm experiencing some issues. Here is a sample code with comments: Object = {string = "Default"} function Object:new() ...
skrovno_CZ's user avatar
0 votes
2 answers
295 views

Lua: Function to Change Value in Dictionary

I want to create a function to change a value in Dictionary. I came up with something really complicated. It works, but it also adds additional output I can't explain. boolValues = { firstBool=...
Joe's user avatar
  • 3
2 votes
1 answer
65 views

Is there a difference between global require and local require within a function

AFAIK, once the module has been loaded, lua caches the result into package.loaded[modName]. Does this statement hold true irrespective of where we are doing require "module"? Following ...
asn's user avatar
  • 2,539
3 votes
1 answer
50 views

Is there a way to tell the difference between a parameter in a function being omitted, and the parameter being passed being nil?

Let's say I have a function that returns a Boolean value, and I have a function that sets an override so that the first function always returns a specified Boolean. The second function looks something ...
Choosechee's user avatar
0 votes
0 answers
27 views

Collision doesn't work in love2d what to do?

The collision of river is not working, its just an if statement where i've written the coordinates of river when the frog collides with those coordinates it should change the state. When frog collides ...
Lizi's user avatar
  • 1
0 votes
1 answer
210 views

How to "pass around" function environments with local variables in Lua

Please consider the following snippet of code. -- file A.lua function A() local x = 1 local y = 2 if ... then --super hidden code that should not be seen x += 1 y +=...
oi mate's user avatar
3 votes
2 answers
429 views

What does `load` do with chunk as function in Lua

There is load function that compiles chunk if chunk is string. But i don't understand, what does it do with function. They said: If chunk is a function, load calls it repeatedly to get the chunk ...
DarkKill's user avatar
0 votes
1 answer
703 views

How to tell when a player has stopped touching a part (Roblox Studio)

With help from phloem I was able to make a region 3 script that detects when the player is inside it and it looks like this, while true do wait(1) local partsInregion = game.Workspace:...
Coder10101's user avatar
0 votes
0 answers
22 views

Breaking out of a function with :connect using an if condition

I'm trying to use a boolean variable enterFinished to break out of the of the function keypad once the enter.MouseClick:connect() is finished. function keypad(state) local enterFinished = false ...
Wild Alex's user avatar
1 vote
0 answers
100 views

Lua - Appending function properly

First I defined the AppendScript function local mt = { AppendScript = function(self, handler, method) local func = self:GetScript(handler) self:SetScript(handler, ...
user3713179's user avatar
0 votes
2 answers
702 views

Can anyone help me with my "GnomeCode" Script? The error message I get states the following:

18:13:51.541 Infinite yield possible on 'ReplicatedStorage.Events:WaitForChild("GetData")' - Studio 18:13:51.541 Stack Begin - Studio 18:13:51.541 Script 'ServerScriptService....
Underman17's user avatar

15 30 50 per page
1
2 3 4 5
29