#code-discussion
1 messages · Page 117 of 1
does anyone know a replacement for roblox pathfinding
you can create it yourself with raycast
what am i doing wrong can someone help? im trying to make a health bar
Why can't I commit script?
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local RPST = game.ReplicatedStorage
local effects = Character:WaitForChild("Effects")
local chakra = effects:WaitForChild("Chakra")
local chakraFLOW = effects:WaitForChild("ChakraFlow")
local remote = RPST:WaitForChild("ChakraCharge")
local DefaultFOV = 70
local cooldown = false
local charging = false
local function isPlayerOnFloor()
return Humanoid.FloorMaterial ~= Enum.Material.Air
end
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.G and isPlayerOnFloor() and not cooldown then
cooldown = true
task.delay(1, function() cooldown = false end)
print("Charging started")
local properties = {FieldOfView = DefaultFOV - 10}
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0.1)
local tween = game:GetService("TweenService"):Create(workspace.CurrentCamera, tweenInfo, properties)
tween:Play()
if chakraFLOW.Value == "Normal" then
local meshPart = RPST.Chakras["Chakra Charge"].MeshPart:Clone()
meshPart.CFrame = Character.HumanoidRootPart.CFrame
meshPart.Parent = Character.HumanoidRootPart
local weld = Instance.new("WeldConstraint")
weld.Part0 = Character.HumanoidRootPart
weld.Part1 = meshPart
weld.Parent = meshPart
local attachment = meshPart:FindFirstChildOfClass("Attachment")
if attachment then
local miniFlame = attachment:FindFirstChild("Mini Flame")
if miniFlame and miniFlame:IsA("ParticleEmitter") then
miniFlame.Enabled = false
task.wait()
miniFlame.Enabled = true
end
end
end
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://86695062653878"
local Charge = script:WaitForChild("Charge"):Clone()
Charge.Parent = Character.HumanoidRootPart
Charge.Looped = true
Charge:Play()
PlayAnim = Humanoid:LoadAnimation(animation)
PlayAnim:Play()
Character.HumanoidRootPart.Anchored = true
effects.ChargingChakra.Value = true
charging = true
while charging and chakra.Value < chakra.MaxValue do
wait(0.1)
remote:FireServer(Player)
end
end
end)
local function clearChakraEffects()
for _, v in pairs(Character.HumanoidRootPart:GetChildren()) do
if v:IsA("MeshPart") or v.Name == "Charge" then
v:Destroy()
end
end
end
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.G then
print("Charging ended")
local properties = {FieldOfView = DefaultFOV}
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0.1)
local tween = game:GetService("TweenService"):Create(workspace.CurrentCamera, tweenInfo, properties)
tween:Play()
clearChakraEffects()
local Charge = Character.HumanoidRootPart:FindFirstChild("Charge")
if Charge then
Charge:Stop()
Charge:Destroy()
end
if PlayAnim then
PlayAnim:Stop()
Character.HumanoidRootPart.Anchored = false
end
effects.ChargingChakra.Value = false
charging = false
end
end)
is there anything faster than math.random?
Cuz like heres my benchmark:
math.random: 0.0008714999999028805 seconds
fastrandom: 0.009100299999772687 seconds -- my custom lua random which is more simple than math.random
i dont think there is
math.random is written in C
even with all optimizations:
13:02:31.367 0.00805949999994482 - Client - LocalScript:31
If I weld the players legs to the floor would that remove the bumpiness
- why are you using playeradded when its a local script
- the humanoid is in the character, not the player
no
replicate movement on client
instead of ddoing everything on server
yeah like tween the cframe
help me make a good ball replication
weld the root part
to the elevator
why not?
just replicate everything on client
whats the point of having it welded
like bro you wont even be able to move
to remove bumpiness
BUMPINESS OCCURS BECAUSE THE LIFT SCRIPT IS ON SERVER
why would you be moving in a moving elevator
I KNOW.
chill
literally why would you weld rootpart
might be considered nsfw
i agree
🤖
to remoce rhe bumpiness 
each one has his own way of solving problems
just replicate movement on client 😭
waeawaeaewawewae
you don't have to force your method to us
why my method is better:
less bandwith, no bumpiness, no bugs that can occur due to welding rootpart
this why we have slop on the fromt page cause yall so lazy
using roblox' engine
god no
beginner tutorial ahh
if boolean == true then
💀
I didn't see this but what>
you mean uncopylocked right?...
yes
he prolly means decompilation 
Afr
tf is decompilation
google is your friend
idk what the meant, I searched it up got the meaning but dont understannd it
🐸
in context of roblox, it essentially means using exploits to read the script's bytecode and convert it into somewhat readable lua code
in other words, "stealing" scripts
usually done to bypass anti cheats and find vulns tho
does somebody knows about RenderJob in MicroProfiler ? It causes me a crazy lag spikes , can somebody help ?
aka = when you see systems from popular games in the toolbox
they use decompilation to the original game code and snatches it
and i mean the EXACT SAME SYSTEMS, not people doing similar things
and decompilation can also be used in making in-game exploits
I don't steal the scripts
I change the whole thing
with?
im confused asl
whars confusing yuo
watch tutorials or something 🙏
nobody uses hitbox part
I am returning to scripting again but I want to know how U like make items save and players not lose their progress cuz that was the reason I gave up last time
Like weapons and stuff not leaderboard
Datastore
Just save data
Ik I searched yt on how I do that to items and I get that videos that say go to my description and copy what I do like I want to learn not copy
Yea I will try that now , I was stupid last time
essenrially you want to store your items in some module where you can access their ids, names and models (and other info), then you want to store player inventory in datastore with id and quantity
I might be too dumb for coding cuz this took way to long to figure out
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage.TDEvent
local part = game.Workspace:WaitForChild("Door")
local Players = game:GetService("Players")
local character = Players.LocalPlayer
local team = game.Teams
part.Touched:Connect(function()
if character.Team == team.Headquarters then
part.CanCollide = false
print(part.CanCollide)
end
end)
``` 😭
part.Touched:Connect(function)
is the same as
Connect(part.Touched, function)
in my understanding so how would the script call connect? do i need to put it in a loop
Ohh I understand it
the if statement clearly isnt working as intended
How so, it's already getting that "hit.parent" and checks if it's a valid player before owning the place
- the issue was that he had the team with auto-assignable
then theres no point of adding the if statement
unless hit.Parent is nil
but that isnt op's intention
you call the function, you cant call Connect directly cause its a rbxsxriptsignal
theoretixally you could do RBXScriptSignal.Connect(part.Touched, function) but that would also not fire the function directly
yo
so they different?
i thought the colon just directly passed the function into connect
a
it does, so what are u trying to do
trying to understand events and lua
Connect(part.Touched, function)
if i put this in a script where part and function are defined
when would this run
in the script?
connect only has to run once
and then the event will trigger the function that you passed
so connect keeps running?
code inside will run when that said event happens
no
they run whenever theres a connection
you dont need a reference to it
but you should have one just in case (to disconnect it)
the reference is the connection
but if you dont store it in a variable
you dont have the reference
local connection = part.Touched:Connect(...)
connection is your reference
Watch Untitled - Copy by sarkozi_kevin and millions of other Roblox videos on Medal. Tags: Roblox, betabeatobbiestoflexrarities
There is this bug where if you are sitting and teleport, the seat will teleport with you. Is there any fix for this????
unsit
🥀 .ight
so what can i do with this connection
disconnect it
and then the event wont trigger your function anymore
Do i unsit from the client or from the server?
The seat teleports on the server-side.
i would say client
thanks for the help gurt
“run it at brindle” 👳♂️
didn't work.
local Char = Player.Character or Player.CharacterAdded:Wait()
local Humanoid : Humanoid = Char:FindFirstChild("Humanoid")
if Humanoid then
if Humanoid.SeatPart then
local Weld : Weld = Humanoid.SeatPart:FindFirstChild("SeatWeld")
if Weld then
Weld.Part1 = nil
end
end
Humanoid.Sit = false
end
here is the code i used
nvm it did work i'm just stupid
What seems to be a problem?
im using a remote event to change the collision of this part, is there a way for me to send this back to the client with the remote event?
remote function
a remotefunction sends a callback
try this
local Player = game.Players.LocalPlayer -- or however you get your Player reference
local Char = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Char:WaitForChild("Humanoid")
if Humanoid then
if Humanoid.SeatPart then
local Weld = Humanoid.SeatPart:FindFirstChild("SeatWeld")
if Weld then
Weld.Part1 = nil
end
end
Humanoid.Sit = false
end
I meant remote event
alr thanks chatgpt
you can Fire back
How could i i do a hit particls that alwatys going to appear in tree at the level of torso height
:FireClient()
i used visual studio code
ah got it
ty
does someone need help
.
i was following a tutorial and i was wondering what i did wrong since there's the red line under my rnd but not under hisw
local goal = {}
goal.Position = Vector3.new(10, 10, 0)
goal.Color = Color3.new(0, 1, 0)
i assume this is like a dictionary
good somebody got eyes thanks
its a table
its a mix of dictionary and list
what is this guy gonna accomplish following a tutorial
more than you doing nothing
?
hes following a tutorial on how to make a game
that won't help him at all
@winged silo
wait how
what tutorial should i do
who are you to dictate what kind of learning medium is going to help them
feel yourself real quick bro
bum*
tell me how efficient copying code is
For learning
you think watching a tutorial translates to copying code? reflects how intelligent u truly are
sometimes when you have no starting point, watching a tutorial is the most efficient thing to do as you get a quick start and can continue from there
local originalPosition = script.Parent.Position
local goal = {}
goal.Position = originalPosition + Vector3(0, 100, 0)
```what's wrong with this
Vector3.new
brother he straight up copied the code
how hard is it to understand
nice thanks
If he's copying the code and just writing it out without trying to understand it he won't learn anything
its how you construct a new Vector3, same as all roblox instances, such as Instance.new
whether he tries to understand it or not shouldnt be your concern tho, like deadass 💀
or can you read his mind
you can give him a crash course if you want
function playIfPlayer(object_touched)
local player = game.Players:GetPlayerFromCharacter(object_touched)
if player then
tween:Play()
end
end
part.Touched:Connect(playIfPlayer())
```is this not really expensive? my part is always in contact with something thats not a player
sorry lots of questions
whats the average walkspeed on humanoid when u sprint on roblox?
you can use object_touched.Parent to get the character
aight ty
its overlapping with something
what if the object touching isnt a player
my thing is a little bit bugged
I thought 60 was normal
oh for sprinting, its whatever you want
aight aight
you have to pass the funxtion itself, not call it
can confirm thats a bug
oops
Do I have to use a remote event to get the humanoid root part to weld to another part
not working, how should you check if a player touched cause this looks expensive and wrong
the way youre doing it is good
dont worry about performance
nice ty
if it works dont touch it
How come playing a certain animation causes a random fling whenever I apply vector velocity to the root? The animation doesn't animate the root or collides the character under the floor.
No
Autocorrect sorry
the way I have isnt working so im not sure
Its probably not a networking issue
F2.MouseClick:Connect(function(hit)
local root = hit:FindFirstChild("HumanoidRootPart")
local weld = Instance.new("Weld")
weld.Part0 = root
weld.Part1 = EV
if floor == 2 then return end
local goal = {CFrame = EV.CFrame - Vector3.new(0, -50,0)}
local tweenInfo = TweenInfo.new(
10, -- Time
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
2
)
local tween = TweenService:Create(EV, tweenInfo, goal)
tween:Play()
floor = 2
task.wait(10)
weld:Destroy()
end)
``` Any suggestions then
humanoid.Died:Connect(function()
Ragdoll.EnableRagdoll(character)
local killer = Players[player:GetAttribute("LastHit")]
player.Team = game.Teams.Lobby
print(killer.Name or killer)
killer:SetAttribute("Kills", (killer:GetAttribute("Kills") or 0) + 1)
AnalyticsService:LogOnboardingFunnelStepEvent(killer, 6, "Killed someone.")
GameBar:FireAllClients(`{player.Name} has died to {killer.Name}.`)
if #game.Teams.Blue:GetPlayers() == 0 then
print(#game.Teams.Blue:GetPlayers())
rtimer = 0
end
if #game.Teams.Red:GetPlayers() == 0 then
print(#game.Teams.Red:GetPlayers())
rtimer = 0
end
end)
whats wrong with this 😔 the kills dont get updated properly and no output
last hit is not nil, i checked
-
Your grabbing the killer from players that is wrong.
-
Luau does not support backticks or template strings
killer is the string because attributes cannot be instances. and the second one works just fine the issue was with the ragdoll module
Luau supports string interpolation
If that's what u mean
tween:Play()
will it wait till it finishes before it runs the next line
can someone make a class system for me (mine didn't work).
class system ????
u mean OOP
wdym "class system"
like a system where you can choose a class to get powers in a game
like dead rails
yeah aint no one making u that for free
ill do it
what classes
I'll show you the game because my classes are a bit different than usual
dm me
@soft burrow
can someone tell me the difference between
tool.activated
tool:activated
Do you mean Tool.Activated and Tool:Activate() ?
yes
Tool.Activated is a property which tells u if its activated
Tool:Activate() is a method that activates the tool
alright tysm
Np
can somone help me here cause in the other chat i aksed which totorial is good for learning scripting im just starting and i got told none
how am i gonna learn scripting then
I started learning scripting instantly from project tutorial (even though I didn't understand that much at first)
oh
then try adding extra things related to the project that tutorial doesn't have
i mean i already know some sutff
but my problem is i didnt learned for 2 whole weeks now and before everytime i try somthing i forget it
Brawldev is pretty good and his beginner series
anyone #code-help message
its like i want to learn all that stuff but then it takes to long to learn it and i brake up on it
Could someone please tell me why this isn't working i just started learning tools but this doesn't seem to check for me (localscript in starterpack)
I learned because i found it enjoyable to code things
maybe try adding extra content yourself to the thing that you are learning (try to make it global or use 1 script by the way)
You shouldnt learn luau just for the sake of learning it
i want learn it cause i like to create games but its so hard
Yes this is why you should tackle simpler things to code
Work your way up by adding maybe a new thing or two to that simple thing
Maybe try build game with your friend, it might be more interesting
local script 💀
i need those to even make a script
use server script
Yeah arent we supossed to use local scripts for starterpack?
somone got any idea i mean i dont know most of the basic stuff maybe i could try any easy script but idk what i should do
I personally think beginners shouldn't learn luau if its their first programming language since you learn most of the time from youtube, and me, I learn from it then forget it, this is why I think new programmers should learn from other programming languages where you have textbooks to guide you and exercises to get you used to the programming environment
the problem for me is i wantto learn all that stuff as fast as i can cause i really wanna make my dream game xd
Are you putting it just in starterpack or in the tool in starterpack
In the tool
This is bad
i know
Learn from small projects first
Dont rush it
You will miss out on the more important things that build up your foundation
but i dont even know which games i could try eather
cause im bored in other games the really stuff im on is horror games but there not easy at all
For me
I made a door system when i first learned luau
First i made it work first by making it open and close
why would u need textbooks for programming its all problem solving
oh
problem is i dont understand events
Math is problem solving, does that mean we dont need textbooks for math?
me who started learning from lua
what is the tool supposed to do?
Well uhhhh about that…
Is it worth it to learn how to script?
it is def ye
I search for information from many source in chrome
Thanks for the question am just trying to make a tool when you hold down a value becomes true
everything is working but the value doesnt become true in properties thats why am confused
Cuz I do modeling, and coding seems too hard to get into. I also feel like I'm too late
why too late
Most people who learn programming or in college for it, they have requried textbooks
There's also a lot of errors in coding
Boutta be a senior
learning and applying are two different thing tho
like reading how to cook vs cooking
i think it depends on a person's prefrence because i enjoy scripting way more than modeling on blender
you dont need me for this ngl but ill do it
i cant even learn from books
Well we were talking about the side of learning
Well i was
in my school time i never learned out of them i watched videos about everything
It can be fix
And won't it take me like a year before I can actually do something with it ?
these noob programmers don’t needa read they need to start using their brains to think of solutions to the problem
I learn from books a lot better, because a page is worth like a 10 min video
no you can learn in 1 day
You can get a lot from it if you learn how to read properly
learn from websites in chrome like devforum, google has ai feature now btw
👀...
try to comprehend it
like how do u expect to develop your own framework one day if all u do is reference textbooks
maybe try to put an if statement in there idk
u need problem solve
I never said to use textbooks to make your own framework?
learn by making projects
How'd y'all learn how to code
ye but theres the problem idk where to start?
I was purely talking about learning a programming language
hold on lemme check this out
If you want to learn how to code just make stuff
I literally just put effort and struggle into using the Roblox stuff to solve my problems
Not applying it
how long did yall learn to get good in coding?
so making stuff
If you want to learn how to code but dont have anything to code, why do you wanna learn it in the first place yk
ty i thought it was a visual glitch
I got to the point where I can basically make anything I want through not even having to think about it
train ur problem solving
Practice
if the local script is inside the starterpack then why the 1st line difine the tool as script.Parent?
i'm a lua beginner too but make a block that moves when you touch it then comes back after 5s
Easy problem think of how to solve it
local script is inside the tool i mean
uh ye and now i would stay at the script and dont even know how to start
tried it and it has check mark in property when activate
first figure out how to track the touch
that taught me events
is checker a "BoolVal"?
yeah
My brother does the scripting for me, and he's pretty good compared to other scripters. (He makes custom movement systems and physics things) But then I feel like if he decided to not help sometime in the future imma be cooked. I can model, also kinda animate and do it. But scripting seems like a very important missing piece
probably a visual glitch since output says its true
then how to move it which taught me vector3 and tweening
i think the part needs to detect the humanoid part and i need vector
i know why
then start with that
I dont know if this is related to you, but because you are changing the value with a local script, server script wont see the change
the scripts works fine, but your looking at the value on server, its a local script
no
hmm ill try to change it to a server script
alr that will take me the whole day but i wont get off before its working
Do the brawldev series on youtube and practice it to smaller projects
Right now is a really good time to learn it. There is a lot of tools available online for free
bro it works fine
Ohh okay i got it
try to look the value on Client
wanna voice chat? i do programing i can help u
btw i did some other languages before so idk how complex it is for someone new, if it's too hard try something else. i'm no expert
k
Also https://www.lua.org/pil/1.html this is a really helpful website, its not roblox's version of lua but it still works when it comes to logic and syntax loops operations etc etc
no you cant set to server script because of the .Activate:Connect()
Did you look your tool in your character in workspace yet?
Sorry i can't right now
i understood why now
How long did it take y'all to reach a place where u can say you're "good" at scripting
1 year
I also like how it goes in depth for functions
ty, looks good
i make my own modules now, i re write roblox functions and upgrade them
I'm cooked
oh yeah variables, classes and functions are important
what are classes?
i know functions and variables
Its like a wrapper?
a channel module, i can send and revice data from client server in 1 line of code, its like a bridge
OOP
thank you so much for everybody that helped me its working fine
nice
wait are events like attributes in oop
lets say you put this script on a part
local part_refrence = script.Parent
so this is a refence to a part object i think. sorry idk if i can explain well, im a beginner myself
oh ye alr now i know i just knew the german word cause im german
F2.MouseClick:Connect(function(hit)
local root = hit:FindFirstChild("HumanoidRootPart")
local weld = Instance.new("Weld")
weld.Part0 = root
weld.Part1 = EV
if floor == 2 then return end
local goal = {CFrame = EV.CFrame - Vector3.new(0, -50,0)}
local tweenInfo = TweenInfo.new(
10, -- Time
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
2
)
local tween = TweenService:Create(EV, tweenInfo, goal)
tween:Play()
floor = 2
task.wait(10)
weld:Destroy()
end)
``` Any ideas how to get this to work, I tried a local script but that wasn't working out
What is F2 variable
Click detector part
Are you making elevator?
you never parent the weld
There's no problem with tweening
you can use tween.Completed:Wait() instead of task.wait(10) by the way
definitely not lua language
bro what is wrong here
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local introCameraPart = workspace:FindFirstChild("IntroCamera")
local found = false
local totalWait = 0
local maxWait = 5 -- Only wait up to 5 seconds
if not introCameraPart then
local startTime = tick()
local connection
connection = workspace.ChildAdded:Connect(function(child)
if child.Name == "IntroCamera" then
introCameraPart = child
found = true
if connection then
connection:Disconnect()
connection = nil
end
end
end)
-- Wait up to maxWait seconds for the part to appear
while not introCameraPart and (tick() - startTime) < maxWait do
task.wait(0.1)
introCameraPart = workspace:FindFirstChild("IntroCamera")
if introCameraPart then
found = true
if connection then
connection:Disconnect()
connection = nil
end
break
end
end
if connection then
connection:Disconnect()
connection = nil
end
totalWait = math.floor((tick() - startTime) * 10 + 0.5) / 10
end
if introCameraPart then
if totalWait > 0 then
print("IntroCamera part found after waiting " .. totalWait .. " seconds.")
end
-- Save original camera settings
local originalCameraType = camera.CameraType
local originalCFrame = camera.CFrame
-- Move camera to IntroCamera part
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = introCameraPart.CFrame
-- Wait for a few seconds (e.g., 5 seconds for intro)
task.wait(5)
-- Restore camera control to player
camera.CameraType = Enum.CameraType.Custom
camera.CFrame = originalCFrame
else
warn("IntroCamera part not found in Workspace after " .. maxWait .. " seconds. Skipping intro camera sequence.")
end
jumpscare
gpt slop
too lazy to read lol
is "EV" defined?
elevator part I think
wdyfm you think? its not defined
Yeah it is
local Movingpart = script.Parent
local function touch()
print("true")
end
Movingpart.Touched:Connect(touch)
it tells me that it got touched ye but idk how to do the part so it moves when i touch it
read the code again, the (hit) isnt even used
Change the parts positon
use tween or lerp
ok so you got the function to run when the part is touched nice
skidies
hit isnt even needed
now find out how to make a part move
ye but it is supposed to happen when i touch it and it should come back after 5 seconds
then put it in a function
Save the position then move it
Or tween it
why is it called?
who cares hes not using it so why u complaining about it
make sure you understand all of it btw when i tried to start like 5 years ago i didn't understand any of it and was just copying code
Yes it is it's used to find the Humanoidrootpart
it works anyways
alr ye i wont copy
snake_case in luau 💔
the only problem here is that if i touch the part it says like 10 times touch and if i move o nthe part it gets up to 50 times touched or 100
use boolvalue
then make sure the toucher is a character
debounce thing
debounce 🔥
and add a debounce ye
btw is debounce a real thing or just a random var name
Random var nane
hush up and lua is mid
Can be anything really
Local hshshshsh = false
If hshshshshsh == true then return end
Hahshshshsh =true
End
ye, you just need to not forget what that variable does
"Local"? "End"? 🤔
local part = script.Parent
local lastTouch = os.clock()
part.Touched:Connect(function(hit)
if os.clock() - lastTouch < 0.5 then return end
lastTouch = os.clock()
end)
luau*
Luau 
snake_case for vars camelCase for functions
snake_case for constants, PascalCase for service and functions, camelCase for variables and anything else
I normally use
local isClicked = false
brahbrah.brahbrahTouched:Connect(function()
if isClicked = false then
isClicked = true
brah brah ....
isClicked = false
end
end)
worst way
just add a 0.1 to 0.5 second cooldown
i do this too ngl
I like returning an if statement to end if I don't need to use it later
camelcase 🤢
I mean it's already in brah brah . . .
thats false, where is the acuacly debounce? a task.wait()
what do u use
While task.wait(0.1) do
end
???
💔
might as well use IllIlIIIlIlll for variable name instead
close roblox studio
pascal and capital snake case
task.wait() already in that brah brah . . .
bro thats ugly ash
no
yes
u just cant handle the fact that its superior 😮💨
While true do
wait(0.1)
break
end
this discussion again?
What are you not Doug
there is no discussion, only facts
if that was the case you would be using camelCase
says the one who uses upper case snake_case 💔
why is that a thing
its the best
i use local debounce = false local part = workspace.Part Part.Touched:Connect(function(hit) if debounce == false then debounce = true --THE CODE HERE task.wait(5) debounce = false end end
that is so weird
bro it ugly asf get ur eyes fixed
camelcase is skidding
💔
pretty sure it is how it's done in lua documentation??
yes
look at every luau documentation
so lua is skidding then
there is a page dedicated to this topic
im not talking to yall anymore i cant ruin my reputation by being seen conversing with inferior life forms
u use Snake_case wtf u on about
i think the only justified place to use PascalCase is for instance names since you already name them like that in workspace and stuff
@static coral
easiest to read
i guess services too yeah
forgot about that
assuming that is what they meant by roblox api
the same people tell you to nest if statements and use m*tatables, if they tell you to jump into the fire will you do it?
it is on official luau docs
i trust the api ref more then u yes
metatables are useful asf
link it
lemme find it rq
little bit of nesting is okay
yeah
avoid it if you can
so true my friend
ok then who are we arguing with
"aint no party like a diddy party"
snake_case is default lua naming convention i think
what
^^
cba to search for it rn just look through https://luau.org
its either on there or on docs
bro sent me the bible and said "find it"
i cant remember where its at
so u cant prove ur point crazy
if u want it so bad then look for it i cant remember where it is
Is 65 wpm good speed?
normal typing with some capital letters and fullstop but not with some special char like { } [ ] # &
i think its fine
not really
i mean
average is 40 wpm apparently
nah in lua docs it just uses flatcase
we are doing luau
guys whats the point of while loops when u can just use RunService.Heartbeat
this is flatcase?
if u want yielding
whats the point of programming if u can just live a normal happy life
RunService.HeartBeat do frame by frame of physic being rendered, idk for very specific tho
u cant have happy life without coding
arent while loops more consistently timed
hmmm
no quite the contrary
you need to use task.delay and recursion for most accurate timing
ig it uses both but im not suprised if theres some snake_case since lua is written in c
while true do end without wait() or task.wait() can crash the game
Yeah for example ive seen people implement lua in their custom game engines and they use snake_case
makes sense with the association with C
yeah
ok but obviously we are using luau, fork of lua?
local function loop()
task.delay(1, loop)
--code
end
true but i guess this could repeat before it finishes
the current calculation or whatever
the code
stack overflow moment
you will obviously need code to break the loop or to cancel the thread otherwise its gonna go on forever, but as it is here it wont have any effect on your game
what
well no cause of 1 second delay
given an infinite amount of time
what if the code takes longer than 1 second to complete?
now you got a problem
then dont use this method? or reconsider what you are doing
reminds me of those videos where people afk in random games for real life weeks until random counters overflow and break the whole game in cool ways
you would not use this with api calls for example
ik i was just saying
idk
guys i want start watch dev king scripting totorials cause i just dont know what im doin in roblox studio is it worth it? i just heard good things about the totorials buti dk
there not very long per video
dont
thedevking is ass
use brawldev and docs
and practice and experiment
and learn some computer architecture
I use dev forum
devforum only for very specific things really
lowkey just make random stuff
why that?
you will better understand the data types and general concepts about code
it will help you with learning any programming language
this is all crazy stuff next month im starting to work and iwanna learn scripting now im gonna be dead fr
roblox scripting is not that hard
i was heartbroken when i realized that dictionaries were just hashed arrays under the hood
compared to other languages
i only want script in roblox tho
´my finish line is to make the most realistic roblox horror game
like those crazy horror games out of roblox but in roblox
@obsidian ember this is true right?
I think so yeah
if you make a table with strings it will appear in a random order
its prob based on the hash
its alphabetical order
just make lists fr
its not
wait is table.find or just using a string key faster then
having the key would be faster
i dont remember the exact access cost on top of my mind but but using the key has a slightly higher but fixed cost
what would be the value then, assuming the dictionary is for checking something exists
while table.find() scales depending on the dict size
those are the right totorials?
table.find doesnt work on dicts
i was talking about using table.find on an array
yes
alr
just benchmark it lol
eh what why is the third totorial data types arent data types hard?
local items = {"a", "b", "c"}
-- or
local items = {a = true, b = true, c = true, d = nil}
no
not that hard
depending on your mental capacity
something like int value, string value , float value , . . . I guess
hmm alr i mean good thing is i can start with it right up i already watched totorials about the first 2 also about the fourth but idk data types
so ye
also practice after watching the video
and dont just copy the code
i wont
otherwise you are practicing to fail
I don't recall how to replicate it
it took me an embarrassing amount of time to understand what module scripts are for
????
ye but i mean on the first totorials theres not much to practise the first totorials i watched on an other youtuber i had to write somthing with the printing
Its based on order of insertion, not alphabetically
what u talking about bro read the output
it rearranged the dict alphabetically
i dont think it is how it works
because there could be clashing hashes
bro? 😂
everytme i join new place the output is completly orange
what is this all bruh
Its from your plugins
how to uninstall the plugin?
Go to plugins tab and open manage pluugins
you dont need to uninstall
just disable it
Go to plugins tab and open manage pluugins
i was following a tutorial but i dont understand why its saying in output no units availalbe for chosen rarity uncommon because i have a uncommon rarity. somebody help pls
yeah
oh i see tysm
seems to be alphabetically
the string is literally the same except the first letter
what do you want me to do here
idk how they handle hashing
omfg
im not an expert either
😭
What are you both fighting about 💀
absolutely nothing
the facts that dictionaries are rearranged alphabetically by roblox
this conversation sucks
you are no expert and you are also wrong so why do u keep on arguing
this is probably tru
the # is to get amount of thing in table from table
like
print(#workspace:GetChildren())
no
then why are you???
you are so insecure you said "lil bro"
because i am right
what is even the point of arguing here
That is such a dumb argument 😭
gang i js proved it 3 times 💔
the key is turned into a hash and the hash comes first in order. so to us it appears to be in alphabetical order
that ignores colliding hashes
keys with characters outside the alphabet will also work
well we dont know how the hashing works 🥀
Exactly
im going to end my questioning here since i dont know what hashing method lua uses and it could be just sorting the strings alphabetically while looping
or iterating
So our dictionaries arranged alphabetically or not? U dont know 😭
yes
Once u guys figure out the hashing u guys will get the answer to this argument
im good, that is way too much effort for this useless conversation
Yeah
good to know
Um
😝
so you are just intentionally immature then
😂
also good to know
so i am immature when i have proven you wrong 4 times
u cant accept u are wrong
????
maybe you should do gardening instead of scripting
yes
they cross compatible dict is array and array is dict but its not good practice
I had issues with it where robloxs table serialization turned my array into a dictionary and i had to scratch my head for a long time
you can make an array type and call it a day lol
no
gg's
what bot u tryna make
no I just have an issue with fetching some stuff
I am trying to get it to send picture of peoples roblox profile
like their avatar
in the message
but no matter what I have changed in the logic it is not working lol
ok nvm i solved it
it seems to be only ordered when you print
in ascii order
so in conclusion, you are just mean
when i send tables through webhook it appears in random order
wait
json encode the table and see
no
i did next() as well and it returned the first element that it printed
scroll up
you can test with a for loop as well
did
a
d
c
b
does that look alphabetic to you
"oh but you do not admit you are wrong"
seems to still be alphabetical
if it looks like a duck and quacks like a duck
its prob a duck
?????
adcb?
nvm now im becoming insane
i wouldnt want to become like @static coral after all
that thinks a civil argument about dictionaries is competitive
yeah not the Snake_case user 💔
💀
wait
it sorts it in ascii order when printed it seems
i dont think pairs or generalized iteration has any order
also do you guys did you notice the lack of response from @static coral ?
prints in order but doesnt iterate in order
first thing i did pretty much
hold on im testing
why dont use just do table[1] = "a"
and then use a for i = loop
i tested with strings first
was quicker to just replace the contents of the string
how do you get a random ascii character
my point is the json output order is random
is there any built in thing for that in luau
or roblox, idk if there is a difference
oh whats wrong with that 💔
string.char(math.random(65, ???))
255 i think
thanks
well depends what symbols u want
change leaderboard on client or server
server
^^
I sent tables through a discord webhook and it arrives in a random order
its nothing wrong it just
looks weird and is hard to read
Thought I was tripping
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChangeStat = ReplicatedStorage:WaitForChild("ChangeStat")
button.MouseButton1Down:Connect(function()
ChangeStat:FireServer("Class", "Flash")
end)
```is this fine? player is auto passed right
terrible
Code discussion
yes player is automatically "passed"
ngl i dont think even roblox knows anymore
ok then why be mean
lowkey not worth the effort to figure out
why u telling the server to change a stat just do it fully on the server
dont you find it embarrassing
I feel like if it was actually ordered
huh
this sends the event to do it on the server
they wouldnt say that iteration order cant be trusted
what does it do
?
on the server
there is a high chance when print is called on a table it sorts the values
or when being looped through
i think these are both metamethods you can use yourself
where was i mean
no string interpolation in 2025 💔
local function changeStat(player, statName, new_value)
local leaderstats = player:FindFirstChild("leaderstats")
if not leaderstats then return end
local stat = leaderstats:FindFirstChild(statName)
if not stat then return end
stat.Value = new_value
print(player.Name .. " changed " .. statName .. " to " .. new_value)
end
💀
what
its only 2 values
1 way ticket to inf money cheats
exploiter wet dream
string interpolation gonna look ugly
are you intentionally ignorant now
how i fix
r u really offended by ts
i said change stat fully on the server no signals
?
yeah
store the value on the server
how would the server know when a button is pressed
my question still stands
u send the signal but store the value it goes up by on the server
dont send the value via the signal
ok i apologize
so make different signals for each different class
yes
if that works best for u
without passing the value
it's ok but just do not act like this on a subject that is not certain yet
cause rn a exploiter can just do ChangeStat:FireServer("Class", "Flash", math.huge)
and get inf currency
i could still be wrong but honestly i dont know how it works still
probably unordered
what would this third input do
huh??
alr
i just tested it and its unpredictable in the screenshot
one sec
makes the number infinite
my func does not take a third input though
interesting
its not infinite just very large
yeah but
i guess it says inf because every other integer is either equal or smaller
dont make a ChangeStat remote
right?
where should i put it then
just make the remote specific to what ur doing
yeah which is changing the class
whatever i looked at ur code it should be fine
its not a currency
my bad
wait can they do
ChangeStat:FireServer("money", million dollar)
yes
always store values on the server
dont put into remote
how can i prevent
^^
yeah cus of exploiters
ooh you saved me
Keeping your Game Secure Hmm what does that mean? Keeping your Game Secure (KGS) means protecting your remote calls, proximity prompts, preventing backdoors, etc. This guide/tutorial will teach you the basics of server-side protection for your remote events. Preface You have probably heard the saying from experienced developers, “never trus...
and stuff
this is good example from the devforum post
-- Server
local reEvent: RemoteEvent = some.path.to.event
local itemPrices: {...any} = {...}
reEvent.OnServerEvent:Connect(function(player: Player, itemName: string)
local itemCost: number = itemPrices[itemName]
local playerMoney = -- Code to get the player's money
if playerMoney >= itemCost then
-- Code to purchase // Give the item
else
-- Do nothing here, or tell the player they don't have the money.
end
end)
u see they are storing the prices on the server
wouldnt this make more sense as a remote function, maybe to communicate that it was successful?
so what is clientsided that i need to watch out for
lets say i make an enemy give money when killed is that client sided?
depends on how you handle it
well yes
but dont pass the money amount
in the signal
also have magnitude checks
on the server
im confused now
wait so you cant stop it
make seperate events for each death i get?
u cant stop exploiters from firing a remote no
u just need good serverside protection
can you do deaths on server side
yeah
any information you receive from the client should prolly assume has been tampered with
exactly ^^
so how would i do deaths server sided
Does anyone know how steal a brainrot would like try to repel cheaters
like im wondering how they would even go about not letting hackers steal something and instantly teleport to their base to claim it
Hi can anyone tell me why my debounce isnt working
you shouldnt do spawn() because it is already a built in function
for another purpose
it could be working right now since you reassigned it but i don't think it is good practice
also what is the exact problem?
When i touch it sometimes more than 1 limb touch it and i gain multiple points
might be because you debounce outside of the if statement
what i meant was the
if humanoid and debounce == false then
-- your code
end
debounce = false
i think that would do nothing because it will run it enable it again anyways when another limb touches it
you should add a cooldown then
A cool down to the cooldown?
if humanoid and debounce == false then
-- your code
task.wait(1)
debounce = false
end
TS is so bad
Not in a rude way but
nobody asked
they are making multiple coins
So the touch function runs multiple times
every second
Then use a coroutine
what?
sorry am new to scripting its like my first week but ill get better eventually
did you even read the code?
he's right, this is detrimental
It's good
i can explain the issue rq
