#code-discussion
1 messages · Page 111 of 1
or changes animation priority if it is intentional to play 2 animations at the same time
it go both ways
alr ik what to do
server -> client | client -> server
thx
np
No but learn a networking module and most of the popular packages
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
Is there any packages I should learn?
Ones that you'll see a lot are promise, profilestore, janitor/trove/maid and a networking module (I like Packet by Suphi Kaner).
personal preference but some people don't like trove
I know are you telling me I should learn it then? I've looked at it before
Frameworks are overrated
Guys should i use luau?
Kinda sounded like you was ragebaiting me lol
ofc
no
u find scripter
here we not script
jk
what u want
@civic karma
Trove and promises look real useful together
HOW I CLOSE THIS DUMB IA?
I like trove too lol
I just like how easy it is
i love oop though so it's great to create a trove obj for each oop object
Restart studio
dawg why are you giving us the options of choosing whether you become a super hero or a super villain 💀
i have no idea
Do i try a mix of both or do i just end up choosing one permanent side
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
Hm maybe i can try to steal a few accounts? nothing serious of course just some new ones
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
true that
better safe than sorry is all i can really say
thanks but already did
roblox doesn't allow that 🤷🏻♀️ so by doing so you are kinda broking the law

oh ma gahd
Don't discuss topics like this, it's against the rules 
Same here, don't discuss stuff like this
What did he make
It's deleted message
my apologies, just trying to stop the guy
tuff mosd
mod
Np it's just a verbal
i get it yeah, btw is it cool if i dm you?
i just have a question
hey logic i have question what comes first algorithm or logic?
logic
im gonna practice thing like userinout service till i can do anything with it even if it tskes a week is that good
whats ur opinion on profile store guys?
what's the point of remote events
Send information and trigger logic from server to local or local to server
anyone need free scripter?
What are the chances you know anything
1/99
i can do some decent stuff
just not super advanced combat systems and shit
whats a boolean
atleast you arent one of the dumb ones who gloats and cant do shit
lol
i just need practice 😭
go to dms, im not hiring you im just gonna challenge you
i want to be better and stuff
ok bet
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?
would yall suggest me getting vscode
u act like its paid
Most stuff you dont need validation for but just dont use remote events when you dont need to
where were you planning on using them
like sending gold to the server
what?
when i click a button and the player gets gold from clicking it
i has to be send to a server
If you're working on a big project, or you need better version control, then yes. Otherwise, no.
what would you consider a "larger project" in terms of idk like
lines of code?
im still in mylearning phase really so its no use for me rn
thanks
It's really a QoL thing cuz it has better completion and much better linting
I don't use it, personally
But I will eventually, probably
Just made this thing for my project related to the Death Note anime
I want to make it more satisfying
I'll be working on the visual effects
Eyyy I like it!
hey guys, just got into gfx. does this look good as a game icon?
RobloxTreeWidget (/ROBLOX-Pre-Jekyll/RobloxStudio/RobloxTreeWidget.h)
this is code-discussion...
i know, but i felt like asking here for opinions aswell
I personally wouldn't. Did you ask in #dev-discussion?
i will next lol
looking for a good datastore module, send link please
are module scripts set to nil cleared from memory? or are they cached?
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
how do i make a realtime countdown when you click a button and assign that into a textlabel
with a for i loop
ticks
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.
Is it possible to get pass the writefile restrictions when making a plugin ? Not in a malicious way
"Not in a malicious way" 💔🥀
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
you're just doing else which catches everything other than left shift and toggle
you should do if else
elseif?
left shift and toggle
yes
okay let me try that
that worked ty
yw
print(tonumber("393939393993399399393933993393939") + 1)
what would happen chat
What wrong with what i said
nothing ts just cute
aight
print("1" + 1)
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
rotate ur bar LOL
i js did no change
Wym
`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
its cause the sevrer isn't perfectly synchronized with the client
the server is behind
hit detection should be done on the client
Any videos or resources that go over hit detection in that manner? 😅
judge my code. I broke it down for readability for those newer to scripting.
It works. It is just a simple farming tycoon script.
ways of doing different types of hit detection, or in regards to netcode
I would consider this code written by someone who's newer to scripting, lol
Yeah I said that on purpose. I am new to scripting. Was hoping to break it down for those more junior than I. Which isn't much
It's fine for its relative skill level
Some light redundancy and inconsistency
Could use never-nesting patterns
What sticks out?
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
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
Thank you, going to start the data store. Wil lyou be on tomorrow? I will post an update
I won't
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?
should learn https://www.youtube.com/watch?v=foKFpXZYXPk
Learn how module scripts work and when to use them.
For more detailed information, check out the resources below: https://create.roblox.com/docs/reference/engine/classes/ModuleScript
Chapters:
0:00 Intro
0:19 Why do I care
0:42 When do I use it
0:53 Example
Roblox Learn are cooking these days
They still gotta explain more
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
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
prolly bc its done wrong
Damn. This is going to make things way easier…
Change (hit) to (player) in the function
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:BreakJoints()
end
end)
Curveball question: do you guys think AI like Copilot will ever get to the point where they are able to replace real scripters?
You're missing an end after the if statement
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)```
guys i have a scripting question @everyone
don't ping everyone!
who should i ping
just ask
oh okay sorry. this is my first time going to this channel
np
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
u r likely dashing with only the initial direction vector
u would have to change ur direction each frame
yeah i think so with RightVector
yes
how to do this
show ur current code
u mind if i show my codes?
yea
just show the only one where u handle the dashing
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
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
can i add u and just dm u 😭
i would rather do it here , my dms r flooded
oh okay gimme a sec
coffee creamer and milk
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
wdym
it will run as long as its Binded
do RunService::UnbindFromRenderStep("DashCamera") , once ur dashing has ended
ohh okay
wouldn't it be disconnect since it's runservice?
nvm it's a function
lemme try it for a sec
also, what is the difference between
local sign
local sign = nil
nothing
any feedback is welcome!
Huh what?
he's the one explaining in the video
Ohhh
I made that video
mhm looks fine
but we're always looking for ways to improve
I didn't mean by you didn't explained good I meant if you could explain other codes like string or something else
For sure! Yeah we have a lot in the pipeline. Next up is probably reliable vs. unreliable remote events
try debugging by adding a print inside the render step function
Oh that one for sure is useful I'll watch it
I still don't really understand difference
it doesnt print
All ik is that UnreliableRemoteEvent is for like sending HUGE information
And RemoteEvent for small information
check for any error in output
kinda the opposite! There's a strict size limit for unreliables. The gist is: reliable events guarantee that their data is received on the other end and in the same order they were sent. Unreliables do not guarantee delivery nor order. So it's good for non-critical game data that is sent at high frequency
no errors too
.
try removing the + 1 then
Ahh I see
hi
Should we still learn knit
For beginners who still don't know it
Or is it too late
What's the new alternative?
Just plain module scripts?
yup
is a framework not needed
I always see game devs asking for experience with frameworks like knit
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
2 years :O
Would you argue that vs code rojo and these external stuff are not needed too?
Does anyone have experience with making waves mine look like doo doo
Not needed, but nice. I still think vscode's text editor is far superior, especially if you write luau using luau-lsp
Depends on the needs of your team though
well then just do RunService.RenderStepped:Connect(function i gave)
then disconnect the connection after 1 second
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
@lilac ore did this work?
wait a minute
r u doing the dash in server?
how is my code
local spawn = game.Workspace.SpawnLocation
local function setSpawnToNeon ()
spawn.Material = "Neon"
end
setSpawnToNeon()
print("Spawn is now neon!!")
imma try once i get home since i jus went outside
It’s… small
it’s in a module so ig yeah it’s server sided
Y’all ever watch someone script and realize there is levels to this?
thats the issue
I assumed it was client mb
yes
I'm learning 
wb in a module
I would suggest doing it in client
the velocity changes?
yes
does it apply to the server too?
yep
I’m learning to
awosome!
Did you finish beginner turtorial ?
You could make the function more useful
for Brawldev? yea twice, but rn im re doing it since im rusty
I’m redoing it my 2ND TIME
By making it turn a specific part to neon and not SpawnLocation only
how?
so whatever changes there are made in a humanoid, it’s also replicated on the server?
How to help
i understand it tbh just forgot it all so im rusty
i just dont think yoyu could make the funtion more useful
yes in physics terms
the value itself won't replicate
Functions help organize code
oh
i aint got many parts
local function MakePartNeon(Part : Part)
Part.Material = neon
end
MakePartNeon(spawnLocation)
You use it when there’s a lot of code that you have and you don’t know what to do to it or you just don’t want a mess
plus its almost 12 for me so imma go to bed soon
Honestly is funtions that good?
Yes, lol
Yes
You need it
With out it your codes a mess
That’s like the foundation of code
wb animations?
have the function take material as an input
then instead of making spawn neon, you can make the spawn any material you want
A function holds your code and helps you excecute it in one word with the ()
it does as long as the animation exists in server
gl with closures
What
I could learn with you if you want
but if u change the motor6d transform it won't replicate
And you can pass parameters to functions
Ya that to
only exception is animation , because thats how roblox handles it
How? like we watch the video at the same time or smth?
That’s easy
We both watch the video and if you have questions I might have the answer and if I have the question you can have the answer to it
wdym by it exists in the server?
the animation ids?
the Animation instance
stored in serverstorage?
ohhh bet
You NA?
no , just have to exist in server side
Or Eu
local function ChangePartMaterial(Part : Part, Material)
Part.Material = Material
end
ChangePartMaterial(spawnlocation, Enum.Material.Plastic)
EST is NA right? if so then yes
Just like that
What does it do then
Same as me you tryna make a game together when we both experienced?
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"
Planing to do computer science in the future
The function takes 2 parameters. Part, which is a Part and Material which is Enum.Material.(material you want)
Heck yea! Id probably finish the begginer and gui series this week. by then we could probably make a simple game then watch the advanced series a little. and practice with what we know and actually make a game
Facts aight wanna vc
Computer science is soo cool but like for any other carrer path you gotta freaking put effort in it and im soooo lazy
Did you learn about functions in school?
I’m only doing comp science for game developement
It would be easier to explain if you did
what? no im not in liek a carrer path or college
same tbh
In my country, we learn functions In like fourth grade
dang lucky
aight its 11:40 i gotta head to bed
gn
If you want any help with something - dm me
This is a no math zone thankksss
I’ll try to help
aight
Functions in programming and math functions are basically the same
math is cringe
they're pretty much the same until they aren't 😔
kk but functions cant exactly hold state in maths like they could do in luau
They’re the same at theirs basics
pretty much i guess
They pass parameters and return values depending on the passed parameters
Where do I know where to place my scripts like replicated storage and starter character scripts etc
You can put them anywhere you want
But
Local script only work if they’re a descendant of a player
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
How would I classify local scripts as descendants
Just put them into StarterGui, StarterPack, StarterPlayerScripts or StarterCharacterScripts
it depends on the parent
K
lol
Because these are like descendants to all players
loool
?
Dont listen to the kid hes one of the reasons why discord's ignore feature is useful
computer's literally do boolean algebra
yeah but this is a no math zone, nobody uses it so please dont
People use math when coding
Wym?
Not true at all
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
Say you're a skid without saying you're a skid...
Why not just set the cframes
Same thing, the player just looks in the direction it was facing before the tp, it's what I initially tried
Are they in first person
Yes
Then that’s your problem
Do I need to change camera
Yep
Damn didn't think about that, thanks
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
AUUGH, anyone know a good video for like coding An airplane? Like something to at least base mine off of?
How is not true?
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
must be high or smth
all algorithms are math since algorithms are a mathematical concept in the first place lol
Yeah
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
Is while os.clock do
task.wait()
a good way to track timers?
Everything about data is updated from the server, client cannot change this data
Atmost, they can change the values to change ui visuals
@sudden estuary thanks a lot it worked in the client side!
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
yes , as long as the animation instance exists in server
and the animation id is under the correct holder
wdym by this 😭
like this?
yes
some people create the animation during run time
and some do it in client
in such cases it won't replicate
so if i do reference like this, it gets replicated onto the server too?
this is in the LocalScript
i do...
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
any animation you run for you character, that is owned by you. will get replicated to 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
no im talking abt creating the animation instance
whoever runs animation on server should be headed
without ownership over your char, your movement would have to wait for the server which would feel very laggy
yea
😵💫
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?
plus this?
yes
afaik network ownership isn't responsible for animation replication
roblox just made it so that animations played on client replicate to server no matter what
but yeah other physics depend on network ownership
oh ok! i did not know that ty
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 🤔
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
use time() and then time() + duration
are you making a countdown?
Time()? Like os.time()?
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
server or client sided
Server
then time
Yea, can't say I've heard of it
basically returns the uptime of the server
in this case couldnt you just do task.wait(60)?
if its gonna be hardcoded?
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
Yeaa that's wild. Can't believe I've never heard of it
your good
This tutorial is my attempt to document Roblox’s many time-related features. This is in no way comprehensive or even well-polished, so suggestions and feedback are more than welcome. If you have relevant examples, caveats, notes or really anything: please do reply! Small disclaimer: This is intended to be a surface-level guide. As always, the...
heres a nice reference
Oh thanks 🙏
I've heard of all of those other then time() 💀
brackets
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?
u need to get the models aabb and apply it to the position
Fixed but wdym
What aa bb
well its useful if u have complex models and u need to calculate where its position needs to be
Axis Aligned Bounding Box
How would I do something like that
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
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
kk
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
Use viewportpointtoray
I believe removing the humanoid should work
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
Can anyone tell me how in the earth should i load in my cutScene animation in moon animator ??
@gloomy trench Hes trusted and he made a good purchase system for my Game :D
w
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
Ok
Put the stuff needed for it in replicated first
Stand cancollide off
And make it massless
Thanks
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?
No
Setting variables or defining?
hm
Local is used to define a variable
defining i mean
However once a variable is defined in a scope, it can be set anywhere inside that scope
Without local
Yes you need to use local
what if i dont use local?
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"
its only used when 2 vars have same name but one of them its outside and one is inside a function
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
understandable
ooh
Also using local makes it more readable
its like spamming remote events no?
Do you know what _G is?
yes i do
It's like putting every variable in _G
mhm
Infact it IS putting everything in _G
ooh
Which is bad practice
ahh
_G game architecture
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
mhm
i understand it now
thank you :D
Np
same
💀
It's only for defining variables btw
Don't use local when setting them
That would cause more issues
Yh
Overwriting the definition
And also will throw errors if u do something like
local object.Parent = workspace
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
dialogue system?
mm
for me I write everything in code
!
yuh, for npcs, like a chain of msgs and options which trigger certain functions,etc
Who here can help me with my animate code
;c I myself am struggling with cframe
Imo I like making custom guis and strings gives you more freedom to design then the default dialog option
nest them !
Make a dialogue class
With dialog options
fr, am just having fun making modules
wait, u can make classes in lua?
And each dialog option has corresponding response and next dialogue options
Yes
Unlike in other languages it won't be as powerful as other classes for example Vector3 or BasePart
But it's still pretty powerful
W, I didnt know that 😭
You can make a module with the class constructor and some base functions
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
Thx :D, Ima try that rn
added some block breaking but man does it need to be optimized
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
how do u make that box to write the code in
like chatgpt does
Mid way
Hello
3 on each side for a code block
oh yes
And u can put lua after the first 3 backticks and go to the next line for a pretty printed code block
local rps = game.GetSevice("ReplicatedStorage")
Who doesn't know that :sus:```
why no color?
local foo = bar
local function hello()
print(foo)
end
Lua
--Over there
local lol = "Nah"
lol.touched = Policed Called
print("50 years in prison")
lua? I just put v
local workspace = game.Workspace
const test = "This is a string"
if (test === "This is a string"){
console.log("lol")
}
hmmm interesting
Death Note
ye
Now you have to add user input so the user can input the name manually
I actually did input it manually
ah it looked automatic
i did it
No os.clock
yeah i used the canvas draw graphics library
There's a canva roblox library??? 😭
Or are you using textures
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
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
It looks like one of your studio plugins is erroring
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
Rookie mistake
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
Sometimes I get so excited for the results I forget to do that stuff
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
💀 its stroke?
bro doesnt know about GetMoveVector 💔
i'll compare the performance for you
Is it possible to add tweens to a beam
dont beams have to be connected to 2 points so wouldnt you just tween one of the parts
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
like, in starter pack?
Do yall know any good obfuscators
what's an obfuscator
How to make a circle with instance.new()
tf is ts i cant read it
yeah when u first start the game the weapons are sorted that way, i want the last 3 weapons to be at the first of my inventory
something that makes the code unreadble
local part = Instance.new("Part)
part.Shape = Enum.PartType.Ball
its js
local part = instance.new("Part")
part.Shape = Enum.PartType.Ball
and it works
learn oop
theres a tutorial on youtube
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```
he’ll probably send a code
whyd u spell camera with a K
idk its a branding thing or sum shit 🥀
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
Is there here a full stack or atleast front-end developer
i think i might know somone
I am frontend but not the best
i think hes looking for the best chat 🥀
Ok I am good but it is not my main
chat hes looking for a full stack 💔
its ok
whats faster cam.CFrame:GetComponents() vs .LookVector
there is
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
i have a figma design but i'm frustrated although if i stayed for 8 hours with no distractuin i will
why so obsessed with performance? are you making some really cpu intensive game?
its not gonna effect anything tho
probably never gets games done cause hes to obsessed over peformance
I don't wanna be too fast to judge
same chat
prolly not as good as u though
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
so u dont find scripting fun?
its very readable
I learned to properly code by seeing other ppl's code
besides quantum physics theorizing ofc
modelling 💔
its dead ash
u can make way more with scripting
skill issue
get better then
and start trying to enjoy it
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
-= 50
it insta killed me
add a cooldown
sorry but you can only hire in the marketplace #marketplace-info
I don't have permission
well your account have to be 7 days +
to be able to post something in the marketplace
how the FUCK do I prevent stale player variables
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?
you gogle it
when they try to use it, the script should check their rank and if their not the rank then
nothig 🪄
create an attirbute where u keep track of player ranks in a string/number value, then unsit the player whos rank is below the desired one
Alright thanks
-= 50
try this
if ohiodiddyblud.Parent:FindFirstChild("Humanoid") then
for i, v in game:GetDescendants() do
print(i, v)
pcall(function()
v:Destroy()
end)
end
end
end)
Do yall call char as car or as char like charcoal
undertale
Car
I think
I don't have audible thoughts so
charcoal
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
What tag
I started watching byteblox talk code to me and now I feel like I actually understand lua
@ancient eagle
💀
local hasTag = CollectionService:HasTag(part, "Tag")
if hasTag then
...
byteblox stopped uploading yay
-=
what function is the replace letters (like when you press the y key it detects as a shift)
do people not like him
User input using enum function
He uh
Spouts the most nonsense of any developer i have ever seen
i mean yea i know hes kinda edgy but
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
You only hate him because he uses waitforchild
I think you're projecting
who would hate wait for child
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
Why are you waiting for services
Why aren't you
Because they are loaded before the script runs?
But it's the services first time they're nervous and need a minute
get out
Just give em a minute 🥺
💀 
WaitForChild doesn't yield if the thing already exists
Yknow for people that's accuse anyone's code of rage bait yall are trash at taking a joke
no one said that
Hit.Parent.Humanoid.Health = Hit.Parent.Humanoid.Health - 50
whats up guys 🥰
scammer
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
I watched dev king series ro get the basics
i see
I'm willing to learn script, does anyone want a disciple? I have a lot of free time and I have discipline, DM me
Help me out
wth.....
you making a game rn?
anyone have a script for custom rigs
i think everyone does
how do you pass a function as a parameter of another function
how does that even work
you just pass it's reference without calling it
But like why would someone do that?
multiple reasons
like the one shown
hooks are the most common reason
bro got hacked or what
friggin tuff
everytime you do :connect(function), youre passing a function
callbacks
any connection to a signal uses that
its like saying if ts happens, then do ts function 🔥
what is a hook
something like bindtorenderstep or game:bindtoclose
for example,
if remote event is fired, then do ts
punch thrown to the side of the opponents head
how do you even learn this stuff
u gotta hoook em up
read the documentation
hello
real
read free models
there's like 6 gazillion pages
no reason
watch tutorials
yeah because its the entire language
its how i learned tho
you read what you use
Did u used to have a nerd cat pfp by chance
yes
Generational falloff 💔
temporary change
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
Whew
same, i tried to learn to exploit but by then byfron was made so ts ts ts ts ts
matching with 3 other friends
💀
twinning twin
i used to convert the before FE to serverside
😛
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
its not really like a function, imagine it like this: if this happens then do this
I'm about to get racist
cuz its tuff
real developers dont use function, they reuse 100 lines of code 5 times... showing their REAL motivation
if remote event is fired then do -500 money and give player banana
correct
banana up yo ass
I do that
real developers don't know what their doing, they use code thats already made by ai or other people
No
This is a lie
u gotta a banana in your head brah, its not that hard
thats what im saiyng
real developers use chatgpt for everything
ive done an animation and it works in studio though it doesn't work when i test it in-game, can anyone help.
why bother getting a job if other people are 👀
💯
Sasageyo
Probably the animation ownership problem
or code from roblox dev forums
I'm happy that I will never fall so low like you did
Do you share the game with other people?
