#code-discussion

1 messages · Page 111 of 1

sick saffron
#

i thought remote events only went one way

soft hull
#

or changes animation priority if it is intentional to play 2 animations at the same time

soft hull
sick saffron
#

alr ik what to do

soft hull
#

server -> client | client -> server

sick saffron
#

thx

soft hull
#

np

vital parrot
#

Should I learn Knit?

#

or does it really matter?

young mantle
vital parrot
#

I use bytenet2 mostly for my games

#

Is this kind of like the same thing?

young mantle
#

Knit is just a framework but it has stopped receiving updates

#

so most people have pivoted to creating their own frameworks / new branches of knit

vital parrot
#

Is there any packages I should learn?

young mantle
#

Ones that you'll see a lot are promise, profilestore, janitor/trove/maid and a networking module (I like Packet by Suphi Kaner).

vital parrot
#

does it matter which janitor/trove/maid I use?

#

@young mantle

young mantle
#

personal preference but some people don't like trove

vital parrot
#

Maybe I'll take a look at janitor

#

and promises

#

I dont think I need profilestore

crystal olive
#

Its just easier to manage data

vital parrot
copper apex
#

Frameworks are overrated

paper ridge
#

Guys should i use luau?

crystal olive
#

ragebaiting fosho

copper apex
#

Folders and good code structure is good enough

#

Or even better

vital parrot
rapid eagle
civic karma
#

anyone scripter

#

I need scripter rq

rapid eagle
#

u find scripter

#

here we not script

#

jk

#

what u want

#

@civic karma

vital parrot
stone garden
#

HOW I CLOSE THIS DUMB IA?

young mantle
#

I just like how easy it is

#

i love oop though so it's great to create a trove obj for each oop object

empty mulch
soft current
#

dawg why are you giving us the options of choosing whether you become a super hero or a super villain 💀

warped idol
#

Do i try a mix of both or do i just end up choosing one permanent side

soft current
# warped idol i have no idea

to put this simply, you either have the choice of doing illegal things and carrying a deep burden, or you can morally hack and do whatever with the appreciation that you've done what's right

#

truth be told ive taken accounts before, and although it seems fun at the beginning, it is a mental pain to deal with later

#

i speak from experience, not judgement

#

so, id say stick to the ethical ways

warped idol
#

Hm maybe i can try to steal a few accounts? nothing serious of course just some new ones

soft current
#

i wouldn't even think about doing that considering that you taking accounts is like taking candy from a baby

#

stealing accounts from helpless children isn't some exception

soft current
#

better safe than sorry is all i can really say

stone garden
rapid eagle
#

roblox doesn't allow that 🤷🏻‍♀️ so by doing so you are kinda broking the law

mental shore
rapid eagle
mental shore
#

Don't discuss topics like this, it's against the rules coolguy

#

Same here, don't discuss stuff like this

pine torrent
#

It's deleted message

soft current
mental shore
soft current
#

i just have a question

rapid eagle
cedar badge
#

im gonna practice thing like userinout service till i can do anything with it even if it tskes a week is that good

sick flower
#

whats ur opinion on profile store guys?

unborn sable
#

what's the point of remote events

empty mulch
rapid eagle
#

how*

mossy hound
#

anyone need free scripter?

weak radish
mossy hound
#

i can do some decent stuff

#

just not super advanced combat systems and shit

weak radish
mossy hound
#

commonly used for debounces and stuff

weak radish
#

atleast you arent one of the dumb ones who gloats and cant do shit

mossy hound
#

i just need practice 😭

weak radish
mossy hound
#

i want to be better and stuff

manic rover
random jungle
#

i heard that i shouldnt use too much remote events but what if im doing a ui based game and everything is getting handled on client?

elfin timber
#

would yall suggest me getting vscode

weak radish
weak radish
#

where were you planning on using them

random jungle
#

like sending gold to the server

weak radish
random jungle
#

when i click a button and the player gets gold from clicking it

#

i has to be send to a server

elfin timber
#

is it worth switching

vital sinew
elfin timber
#

lines of code?

vital sinew
#

Uhhhhh

#

50k+ ig

elfin timber
#

im still in mylearning phase really so its no use for me rn

vital sinew
#

That's not even THAT big, but around there is pretty big imo

#

For Roblox at least

elfin timber
#

thanks

vital sinew
#

I don't use it, personally

#

But I will eventually, probably

tame compass
#

I want to make it more satisfying

#

I'll be working on the visual effects

vital sinew
#

Eyyy I like it!

proven cosmos
#

hey guys, just got into gfx. does this look good as a game icon?

stiff ibex
#

RobloxTreeWidget (/ROBLOX-Pre-Jekyll/RobloxStudio/RobloxTreeWidget.h)

stiff ibex
proven cosmos
#

i know, but i felt like asking here for opinions aswell

stiff ibex
proven cosmos
#

i will next lol

tame finch
#

looking for a good datastore module, send link please

weak radish
uneven jolt
#

are module scripts set to nil cleared from memory? or are they cached?

ruby cipher
#

How do yall go abt adding force to a massless object with custom physics

Just need it to be pushed forward with a small upward force

polar cargo
#

how do i make a realtime countdown when you click a button and assign that into a textlabel

cold pasture
#

im trying to do a hunger system the depletes passively but when i eat it doesnt save the new value and just reverts to the the pre-eating hunger value when it depletes and basically doesnt do anything.

candid oak
#

Is it possible to get pass the writefile restrictions when making a plugin ? Not in a malicious way

hushed basin
#

"Not in a malicious way" 💔🥀

muted crow
#
local players = game.Players
local plr = players.LocalPlayer
local SprintModule = require(game.ReplicatedStorage.Sprint.SprintModule)

local UIS = game:GetService("UserInputService")

local toggle = false

UIS.InputBegan:Connect(function(input, gpe)
    if gpe then return end
    
    if input.KeyCode == Enum.KeyCode.LeftShift and not toggle then
        toggle = true
        SprintModule.sprinting(plr)
    else
        toggle = false
        SprintModule.walking(plr)
    end
end)```

why does it stop running everytime i go another direction??
#

like when im running and holding w and then click s it then goes back to the default speed or it calls my walking function

#
local sprint = {
    
    sprinting = function(plr)

        local character = plr.Character
        if not character then return end

        local humanoid = character:FindFirstChild("Humanoid")
        if not humanoid then return end

        humanoid.WalkSpeed = 24
    end,

    walking = function(plr)

        local character = plr.Character
        if not character then return end

        local humanoid = character:FindFirstChild("Humanoid")
        if not humanoid then return end

        local walkspeed = humanoid.WalkSpeed

        humanoid.WalkSpeed = 16
    end
}

return sprint

this is the module

#

wrong channel

sand flower
muted crow
#

whoops

#

oh

sand flower
#

you should do if else

muted crow
#

elseif?

sand flower
#

left shift and toggle

sand flower
muted crow
#

okay let me try that

muted crow
sand flower
vast hornet
#

print(tonumber("393939393993399399393933993393939") + 1)
what would happen chat

candid oak
hushed basin
candid oak
#

aight

vast hornet
#

wait will that work

#

what is luau even about atp

lethal imp
#

why is my bar going from bottom to top shouldn't it be from top to bottom? local function Update() Bar.Size = UDim2.new(1, 0, Hunger.Value / 100, 0) end

lethal imp
pine torrent
#

Wym

lethal imp
#

nvm i got it to work

#

was rotating the wrong frame

pine torrent
#

Why did u listen to my suggestion first of all

#

It was rhetorical

white gust
#

`Event.OnServerEvent:Connect(function(Player, HumanoidRp, Character, CurrentM1)
local HitBoxPos = HumanoidRp.CFrame * CFrame.new(0, -0.3, -3.2)
Oparams.FilterDescendantsInstances = {Character}
local NAME = ""

local Damage, Size = 4.1, 2.5

if CurrentM1 == 5 then
    Damage = 8
    Size = 6
end


local allHit = workspace:GetPartBoundsInRadius(HitBoxPos.Position, Size, Oparams)
TestingPurpose.Position = HitBoxPos.Position
TestingPurpose.Size = Vector3.new(Size,Size,Size)`
#

Is this an inefficient way to do hitboxes? They always seem to lag behind my character

tame finch
#

the server is behind

hushed basin
tame finch
#

the client

#

^

white gust
frank knoll
#

judge my code. I broke it down for readability for those newer to scripting.

#

It works. It is just a simple farming tycoon script.

wise turtle
hoary cedar
frank knoll
hoary cedar
#

Some light redundancy and inconsistency

#

Could use never-nesting patterns

frank knoll
#

What sticks out?

hoary cedar
frank knoll
#

That is for the data store I am buidling. When the player rejoins, the server script in theory should put it back in the purchased folder and restart the while true statement

#

Nope. That part should be in the dropper

#

because the button will be destroyed next time and the script gone. Thank you for that

#

My droppers need scripts. I am an idiot

#

Thank you so mich

hoary cedar
#

Yes, but that's not exactly what I wanted to you to conclude, @frank knoll

#

The if-statement is redundant. The line prior guarantees its parent will be workspace.Purchased

#

A more advanced design would call to another system that loads in the respective dropper. This system is re-used when deserializing save-data, providing a centralized dropper implementation

frank knoll
#

Thank you, going to start the data store. Wil lyou be on tomorrow? I will post an update

hoary cedar
#

I won't

spring fog
#

guys I’m having trouble building a mpg system

#

npc

blissful ruin
#

can someone help on this bruh, lua local Angle = math.rad(MouseAngle) PilotSeat.CFrame = CFrame.new(PilotSeat.Position) * CFrame.Angles(0, 0, -Angle) -- why on earth is it moving the actual seat? like i have a mouseangle which is 0-360, and is suppose to just rotate the seat by that angle?

wise turtle
true birch
#

They still gotta explain more

cold plank
#

Has roblox fixed up collisions for meshes with large amounts of vertices (using PreciseConvexDecomposition)
I was wondering as I was thinking about making cave generation with the editable mesh api

gloomy ginkgo
#

Can someone explain why this doesn't work?

local part = script.Parent
part.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        player.Character.Humanoid.Health = 0
    end)```
why isn't this working
amber lagoon
#

prolly bc its done wrong

frank knoll
frank knoll
#

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:BreakJoints()
end
end)

errant plover
#

Curveball question: do you guys think AI like Copilot will ever get to the point where they are able to replace real scripters?

cold plank
#
local part = script.Parent
part.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        player.Character.Humanoid.Health = 0
    end
end)```
lilac ore
#

guys i have a scripting question @everyone

sudden estuary
lilac ore
#

who should i ping

sudden estuary
#

just ask

lilac ore
#

oh okay sorry. this is my first time going to this channel

sudden estuary
#

np

lilac ore
#

i'm wondering if there is anyone who specializes in like lock on camera system

#

cos im making a combat system

#

and whenever i dash sideways with lock on

#

it does not go in a circle

#

i kinda wanted it to orbit around the target when it does side dash

sudden estuary
#

u r likely dashing with only the initial direction vector

#

u would have to change ur direction each frame

lilac ore
#

yeah i think so with RightVector

sudden estuary
#

yes

lilac ore
sudden estuary
#

show ur current code

lilac ore
#

u mind if i show my codes?

sudden estuary
#

yea

lilac ore
#

i got 4 codes for it

#

okay imma show u

sudden estuary
#

just show the only one where u handle the dashing

lilac ore
#

this prolly the only main thing where it handles vector changes

#

howeve

#

with/without lock on, it purely side dashes

#

i was wondering how to rework it so when i do lock on, it side dashes in an orbital way around the target

#

this inside a module btw

sudden estuary
#

make a RunService renderstep with priority of camera , determine ur direction as u did here (i.e either Right *-1/1 or Look * -1/1 and then keep updating this direction in the function

lilac ore
#

can i add u and just dm u 😭

sudden estuary
lilac ore
#

oh okay gimme a sec

queen kelp
#

coffee creamer and milk

sudden estuary
# lilac ore oh okay gimme a sec
local sign
local direction 
if dashDirection == "Left" then
    direction = "RightVector"
    sign = -1

elseif dashDirection == "Right" then
    direction = "RightVector"
    sign = 1

elseif dashDirection == "Forward" then
    direction = "lookVector"
    sign = 1

else
    direction = "lookVector"
    sign = -1
end

RunService:BindToRenderStep("DashCamera", Enum.RenderPriority.Camera.Value + 1,function() 
    bodyVel.Velocity = hrp.CFrame[direction] * sign * 100
end)
#

something like this

#

make sure to unbind it after dashing

lilac ore
sudden estuary
#

it will run as long as its Binded

#

do RunService::UnbindFromRenderStep("DashCamera") , once ur dashing has ended

lilac ore
#

ohh okay

#

wouldn't it be disconnect since it's runservice?

#

nvm it's a function

#

lemme try it for a sec

lilac ore
sudden estuary
#

nothing

glass garden
true birch
sudden estuary
lilac ore
#

did i do it right?

true birch
glass garden
sudden estuary
glass garden
#

but we're always looking for ways to improve

true birch
glass garden
sudden estuary
true birch
#

I still don't really understand difference

true birch
#

All ik is that UnreliableRemoteEvent is for like sending HUGE information

#

And RemoteEvent for small information

sudden estuary
lilac ore
glass garden
lilac ore
#

no errors too

lilac ore
sudden estuary
lilac ore
#

no changes

viscid finch
#

Should we still learn knit

viscid finch
#

Or is it too late

glass garden
#

don't use it

viscid finch
viscid finch
glass garden
viscid finch
#

is a framework not needed

#

I always see game devs asking for experience with frameworks like knit

glass garden
#

I'd argue that a framework is not needed. I haven't used one in almost 2 years and it's been fine

#

Roblox provides enough out of the box

viscid finch
ancient marsh
#

Does anyone have experience with making waves mine look like doo doo

glass garden
#

Depends on the needs of your team though

sudden estuary
#

then disconnect the connection after 1 second

spiral jungle
glass garden
# spiral jungle What about type script

Also depends on your team. If you have a team of people who are experienced with typescript, then that might be a good route. TS's type system is still magnitudes better than luau's. Luau has different goals in that ecosystem though, and its v2 solver is slowly getting much better

sudden estuary
#

wait a minute

#

r u doing the dash in server?

hasty pelican
#

how is my code

#
local spawn = game.Workspace.SpawnLocation

local function setSpawnToNeon ()
    spawn.Material = "Neon"
end

setSpawnToNeon()

print("Spawn is now neon!!")
lilac ore
tame compass
lilac ore
plush barn
#

Y’all ever watch someone script and realize there is levels to this?

sudden estuary
#

I assumed it was client mb

lilac ore
#

oh yeah right

#

it has to be local

#

for render thing

sudden estuary
#

yes

hasty pelican
lilac ore
#

wb in a module

sudden estuary
#

I would suggest doing it in client

lilac ore
#

the velocity changes?

sudden estuary
#

yes

lilac ore
#

does it apply to the server too?

sudden estuary
#

yep

plush barn
sudden estuary
#

client has network ownership over its character

#

which is how exploiters fly

hasty pelican
plush barn
tame compass
hasty pelican
plush barn
tame compass
#

By making it turn a specific part to neon and not SpawnLocation only

hasty pelican
plush barn
#

Maybe I might know

lilac ore
plush barn
#

How to help

hasty pelican
#

i just dont think yoyu could make the funtion more useful

sudden estuary
#

the value itself won't replicate

plush barn
hasty pelican
#

i aint got many parts

tame compass
#

local function MakePartNeon(Part : Part)
Part.Material = neon
end

MakePartNeon(spawnLocation)

plush barn
hasty pelican
#

plus its almost 12 for me so imma go to bed soon

hasty pelican
tame compass
plush barn
#

You need it

#

With out it your codes a mess

tame compass
#

That’s like the foundation of code

lilac ore
rapid verge
# hasty pelican how?

have the function take material as an input

then instead of making spawn neon, you can make the spawn any material you want

plush barn
#

A function holds your code and helps you excecute it in one word with the ()

hasty pelican
#

Tommrow i gotta do scoping and stuff

#

its gonna be a pain

sudden estuary
rapid verge
plush barn
sudden estuary
#

but if u change the motor6d transform it won't replicate

tame compass
plush barn
sudden estuary
hasty pelican
tame compass
plush barn
lilac ore
#

the animation ids?

sudden estuary
#

the Animation instance

lilac ore
#

stored in serverstorage?

plush barn
sudden estuary
plush barn
#

Or Eu

tame compass
#

local function ChangePartMaterial(Part : Part, Material)
Part.Material = Material
end

ChangePartMaterial(spawnlocation, Enum.Material.Plastic)

hasty pelican
tame compass
#

Just like that

plush barn
rapid verge
# hasty pelican What

like how you can define variables

you can define parameters for your functions

now when you call that function, you can add stuff inside the brackets and it will put inside the function

local function printinquotes(message)
    print(string.format("%s"),message)
end

printinquotes("hello world") --// prints "hello world"
plush barn
#

Planing to do computer science in the future

tame compass
#

The function takes 2 parameters. Part, which is a Part and Material which is Enum.Material.(material you want)

hasty pelican
hasty pelican
tame compass
#

Did you learn about functions in school?

plush barn
tame compass
#

It would be easier to explain if you did

hasty pelican
hasty pelican
tame compass
hasty pelican
#

aight its 11:40 i gotta head to bed

#

gn

tame compass
#

like, y(x)=3x

#

That’s a function

tame compass
crude quarry
tame compass
#

I’ll try to help

hasty pelican
tame compass
crude quarry
#

math is cringe

rapid verge
tame compass
#

local function y(x:number) : number
return 3*x
end

#

That’s the same as y(x)=3x

rapid verge
tame compass
rapid verge
tame compass
#

They pass parameters and return values depending on the passed parameters

hot dove
#

Where do I know where to place my scripts like replicated storage and starter character scripts etc

tame compass
#

But

#

Local script only work if they’re a descendant of a player

hot dove
#

Wdym descendant like parent

#

Or child

tame compass
#

It’s like

#

Children of children of children and etc

#

For example, Player.Character.Humanoid

#

Humanoid is a descendant of Player

#

Player.Character.Humanoid.Animator is a descendant of player too

hot dove
#

How would I classify local scripts as descendants

tame compass
bleak glade
tame compass
woeful gate
#

loool

tame compass
#

?

jaunty path
# tame compass ?

Dont listen to the kid hes one of the reasons why discord's ignore feature is useful

somber lodge
crude quarry
copper apex
#

Wym?

scenic moon
woven wigeon
#
local cooldown = false
for _, part in ipairs(workspace:GetChildren()) do
    if part:IsA("BasePart") and (part.Name == "TP1" or part.Name == "TP2") then
        part.Touched:Connect(function(hit)
            local player = game.Players:GetPlayerFromCharacter(hit.Parent)
            if player and not cooldown then
                cooldown = true
                local target = workspace:FindFirstChild(part:GetAttribute("To"))
                getRoot(player).CFrame = CFrame.new(target.Position, target.Position + target.CFrame.LookVector)
                wait(1)
                cooldown = false
            end
        end)
    end
end

I'm trying to make it so that the player is teleported in the direction the tp block is facing after the tp but for some reason it keeps it's direction even though i printed the new lookVectors and it's the same as the one on target

scenic moon
#

Say you're a skid without saying you're a skid...

spiral jungle
woven wigeon
woven wigeon
spiral jungle
#

Then that’s your problem

woven wigeon
#

Do I need to change camera

spiral jungle
#

Yep

woven wigeon
#

Damn didn't think about that, thanks

plush barn
#

He long do you guys think will take the average person to learn how to make a piece of code that is functional that is some what above the easy level like in a mater of months to specific weeks

blissful ruin
#

AUUGH, anyone know a good video for like coding An airplane? Like something to at least base mine off of?

copper apex
#

Most of the algorithms are derived from mathematical views

#

Sure you may not use math all the time, but its still used

#

Whether it may be basic arithmetic or matrix operations

thorn arch
thorn arch
copper apex
#

Yeah

calm trout
#

I need someone to answer if this method of data is worthwhile.

I have a values folder under the player, this folder contains all the data for the game.

When the player joins, the data is retrieved from the DataStore, and then they are set to their respective instance's values.

(The instances in the folder are created automatically)

Then the Client Ui waits for everything to load, and updates all the UI with the data obtained from the instances under the Values Folder.

This happens in under a second so not much delay, everything that updates data updates the values under the Values Folder. And it autosaves every minute

#

When the player leaves or the server closes, it's saved again

#

I know it's not the best method

#

But my game doesn't need much

empty mulch
#

Is while os.clock do
task.wait()
a good way to track timers?

calm trout
#

Atmost, they can change the values to change ui visuals

lilac ore
#

@sudden estuary thanks a lot it worked in the client side!

sudden estuary
#

great

#

u r using the Camera Render priority right?

lilac ore
#

yeah the bindtorenderstep

#

RunService

#

also

#

if i try to play animations in LocalScript

#

does it also replicate in the server?

#

i think i already asked this but jus wanna clarify it again since i jus got home lol

sudden estuary
#

and the animation id is under the correct holder

lilac ore
#

like this?

sudden estuary
#

yes

#

some people create the animation during run time

#

and some do it in client

#

in such cases it won't replicate

frail yarrow
#

do people load anims on the fucking server bruh 💔

#

thats chopped as hell

lilac ore
#

this is in the LocalScript

lilac ore
#

cos i've thought all this time that if an animation is played on server, it will be seen by everyone

#

which i always wanted to achieve

marsh kelp
#

any animation you run for you character, that is owned by you. will get replicated to the server

jaunty wolf
# lilac ore does it also replicate in the server?

you have "network ownership" over your character. this means your movement, physics, animations, are calculated locally and are allowed to replicate to the server (its why cheaters can speedhack and teleport in every game)
you also get network ownership over any nearby physics objects too, once you walk near them. hackers can actually move these physics objects however they want using this feature

sudden estuary
#

whoever runs animation on server should be headed

jaunty wolf
#

without ownership over your char, your movement would have to wait for the server which would feel very laggy

lilac ore
#

😵‍💫

#

so basically

#

as long as i created the animation and i played it under a LocalScript

#

it will be replicated to the server and be seen by everyone?

lilac ore
sudden estuary
#

yes

lilac ore
#

i see i see

#

that's helpful!

#

thanks everybody

sudden estuary
#

roblox just made it so that animations played on client replicate to server no matter what

#

but yeah other physics depend on network ownership

jaunty wolf
wintry totem
#

Hey, is it normal for someone to make the art for a game and then hire a scripter to complete the game so they can publish it? like is that normal?

#

or is that risky, idk how to go about it 🤔

woeful jay
#

i have a phone system and im trying to install a button and when i press that button the frame that the script is connected doesnt wanna open can someone help me

uneven jolt
#

are you making a countdown?

empty mulch
empty mulch
# uneven jolt are you making a countdown?

Kind of. Every 60 seconds of triggers a function in a module to spawn something, everyone 180 seconds it triggers something in a different module to roll the chances and possibly spawn

uneven jolt
#

actually

empty mulch
uneven jolt
#

then time

empty mulch
uneven jolt
#

in this case couldnt you just do task.wait(60)?

#

if its gonna be hardcoded?

empty mulch
#

It's not hard coded. It's a dynamic modular system. I've made timers and countdowns before but I heard os.clock was a good way to do it. So I was asking here

uneven jolt
#

os.clock is the most precise, that could work

#

i set mine up with time

empty mulch
#

Yeaa that's wild. Can't believe I've never heard of it

uneven jolt
#

your good

uneven jolt
# empty mulch Yeaa that's wild. Can't believe I've never heard of it
#

heres a nice reference

empty mulch
#

Oh thanks 🙏

uneven jolt
#

no problem

#

(it helped me alot)

empty mulch
slate elbow
#

yall what does () mean

#

💔

lean ocean
pseudo girder
#
    local params = RaycastParams.new()
    local mousePos: Vector2 = UserInputService:GetMouseLocation()
    local unitRay = Camera:ScreenPointToRay(mousePos.X, mousePos.Y)
    params.FilterDescendantsInstances = {self.plr.Character, self.preview}
    params.FilterType = Enum.RaycastFilterType.Exclude

    local raycast = workspace:Raycast(unitRay.Origin, unitRay.Direction * 1000, params)

    if raycast and self.preview then
        local position = raycast.Position + raycast.Normal * (self.preview.Size.Y / 2)
        local upVector = raycast.Normal
        local rightVector = Vector3.new(1, 0, 0)
        
        if upVector.Y > 0.99 or upVector.Y < -0.99 then
            rightVector = Vector3.new(0, 0, -1)
        end

        local backVector = rightVector:Cross(upVector)
        self.preview.CFrame = CFrame.fromMatrix(position, rightVector, upVector, backVector)
    end
end```

Anyone know why the position of the preview is not accurate to the mouse pos?
hallow crag
pseudo girder
#

What aa bb

hallow crag
#

Axis Aligned Bounding Box

pseudo girder
#

How would I do something like that

hallow crag
#
local function GetModelAABB(model)
    local modelSize = nil
    local modelCFrame = nil

    if model:IsA("BasePart") then
        modelCFrame = model.CFrame
        modelSize = model.Size
    else
        modelCFrame = model:GetPivot()
        modelSize = model:GetExtentsSize()
    end

    local abs = math.abs
    local sizeX = modelSize.X
    local sizeY = modelSize.Y
    local sizeZ = modelSize.Z

    local _, _, _, cframeX1, cframeY1, cframeZ1, cframeX2, cframeY2, cframeZ2, cframeX3, cframeY3, cframeZ3 = modelCFrame:components()

    return Vector3.new(
        abs(cframeX1) * sizeX + abs(cframeY1) * sizeY + abs(cframeZ1) * sizeZ,
        abs(cframeX2) * sizeX + abs(cframeY2) * sizeY + abs(cframeZ2) * sizeZ,
        abs(cframeX3) * sizeX + abs(cframeY3) * sizeY + abs(cframeZ3) * sizeZ
    )
end

local position = CFrame.new(raycast.Position) * (CFrame.new(raycast.Normal * GetModelAABB(object) * 0.5))
#

object meaning the thing ur moving with ur mouse

pseudo girder
#

Ah ok

#

I’ll see how I would implement it tmrw

hallow crag
#

if u had a like a tree and u wanted it to be smoothly above the ground

#

cause trees tend to be a more complex model

pseudo girder
#

This would help kids

#

Lots*

#

Ty

hallow crag
#

np gl

#

r u making like a building system

#

?

pseudo girder
#

No

#

It’s actually just a little system I’m working on

#

For a future idea

hallow crag
#

?

pseudo girder
#

You would

#

But it’s not building

hallow crag
#

kk

tame compass
#

How do you make people's characters not disappear after respawning

#

The only thing I can think is just cloning the model

#

But is there any other way

hallow crag
#

just clone the character when they die

#

in position it where they died

tame compass
#

Okaay

#

Thanks

hallow crag
#

make sure Archivable property is enabled on the character btw

#

when cloning it

thorn arch
near pasture
#

Hello everyone

has anyone had an issue with weird flingy behavior after destroying a weld in roblox?

I'm experiencing it right now and want to know how to deal with it

It happens when I turn but it fixes itself when I resummon my stand

gaunt wren
#

Can anyone tell me how in the earth should i load in my cutScene animation in moon animator ??

arctic berry
#

@gloomy trench Hes trusted and he made a good purchase system for my Game :D

crude quarry
#

Is it wise or recommended to use waitforChild in a loading screen? I wanna make sure stuff actually loads before a player gets in

#

Im just used to using tween service and loops to make a loading screen

thorn arch
spiral jungle
#

And make it massless

crude quarry
wispy jay
#

Hello guys, So I am trying to limit the player's camera from rotating more than 90 degrees to either side (left or right)

local relativeCFrame = camera.CFrame:ToObjectSpace(character:GetPivot())
    
    local _, YRotationAngle, _ = relativeCFrame:ToOrientation()
    local correctedAngle = 0
    
    --print(YRotationAngle, math.deg(YRotationAngle))
    
    if YRotationAngle > Controller.Constants.MAX_Y_LOCK then  
        correctedAngle = Controller.Constants.MAX_Y_LOCK - YRotationAngle
    
    elseif YRotationAngle <  Controller.Constants.MIN_Y_LOCK then
        correctedAngle = Controller.Constants.MIN_Y_LOCK - YRotationAngle
    end 
    
    relativeCFrame *= CFrame.Angles(0, correctedAngle, 0) 
    --local newCFrame = camera.CFrame * CFrame.Angles(0, correctedAngle, 0)

    if correctedAngle ~= 0 then
        camera.CFrame = character:GetPivot() * relativeCFrame
    end```

Controller.Constants.MAX_Y_LOCK and MAX_X_LOCK are basically limiters of 90 degrees in either side. 

But what's happening is, whenever it hits the limit it flips sides
#

can anyone help please?

hard garden
#

guys

#

is it good if i dont use local in setting variables?

thorn arch
#

No

hard garden
#

explain

#

@acoustic fulcrum heres ur answer fr

thorn arch
acoustic fulcrum
#

hm

thorn arch
#

Local is used to define a variable

hard garden
thorn arch
#

However once a variable is defined in a scope, it can be set anywhere inside that scope

#

Without local

thorn arch
hard garden
#

i can still define without local tho

#

im confused why do we need to do it even though we can just define it without "local"

thorn arch
#

Slower

#

Its slower

hard garden
#

hm?

#

how?

acoustic fulcrum
thorn arch
#

When you don't use local it's stored in a global table

#

Which is slower to read and write to

#

And just adds more overhead to your code

hard garden
#

understandable

acoustic fulcrum
#

ooh

thorn arch
#

Also using local makes it more readable

hard garden
thorn arch
hard garden
#

yes i do

thorn arch
#

It's like putting every variable in _G

hard garden
#

mhm

thorn arch
#

Infact it IS putting everything in _G

hard garden
#

ooh

thorn arch
#

Which is bad practice

acoustic fulcrum
#

ahh

spiral jungle
#

_G game architecture

thorn arch
#

Local also tells the executor which scope the variable is meant to be in

#

If you don't use local for a variable inside a function

#

It can have effects on variables outside the function

hard garden
#

i understand it now

#

thank you :D

thorn arch
#

Np

acoustic fulcrum
#

i understand too now

#

i shall use local more often now

hard garden
#

same

thorn arch
#

It's only for defining variables btw

#

Don't use local when setting them

#

That would cause more issues

acoustic fulcrum
#

yea ik

#

it would be like defining more variables

thorn arch
#

Yh

#

Overwriting the definition

#

And also will throw errors if u do something like

local object.Parent = workspace
hard garden
#

we know dat

#

i make mistakes like that before too

#

😅

#

thank u for the help btw

kindred pier
#

I am making a Demo Game to get verified , I have made a Custom NPC Module instead of using Built in Dialog, Should i use String Values or Dialogs and DialogChoices for the whole system?

#

I can make it work with both, but i want to do the one which might look better on application

rapid eagle
#

mm

#

for me I write everything in code

#

!

kindred pier
verbal igloo
#

Who here can help me with my animate code

wispy jay
#

;c I myself am struggling with cframe

crude quarry
thorn arch
#

With dialog options

kindred pier
kindred pier
thorn arch
#

And each dialog option has corresponding response and next dialogue options

thorn arch
#

Unlike in other languages it won't be as powerful as other classes for example Vector3 or BasePart

#

But it's still pretty powerful

kindred pier
#

W, I didnt know that 😭

thorn arch
#

For example if you named the module "Dialogue"

#

Dialogue.new(args)

#

Dialogue.NextOption(arg)

#

Dialogue.GetResponse(arg)

#

Just an example of how you could do it

kindred pier
#

Thx :D, Ima try that rn

remote bear
crude quarry
#

anyone got any advice where I should look to find ideas to make an R15 gun system? I wanna remake my old game that used a toolbox gun system and R6 mechanics but in R15

somber vault
#

like chatgpt does

thorn arch
#

/ something /

#

Idk how to show u

lean ocean
#

Mid way

thorn arch
#

Use the backticks

#

`

#

1 on each side for a phrase

somber vault
#

Hello

thorn arch
#

3 on each side for a code block

somber vault
#

oh yes

thorn arch
#

And u can put lua after the first 3 backticks and go to the next line for a pretty printed code block

somber vault
#

local rps = game.GetSevice("ReplicatedStorage")

crude quarry
#
Who doesn't know that :sus:```
somber vault
#

why no color?

thorn arch
#
local foo = bar
local function hello()
   print(foo)
end
thorn arch
somber vault
#

where do i change it

#

to make it lua

crude quarry
#
--Over there
local lol = "Nah"
lol.touched = Policed Called
print("50 years in prison")
tame compass
#

lua

#
local t = "t"
crude quarry
#

lua? I just put v

somber vault
#
local workspace = game.Workspace
tame compass
somber vault
#

lua```local function CallPolice()
print("Police Called")
end

#

howwwww

crude quarry
#
const test = "This is a string"

if (test === "This is a string"){
console.log("lol")
}
#

hmmm interesting

somber vault
tame compass
#

ye

crude quarry
# tame compass

Now you have to add user input so the user can input the name manually

tame compass
#

I actually did input it manually

somber vault
#
local value = 1
#

i didi it'

crude quarry
#

ah it looked automatic

somber vault
#

i did it

tame compass
#

idk

#

maybe check with the tick()

#

and see for yourself

lean ocean
#

No os.clock

remote bear
thorn arch
#

Or are you using textures

tame compass
#

Why isn't it working

#

I want the text to be crossed

#

The Rich Text is enabled

#

The <del> tag isn't working either

#

Already found the solution

crude quarry
#

Anyone know what this error is from? I play my test game and no errors but when I return to studio edit it appears. When I click it it doesn't bring me anywhere. Everything works

spiral jungle
crude quarry
#

ah its probably the UI editor

#

thanks i'll uninstall it

#

ah nope it was the helicopter manager plugin

#

I forgot to add a wait during while true do and my computer died

spiral jungle
#

Rookie mistake

somber vault
#
  12:59:25.626  took 0.0000011664815247058868  -  Client - Moving:157
  12:59:25.643  took 0.0000010414514690637589  -  Client - Moving:157
  12:59:25.659  took 0.0000013334210962057114  -  Client - Moving:157
  12:59:25.676  took 0.0000012915115803480148  -  Client - Moving:157
  12:59:25.693  took 0.0000012081582099199295  -  Client - Moving:157
  12:59:25.709  took 0.000001125037670135498  -  Client - Moving:157
  12:59:25.726  took 0.0000015418045222759247  -  Client - Moving:157
  12:59:25.743  took 0.000001125037670135498  -  Client - Moving:157
  12:59:25.759  took 0.0000010833609849214554 

are these times good for custom wasd moving

crude quarry
#

This is why I wanted to learn coding, I used to think coding your own day/night was complicated but
My code

local Lighting = game:GetService("Lighting")

while true do
    task.wait(0.01)
    Lighting.ClockTime = Lighting.ClockTime + 0.01
end```

**Tool Box**
```lua
-- dayLength defines how long, in minutes, a day in your game is. Feel free to alter it.
local dayLength = 12

local cycleTime = dayLength*60
local minutesInADay = 24*60

local lighting = game:GetService("Lighting")

local startTime = tick() - (lighting:getMinutesAfterMidnight() / minutesInADay)*cycleTime
local endTime = startTime + cycleTime

local timeRatio = minutesInADay / cycleTime

if dayLength == 0 then
    dayLength = 1
end

repeat
    local currentTime = tick()
    
    if currentTime > endTime then
        startTime = endTime
        endTime = startTime + cycleTime
    end
    
    lighting:setMinutesAfterMidnight((currentTime - startTime)*timeRatio)
    wait(1/15)
until false
lean ocean
#

first task.wait then wait

#

💔

crude quarry
wispy jay
hallow crag
#

bro doesnt know about GetMoveVector 💔

somber vault
tame compass
limpid cradle
#

Is it possible to add tweens to a beam

crude quarry
#

dont beams have to be connected to 2 points so wouldnt you just tween one of the parts

ashen fulcrum
#

guys how do i make the double barrel, revolver and tactical spawn at the first of the inventory each time?

#

people are complaining about it

naive harness
#

Do yall know any good obfuscators

tame compass
#

what's an obfuscator

swift heart
#

How to make a circle with instance.new()

ashen fulcrum
naive harness
tame compass
crude quarry
swift heart
#

T’y

#

Ty

peak sedge
crude quarry
peak sedge
#

learn oop

crude quarry
#

theres a tutorial on youtube

peak sedge
#

learn oop

#

yes

#

or dop

#

simply js one of the best methods

#

forcoding any sort of module

#

hm 1 sec

#

tell me if u can read this

#
--[[Services]]--
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")

--[[Table Constants]]--
local Defaults = {
    
    DefaultFov = 70;
    DefaultSubject = "humanoid";
    DefaultSmoothness = .2
}

--[[Runtime]]--
local Kamera = {}
Kamera.__index = Kamera

Kamera.new = function(CurrentCamera)
    local self = setmetatable({}, Kamera)
    
    self.Camera = CurrentCamera
    self.IsClient = RunService:IsClient()
    
    return self
end

function Kamera:SetFov(NewFov : number, Animation : boolean?, Smoothness : number?, Feedback : () -> ())
    Animation = Animation or false
    
    if self.Camera and self.IsClient and Animation then
        local Camera = self.Camera :: Camera
        Smoothness = Smoothness or Defaults.DefaultSmoothness
        
        local Info = TweenInfo.new(Smoothness, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out)
        local Tween = TweenService:Create(Camera, Info, {
            FieldOfView = NewFov
        })
        
        Tween:Play()
        Tween.Completed:Once(function()
            if Feedback then Feedback() end
        end)
    elseif self.Camera and self.IsClient then
        local Camera = self.Camera :: Camera
        Camera.FieldOfView = NewFov
    else
        error("Error: Camera Is Not Defined Or Module Has Not Been Called On Client")
    end
end

function Kamera:ResetFov()
    
end

function Kamera:MultiplyFov(Animation : boolean?, Feedback : () -> ())
    
end

function Kamera:Shake(ShakesPerUnit : number, Magnitude : number, Duration : number)
    
end

function Kamera:Unmount(Follow : boolean?, Smoothness : number)
    
end

function Kamera:KameraReMount()
    
end

function Kamera:CameraSetCameraSubject(NewSubject : Instance)
    
end

function Kamera:ResetCameraSubject()
    
end

return Kamera```
ashen fulcrum
#

he’ll probably send a code

peak sedge
#

so you do know how to use setmetatable?

#

?

#

hm

verbal vector
peak sedge
#

most modules i make starts with a k

#

like mortal kombat

#

uh no

#

technically im still learning myself

#

im js way more far along than u

peak sedge
hallow crag
#

thats legit like no difference lmao

#

aint gonna effect anything

lament pivot
#

wth is up with roblox

#

parts keep being unanchored

peak sedge
#

no bru im not gna suggest a tut bc i learned on my own without tuts

#

or teach u

untold gate
#

Is there here a full stack or atleast front-end developer

peak sedge
jade tendon
#

I am frontend but not the best

peak sedge
jade tendon
#

Ok I am good but it is not my main

peak sedge
#

chat hes looking for a full stack 💔

untold gate
somber vault
#

whats faster cam.CFrame:GetComponents() vs .LookVector

somber vault
sour cape
#

does anyone know how to make a global count across all server go up whenever a player get something. like idrk how to make it global

untold gate
#

i have a figma design but i'm frustrated although if i stayed for 8 hours with no distractuin i will

wispy jay
hallow crag
hallow crag
wispy jay
#

I don't wanna be too fast to judge

peak sedge
wispy jay
#

why ask 😦

#

you doing for money is good

peak sedge
#

chat is this tough

#
local UserInputService = game:GetService("UserInputService")
local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer

local SkillBase = {}
SkillBase.__index = SkillBase

SkillBase.NewSkill = function(Code : () -> ())
    local self = setmetatable({}, SkillBase)
    
    if Code and typeof(Code) == "function" then
        self.Code = Code
    end
    
    return self
end

function SkillBase:Play()
    if self.Code then
        self.Code()
    end
end

return SkillBase
#

LOL

#

L

hallow crag
#

so u dont find scripting fun?

peak sedge
#

im gud

#

terribly awsome

hallow crag
#

💀

#

scripting is fun ash

peak sedge
#

ong

#

the funnest

wispy jay
#

I learned to properly code by seeing other ppl's code

peak sedge
hallow crag
#

modelling 💔

#

its dead ash

#

u can make way more with scripting

#

skill issue

#

get better then

#

and start trying to enjoy it

peak sedge
#

one time i cried tryna understand sum

#

u can still make bread though

#

🤑

#

lol

night drift
#

how do i make it remove 50 health points and not just set it to 50 health ```script.Parent.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
Hit.Parent.Humanoid.Health - 50
end
end)

#

this isnt working

night drift
lament pivot
copper verge
drowsy wasp
copper verge
#

to be able to post something in the marketplace

slender yew
faint rampart
#

How do I make a vehicle rank locked so that a player can only use it if there a certain rank in my rp game?

faint rampart
#

Ah

#

Thought this was a server where ppl help

lament pivot
#

nothig 🪄

slender yew
faint rampart
#

Alright thanks

elfin timber
crude quarry
#

Do yall call char as car or as char like charcoal

thorn arch
#

I think

#

I don't have audible thoughts so

elfin timber
sharp totem
#

hey guys how i check if something has a tag when i use hastag it works but if the part doesnt have the tage it will error

crude quarry
#

What tag

#

I started watching byteblox talk code to me and now I feel like I actually understand lua

jolly aurora
#

@ancient eagle

jade tendon
verbal vector
#

byteblox stopped uploading yay

sullen glacier
#

what function is the replace letters (like when you press the y key it detects as a shift)

elfin timber
thorn arch
#

Spouts the most nonsense of any developer i have ever seen

elfin timber
#

i mean yea i know hes kinda edgy but

thorn arch
#

I have seen a lot of misinformation but

#

This guy is in his own league

#

And he's not malicious

#

I can tell he's just ignorant

crude quarry
thorn arch
weak radish
crude quarry
#

I never use it

#

I need to use it more

#

Just to make yall mad

#
local part = script.Parent:WaitForChild("Part")
local model = script.Parent.Parent.Parent.Parent:WaitForChild("Model")

Local playr = game:getService:WaitForChild("Players")```
#

Perfect

weak radish
crude quarry
#

Why aren't you

weak radish
#

Because they are loaded before the script runs?

crude quarry
#

But it's the services first time they're nervous and need a minute

crude quarry
#

Just give em a minute 🥺

bleak glade
thorn arch
crude quarry
#

Yknow for people that's accuse anyone's code of rage bait yall are trash at taking a joke

stone garden
#

whats up guys 🥰

solemn forge
#

scammer

fast forge
#

Guys im gonna learn Lua. But i have some doubt that , which tutorials should i follow , i dont see any new 2025 Roblox Scripting tutorials , The best once are like 2023-2024
Should i learn by watching those videos ? Like from Youtubers like Devking , Alvin Blox and all ?

#

Im already a modeler and builder wiith 2 years of exp

distant echo
fast forge
brittle zodiac
#

I'm willing to learn script, does anyone want a disciple? I have a lot of free time and I have discipline, DM me

dense iris
#

anyone have a script for custom rigs

ashen fulcrum
#

yeo can someone help me out w a game bug

#

its fairly easy i just need help dm me

astral tusk
#

i think everyone does

somber vault
#

how does that even work

silver verge
somber vault
silver verge
#

like the one shown

#

hooks are the most common reason

somber vault
#

bro got hacked or what

coarse swan
#

friggin tuff

silver verge
#

everytime you do :connect(function), youre passing a function

coarse swan
#

any connection to a signal uses that

acoustic saffron
somber vault
silver verge
acoustic saffron
#

for example,
if remote event is fired, then do ts

lone marsh
somber vault
#

how do you even learn this stuff

lone marsh
#

u gotta hoook em up

silver verge
slender peak
#

hello

acoustic saffron
coarse swan
somber vault
silver verge
acoustic saffron
silver verge
coarse swan
silver verge
#

you read what you use

mint cloud
coarse swan
#

i used to learn from those really shitty roblox exploit requires

#

it was heat

silver verge
mint cloud
silver verge
#

temporary change

slender peak
#

i believe tutorials are the best way to start then like try to understand the code yourself and configure it yourself then if you get stuck just search the solution up and take notes

mint cloud
#

Whew

acoustic saffron
silver verge
#

matching with 3 other friends

mint cloud
#

💀

coarse swan
#

i used to convert the before FE to serverside

acoustic saffron
#

😛

somber vault
#

ok but why is it needed to make a function to pass to another function to then say function() inside. Like you still write the code so why is it useful? @silver verge

acoustic saffron
#

its not really like a function, imagine it like this: if this happens then do this

glossy wave
#

real developers dont use function, they reuse 100 lines of code 5 times... showing their REAL motivation

acoustic saffron
#

if remote event is fired then do -500 money and give player banana

acoustic saffron
acoustic saffron
coarse swan
#

real developers use chatgpt for everything

steel cosmos
#

ive done an animation and it works in studio though it doesn't work when i test it in-game, can anyone help.

glossy wave
#

why bother getting a job if other people are 👀

acoustic saffron
tame compass
acoustic saffron
somber vault
tame compass
#

Do you share the game with other people?