#code-discussion

1 messages · Page 117 of 1

weak radish
#

no you pay 30$

steel arrow
#

does anyone know a replacement for roblox pathfinding

somber vault
stuck egret
#

what am i doing wrong can someone help? im trying to make a health bar

velvet light
#

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)

glossy swan
#

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

charred night
#

are we fr

#

optimizinf math.random

#

did you try to store the func in a variable

glossy swan
#

imagine

glossy swan
#

im also caching shit

crude quarry
charred night
charred night
#

yeah like tween the cframe

charred night
somber vault
#

to the elevator

glossy swan
#

NO

somber vault
#

why not?

glossy swan
#

just replicate everything on client

#

whats the point of having it welded

#

like bro you wont even be able to move

somber vault
#

to remove bumpiness

glossy swan
#

BUMPINESS OCCURS BECAUSE THE LIFT SCRIPT IS ON SERVER

somber vault
#

why would you be moving in a moving elevator

lean ocean
#

chill

glossy swan
#

literally why would you weld rootpart

lean ocean
#

might be considered nsfw

somber vault
lean ocean
#

🤖

charred night
somber vault
#

each one has his own way of solving problems

glossy swan
#

waeawaeaewawewae

somber vault
#

you don't have to force your method to us

glossy swan
#

why my method is better:
less bandwith, no bumpiness, no bugs that can occur due to welding rootpart

charred night
#

nah deadass welding it is stupid

#

just tween the rootpart with the elevator 🐸

charred night
#

this why we have slop on the fromt page cause yall so lazy

#

using roblox' engine

#

god no

wind spindle
#

I didn't see this but what>

somber vault
#

you mean uncopylocked right?...

wind spindle
charred night
#

he prolly means decompilation fr

sudden estuary
wind spindle
#

tf is decompilation

charred night
wind spindle
#

idk what the meant, I searched it up got the meaning but dont understannd it

charred night
#

🐸

#

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

gray parrot
#

does somebody knows about RenderJob in MicroProfiler ? It causes me a crazy lag spikes , can somebody help ?

somber vault
#

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

wind spindle
chilly timber
#

can someone help me rq

#

pls

wind spindle
#

I change the whole thing

wind spindle
chilly timber
#

so I have an animation

#

and I want to know how I can put it into my code

spark estuary
chilly timber
spark estuary
#

whars confusing yuo

chilly timber
#

idk

#

Im dumb

spark estuary
#

watch tutorials or something 🙏

slender sky
#

guys

#

should i use GetPartBoundsInBox or a Hitbox part?

charred night
#

nobody uses hitbox part

stuck iron
#

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

somber vault
#

Just save data

stuck iron
# charred night Datastore

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

charred night
#

then read the do s

#

docs

stuck iron
#

Yea I will try that now , I was stupid last time

charred night
crude quarry
#
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)
``` 😭
soft burrow
#
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

somber vault
#

the if statement clearly isnt working as intended

somber vault
#
  • 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

charred night
soft burrow
#

so they different?

#

i thought the colon just directly passed the function into connect

raven marsh
#

a

charred night
raven marsh
#

i

#

an

#

bored

soft burrow
charred night
#

you said how would the script call connect

#

which makes 0 sense

soft burrow
#

Connect(part.Touched, function)

#

if i put this in a script where part and function are defined

#

when would this run

charred night
#

in the script?

#

connect only has to run once

#

and then the event will trigger the function that you passed

soft burrow
#

so connect keeps running?

charred night
#

no

#

connect only runs once and creates a connection

lean ocean
#

code inside will run when that said event happens

soft burrow
#

oh nice

#

and events are only tracked if theres a reference to them

charred night
#

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)

soft burrow
#

i thought the reference was the connection

#

so how would i refrence it normally

charred night
#

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

vast hornet
#

There is this bug where if you are sitting and teleport, the seat will teleport with you. Is there any fix for this????

charred night
#

unsit

vast hornet
#

🥀 .ight

soft burrow
charred night
#

and then the event wont trigger your function anymore

vast hornet
#

The seat teleports on the server-side.

charred night
#

i would say client

soft burrow
#

thanks for the help gurt

raven marsh
#

“run it at brindle” 👳‍♂️

vast hornet
#
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

vagrant saddle
#

What seems to be a problem?

south iron
#

who needs help

#

?

crude quarry
#

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?

stone garden
#

a remotefunction sends a callback

south iron
# vast hornet

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

crude quarry
stone garden
gleaming badger
#

How could i i do a hit particls that alwatys going to appear in tree at the level of torso height

lean ocean
raven marsh
south iron
#

i used visual studio code

crude quarry
south iron
crude quarry
south iron
#

does someone need help

sly plover
#

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

charred night
#

theres no = sign

#

open your eyes...

soft burrow
#
local goal = {}
goal.Position = Vector3.new(10, 10, 0)
goal.Color = Color3.new(0, 1, 0)

i assume this is like a dictionary

sly plover
charred night
#

its a mix of dictionary and list

lean ocean
#

what is this guy gonna accomplish following a tutorial

charred night
#

more than you doing nothing

lean ocean
#

hes following a tutorial on how to make a game

#

that won't help him at all

analog pollen
#

@winged silo

soft burrow
soft burrow
charred night
#

feel yourself real quick bro

#

bum*

lean ocean
#

For learning

charred night
#

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

soft burrow
#
local originalPosition = script.Parent.Position
local goal = {}
goal.Position = originalPosition + Vector3(0, 100, 0)
```what's wrong with this
lean ocean
#

how hard is it to understand

soft burrow
lean ocean
#

If he's copying the code and just writing it out without trying to understand it he won't learn anything

soft burrow
#

why do i need the new

#

yay it works

charred night
charred night
#

or can you read his mind

lean ocean
#

I mean you spoonfed him the answer

#

😂

charred night
#

you can give him a crash course if you want

soft burrow
#
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

sick flower
#

whats the average walkspeed on humanoid when u sprint on roblox?

crude quarry
sick flower
#

aight ty

soft burrow
#

what if the object touching isnt a player

south iron
sick flower
crude quarry
sick flower
#

aight aight

charred night
crude quarry
soft burrow
#

oops

crude quarry
#

Do I have to use a remote event to get the humanoid root part to weld to another part

soft burrow
charred night
#

dont worry about performance

soft burrow
#

nice ty

south iron
crude quarry
formal crescent
#

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.

crude quarry
#

the way I have isnt working so im not sure

somber vault
#

Its probably not a networking issue

crude quarry
#

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
thorn frigate
#
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

small palm
thorn frigate
lean ocean
#

If that's what u mean

soft burrow
#

tween:Play()
will it wait till it finishes before it runs the next line

lean ocean
#

no

#

It will instantly go next line

glass maple
#

can someone make a class system for me (mine didn't work).

hallow crag
#

u mean OOP

glass maple
#

what's an OOP?

#

@hallow crag

hallow crag
#

wdym "class system"

glass maple
#

like dead rails

hallow crag
#

yeah aint no one making u that for free

glass maple
#

I can make a theme song for a game

#

it's good enough

soft burrow
#

what classes

glass maple
#

dm me

#

@soft burrow

empty rapids
#

can someone tell me the difference between

tool.activated
tool:activated

copper apex
empty rapids
#

yes

copper apex
#

Tool.Activated is a property which tells u if its activated

#

Tool:Activate() is a method that activates the tool

empty rapids
#

alright tysm

copper apex
#

Np

brittle vector
#

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

scenic lotus
#

I started learning scripting instantly from project tutorial (even though I didn't understand that much at first)

scenic lotus
#

then try adding extra things related to the project that tutorial doesn't have

brittle vector
#

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

copper apex
#

Brawldev is pretty good and his beginner series

static coral
brittle vector
#

its like i want to learn all that stuff but then it takes to long to learn it and i brake up on it

empty rapids
#

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)

copper apex
scenic lotus
#

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)

copper apex
#

You shouldnt learn luau just for the sake of learning it

brittle vector
copper apex
#

Work your way up by adding maybe a new thing or two to that simple thing

scenic lotus
#

Maybe try build game with your friend, it might be more interesting

brittle vector
#

ye but im trying to understand the basics rn

#

like loops/ tables lists and stuff

brittle vector
#

i need those to even make a script

empty rapids
empty rapids
#

still doesn't seem to work

brittle vector
#

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

copper apex
#

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

brittle vector
#

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

scenic lotus
brittle vector
#

i know

copper apex
#

Learn from small projects first

#

Dont rush it

#

You will miss out on the more important things that build up your foundation

brittle vector
#

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

copper apex
#

For me

#

I made a door system when i first learned luau

#

First i made it work first by making it open and close

dark juniper
brittle vector
#

oh

brittle vector
copper apex
scenic lotus
brittle vector
copper apex
#

Engineers uses textbooks

#

Programmers also use textbooks

dark juniper
astral swift
#

Is it worth it to learn how to script?

brittle vector
scenic lotus
#

I search for information from many source in chrome

empty rapids
astral swift
#

Cuz I do modeling, and coding seems too hard to get into. I also feel like I'm too late

copper apex
astral swift
astral swift
dark juniper
#

like reading how to cook vs cooking

empty rapids
soft burrow
brittle vector
#

i cant even learn from books

copper apex
#

Well i was

brittle vector
#

in my school time i never learned out of them i watched videos about everything

scenic lotus
astral swift
#

And won't it take me like a year before I can actually do something with it ?

dark juniper
#

these noob programmers don’t needa read they need to start using their brains to think of solutions to the problem

copper apex
soft burrow
copper apex
#

You can get a lot from it if you learn how to read properly

scenic lotus
astral swift
scenic lotus
#

try to comprehend it

dark juniper
#

like how do u expect to develop your own framework one day if all u do is reference textbooks

brittle vector
dark juniper
#

u need problem solve

copper apex
soft burrow
astral swift
#

How'd y'all learn how to code

brittle vector
copper apex
#

I was purely talking about learning a programming language

scenic lotus
obsidian ember
#

If you want to learn how to code just make stuff

dark juniper
copper apex
#

Not applying it

brittle vector
#

how long did yall learn to get good in coding?

dark juniper
#

so making stuff

obsidian ember
#

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

empty rapids
dark juniper
#

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

copper apex
stone garden
soft burrow
dark juniper
empty rapids
brittle vector
scenic lotus
soft burrow
#

that taught me events

empty rapids
astral swift
empty rapids
soft burrow
#

then how to move it which taught me vector3 and tweening

brittle vector
stone garden
obsidian ember
stone garden
# empty rapids

the scripts works fine, but your looking at the value on server, its a local script

empty rapids
#

hmm ill try to change it to a server script

brittle vector
copper apex
obsidian ember
stone garden
empty rapids
stone garden
stone garden
soft burrow
copper apex
#

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

stone garden
scenic lotus
empty rapids
empty rapids
astral swift
#

How long did it take y'all to reach a place where u can say you're "good" at scripting

copper apex
stone garden
astral swift
soft burrow
brittle vector
#

i know functions and variables

stone garden
copper apex
empty rapids
#

thank you so much for everybody that helped me its working fine

soft burrow
#

wait are events like attributes in oop

soft burrow
# brittle vector what are classes?

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

brittle vector
crude quarry
#

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
scenic lotus
#

What is F2 variable

crude quarry
#

Click detector part

scenic lotus
#

Are you making elevator?

crude quarry
#

Yes

#

Trying to weld the player so it's alot smoother

granite igloo
scenic lotus
scenic lotus
#

definitely not lua language

static coral
#

Arab++

#

Arab#

south iron
#

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

static coral
#

jumpscare

scenic lotus
#

too lazy to read lol

scenic lotus
stone garden
crude quarry
hallow crag
#

dumbass

brittle vector
brittle vector
stone garden
soft burrow
stone garden
#

skidies

hallow crag
soft burrow
#

now find out how to make a part move

brittle vector
soft burrow
#

then put it in a function

crude quarry
#

Or tween it

stone garden
hallow crag
soft burrow
crude quarry
scenic lotus
#

it works anyways

brittle vector
granite igloo
scenic lotus
#

debounce thing

granite igloo
#

and add a debounce ye

soft burrow
#

btw is debounce a real thing or just a random var name

crude quarry
#

Random var nane

soft burrow
crude quarry
#

Can be anything really

#

Local hshshshsh = false
If hshshshshsh == true then return end
Hahshshshsh =true
End

scenic lotus
#

ye, you just need to not forget what that variable does

hallow crag
crude quarry
#

Mobiles not made for lua coding

hallow crag
crude quarry
soft burrow
hallow crag
scenic lotus
#

I normally use
local isClicked = false

brahbrah.brahbrahTouched:Connect(function()
if isClicked = false then
isClicked = true
brah brah ....
isClicked = false
end
end)

hallow crag
#

just add a 0.1 to 0.5 second cooldown

crude quarry
#

I like returning an if statement to end if I don't need to use it later

scenic lotus
hallow crag
#

💔

stone garden
static coral
#

camelcase ugly af

hallow crag
crude quarry
stone garden
hallow crag
static coral
#

might as well use IllIlIIIlIlll for variable name instead

stone garden
static coral
scenic lotus
hallow crag
static coral
hallow crag
#

yes

static coral
#

u just cant handle the fact that its superior 😮‍💨

hallow crag
#

Snake_case 💔

#

wtf

crude quarry
hallow crag
#

thats not a cooldown

teal quiver
crude quarry
#

What are you not Doug

static coral
teal quiver
hallow crag
teal quiver
static coral
stone garden
teal quiver
#

that is so weird

hallow crag
static coral
#

camelcase is skidding

hallow crag
teal quiver
obsidian ember
#

yes

hallow crag
#

look at every luau documentation

teal quiver
#

so lua is skidding then

obsidian ember
#

there is a page dedicated to this topic

static coral
#

im not talking to yall anymore i cant ruin my reputation by being seen conversing with inferior life forms

obsidian ember
#

"how to name variables" 101

hallow crag
teal quiver
#

i think the only justified place to use PascalCase is for instance names since you already name them like that in workspace and stuff

obsidian ember
hallow crag
soft burrow
teal quiver
#

forgot about that

#

assuming that is what they meant by roblox api

static coral
obsidian ember
#

yes

#

no one said nest if statements

#

nesting is ugly and bad

static coral
hallow crag
obsidian ember
#

metatables are useful asf

obsidian ember
static coral
#

lemme find it rq

teal quiver
#

little bit of nesting is okay

obsidian ember
#

yeah

teal quiver
#

avoid it if you can

static coral
#

if you dont need to nest

#

then dont nest

#

u aint a bird

obsidian ember
#

so true my friend

teal quiver
#

ok then who are we arguing with

somber vault
#

its just programmig

#

listen to lebron

obsidian ember
hallow crag
#

💔

obsidian ember
#

snake_case is default lua naming convention i think

teal quiver
#

what

hallow crag
static coral
#

its either on there or on docs

obsidian ember
#

bro sent me the bible and said "find it"

static coral
#

i cant remember where its at

hallow crag
static coral
obsidian ember
#

lua its snake_case

scenic lotus
#

Is 65 wpm good speed?
normal typing with some capital letters and fullstop but not with some special char like { } [ ] # &

static coral
#

i think its fine

lean ocean
#

i mean

#

average is 40 wpm apparently

hallow crag
teal quiver
#

we are doing luau

sour vine
#

guys whats the point of while loops when u can just use RunService.Heartbeat

obsidian ember
static coral
scenic lotus
#

RunService.HeartBeat do frame by frame of physic being rendered, idk for very specific tho

hallow crag
sour vine
teal quiver
obsidian ember
#

hmmm

static coral
#

you need to use task.delay and recursion for most accurate timing

hallow crag
# obsidian ember hmmm

ig it uses both but im not suprised if theres some snake_case since lua is written in c

scenic lotus
#

while true do end without wait() or task.wait() can crash the game

obsidian ember
#

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

hallow crag
teal quiver
#

ok but obviously we are using luau, fork of lua?

static coral
teal quiver
#

the current calculation or whatever

#

the code

obsidian ember
static coral
# obsidian ember 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

hallow crag
obsidian ember
#

given an infinite amount of time

teal quiver
#

now you got a problem

static coral
obsidian ember
#

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

static coral
#

you would not use this with api calls for example

teal quiver
#

idk

brittle vector
#

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

static coral
#

thedevking is ass

#

use brawldev and docs

#

and practice and experiment

#

and learn some computer architecture

scenic lotus
#

I use dev forum

static coral
#

devforum only for very specific things really

brittle vector
#

so much stuff bruh maybe i just keep building

#

fr

obsidian ember
#

lowkey just make random stuff

brittle vector
static coral
#

it will help you with learning any programming language

brittle vector
static coral
#

roblox scripting is not that hard

teal quiver
static coral
#

compared to other languages

brittle vector
#

´my finish line is to make the most realistic roblox horror game

#

like those crazy horror games out of roblox but in roblox

teal quiver
brittle vector
#

i almost have the building skills for it

#

now i just got to learn scripting

obsidian ember
#

if you make a table with strings it will appear in a random order

#

its prob based on the hash

static coral
brittle vector
obsidian ember
teal quiver
obsidian ember
#

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

teal quiver
static coral
obsidian ember
#

while table.find() scales depending on the dict size

brittle vector
static coral
teal quiver
static coral
brittle vector
obsidian ember
#

just benchmark it lol

brittle vector
teal quiver
#
local items = {"a", "b", "c"}
-- or
local items = {a = true, b = true, c = true, d = nil}
static coral
#

not that hard

#

depending on your mental capacity

scenic lotus
brittle vector
# static coral no

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

static coral
#

and dont just copy the code

brittle vector
#

i wont

static coral
#

otherwise you are practicing to fail

obsidian ember
teal quiver
#

it took me an embarrassing amount of time to understand what module scripts are for

static coral
brittle vector
obsidian ember
#

Its based on order of insertion, not alphabetically

static coral
#

it rearranged the dict alphabetically

teal quiver
#

because there could be clashing hashes

static coral
teal quiver
#

your example is too small in my opinion

#

to prove your point

static coral
brittle vector
#

everytme i join new place the output is completly orange

teal quiver
#

wdym

brittle vector
#

what is this all bruh

copper apex
brittle vector
copper apex
#

Go to plugins tab and open manage pluugins

teal quiver
#

just disable it

brittle vector
#

i dont make cutscenes

#

how?

copper apex
#

Go to plugins tab and open manage pluugins

static coral
sly plover
#

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

obsidian ember
teal quiver
#

idk how lua's hashing works

brittle vector
static coral
obsidian ember
#

seems to be alphabetically

teal quiver
#

what do you want me to do here

#

idk how they handle hashing

static coral
#

omfg

teal quiver
#

im not an expert either

copper apex
#

😭

static coral
#

what more do u want me to do to prove it to u

#

lil bro

copper apex
#

What are you both fighting about 💀

teal quiver
static coral
teal quiver
#

this conversation sucks

static coral
obsidian ember
scenic lotus
#

the # is to get amount of thing in table from table

like
print(#workspace:GetChildren())

static coral
#

i have just proved it 3 fucking times

obsidian ember
#

no

teal quiver
#

you are so insecure you said "lil bro"

static coral
teal quiver
#

what is even the point of arguing here

copper apex
#

That is such a dumb argument 😭

static coral
#

gang i js proved it 3 times 💔

obsidian ember
#

the key is turned into a hash and the hash comes first in order. so to us it appears to be in alphabetical order

obsidian ember
#

keys with characters outside the alphabet will also work

obsidian ember
copper apex
#

Exactly

teal quiver
copper apex
#

So our dictionaries arranged alphabetically or not? U dont know 😭

obsidian ember
#

yes

copper apex
#

Once u guys figure out the hashing u guys will get the answer to this argument

teal quiver
static coral
#

correction: it is rearranged in ascending order according to character's asci code

obsidian ember
#

yes

#

thats what I was looking for

copper apex
#

Yeah

teal quiver
#

good to know

static coral
#

which is technically alphabetic

#

get dunked on

copper apex
#

Um

static coral
#

😝

obsidian ember
#

its an equal amount not alphabetic but fair

teal quiver
copper apex
#

😂

teal quiver
#

also good to know

static coral
#

u cant accept u are wrong

obsidian ember
#

also arrays and dictionaries are the same in luau

#

its just tables im p sure

teal quiver
static coral
#

maybe you should do gardening instead of scripting

teal quiver
#

nvm that phrase sucks

#

i dont want to use it again

static coral
#

they cross compatible dict is array and array is dict but its not good practice

obsidian ember
#

yeah

#

Its pretty annoying sometimes

static coral
#

just dont mix them

#

and u should be fine

obsidian ember
#

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

static coral
#

wait that gives me an idea

#

one can simulate proper arrays with buffers

#

🤯

obsidian ember
#

you can make an array type and call it a day lol

verbal lodge
#

hey

#

anyone here a bot developer?

obsidian ember
#

no

verbal lodge
#

gg's

hallow crag
verbal lodge
#

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

teal quiver
#

it seems to be only ordered when you print

#

in ascii order

#

so in conclusion, you are just mean

obsidian ember
#

when i send tables through webhook it appears in random order

#

wait

#

json encode the table and see

static coral
#

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

teal quiver
#

a
d
c
b

#

does that look alphabetic to you

#

"oh but you do not admit you are wrong"

obsidian ember
#

seems to still be alphabetical

#

if it looks like a duck and quacks like a duck

#

its prob a duck

teal quiver
#

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

obsidian ember
hallow crag
teal quiver
#

do you see my point? 😭

hallow crag
obsidian ember
#

wait

teal quiver
obsidian ember
#

json encoding makes it random or am i tripping

teal quiver
obsidian ember
#

yeah thats true

#

why tho

teal quiver
#

also do you guys did you notice the lack of response from @static coral ?

obsidian ember
#

prints in order but doesnt iterate in order

teal quiver
teal quiver
#

im not rushing

hallow crag
#

and then use a for i = loop

obsidian ember
#

was quicker to just replace the contents of the string

hallow crag
#

ok

#

so just do tostring(i)

#

in the for i = loop

teal quiver
#

how do you get a random ascii character

obsidian ember
#

my point is the json output order is random

teal quiver
#

is there any built in thing for that in luau

#

or roblox, idk if there is a difference

hallow crag
obsidian ember
#

255 i think

teal quiver
#

thanks

obsidian ember
#

well depends what symbols u want

soft burrow
#

change leaderboard on client or server

hallow crag
obsidian ember
#

change values on server

#

update visuals on client

hallow crag
#

^^

obsidian ember
#

its nothing wrong it just

#

looks weird and is hard to read

#

Thought I was tripping

soft burrow
#
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
lilac crescent
#

Code discussion

obsidian ember
#

yes player is automatically "passed"

static coral
soft burrow
#

its charity work btw

teal quiver
obsidian ember
hallow crag
# soft burrow why

why u telling the server to change a stat just do it fully on the server

teal quiver
#

dont you find it embarrassing

obsidian ember
#

I feel like if it was actually ordered

soft burrow
#

this sends the event to do it on the server

obsidian ember
#

they wouldnt say that iteration order cant be trusted

hallow crag
#

?

#

on the server

obsidian ember
#

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

static coral
hallow crag
soft burrow
# hallow crag on the server
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
soft burrow
#

what

static coral
hallow crag
#

1 way ticket to inf money cheats

obsidian ember
#

exploiter wet dream

static coral
#

string interpolation gonna look ugly

teal quiver
soft burrow
static coral
hallow crag
teal quiver
obsidian ember
#

yeah

hallow crag
#

store the value on the server

soft burrow
static coral
hallow crag
#

dont send the value via the signal

static coral
soft burrow
hallow crag
#

if that works best for u

#

without passing the value

soft burrow
#

is that not the same thing?

#

a hacker could activate a different event

teal quiver
hallow crag
#

and get inf currency

teal quiver
#

probably unordered

soft burrow
#

huh??

hallow crag
static coral
hallow crag
#

one sec

obsidian ember
soft burrow
#

my func does not take a third input though

obsidian ember
#

he was just showing example code

teal quiver
static coral
obsidian ember
#

yeah but

teal quiver
# obsidian ember

i guess it says inf because every other integer is either equal or smaller

hallow crag
obsidian ember
#

i dont wanna blow his mind

#

its also not just a large number

soft burrow
hallow crag
#

just make the remote specific to what ur doing

soft burrow
hallow crag
#

its not a currency

#

my bad

soft burrow
#

wait can they do
ChangeStat:FireServer("money", million dollar)

hallow crag
#

always store values on the server

#

dont put into remote

soft burrow
#

how can i prevent

hallow crag
teal quiver
soft burrow
#

ooh you saved me

hallow crag
# soft burrow how can i prevent
teal quiver
#

and stuff

hallow crag
#
-- 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

teal quiver
soft burrow
#

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?

teal quiver
hallow crag
#

but dont pass the money amount

#

in the signal

#

also have magnitude checks

#

on the server

teal quiver
soft burrow
#

make seperate events for each death i get?

hallow crag
#

u just need good serverside protection

soft burrow
#

can you do deaths on server side

hallow crag
#

yeah

hexed zinc
soft burrow
#

so how would i do deaths server sided

slender salmon
#

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

empty rapids
#

Hi can anyone tell me why my debounce isnt working

teal quiver
#

for another purpose

teal quiver
teal quiver
empty rapids
teal quiver
#

what i meant was the

if humanoid and debounce == false then
  -- your code
end
debounce = false
empty rapids
#

i think that would do nothing because it will run it enable it again anyways when another limb touches it

teal quiver
empty rapids
#

A cool down to the cooldown?

teal quiver
#
if humanoid and debounce == false then
  -- your code
  task.wait(1)
  debounce = false
end
nova yarrow
#

Not in a rude way but

somber vault
#

nobody asked

teal quiver
#

😭

nova yarrow
#

Like

#

Ur making multiple connections

teal quiver
nova yarrow
#

So the touch function runs multiple times

teal quiver
#

every second

nova yarrow
#

Then use a coroutine

teal quiver
empty rapids
teal quiver
#

did you even read the code?

somber vault
#

he's right, this is detrimental

somber vault