#code-discussion
1 messages · Page 54 of 1
man he is stupid
no u
my teammate
he removed the whole script
yeah ill just work on it, sorry for the waste of time have a good day.
No worries
Theirs no audio, I suggest adding some music and mabye captions so they know what to do
Mabye even a voice over
can i get some help with a code?
If I remove the instance will it be removed in overlap/raycast params?
I'm worried about a memory leak
i need to see the code to help
Workspace.Cow.Beef.Script:15: attempt to index nil with 'WaitForChild'
how can i fix this problem?
theres no waitforchild in this script
Show the correct script
then how can i get the leaderstats without it?
the thing is it isnt
and not findfirstancestorwhichisa
could u help me with that
cuz my code works like fully
but it gives me that error and when i respawn it doeesnt work
define the character as local Char = hit:FindFirstAncestorWhichIsA("Model") :: Model
then plug it in to find the player from the character
wdym by this
i added the var above
but i dont understand this
replace hit.Parent with the one i just told you
ahhhhhhh
how can i identifiy leaderstats then?
i dont know why hit.Parent is the "default" people think of for finding character from hit
the hit can be an accessory and end up being deeply nested
bro no way this fixed that
bruh thank you so so so so much
i have had this problem for like 4 days now
yeah exactly, hit.parent is a stupid way to find a character from a touch event
i mean yeah it works sometimes and sometimes it doesnt like wth
do the same thing i did for the other guyh
local character = hit:FindFirstAncestorWhichIsA("Model") :: Model
also could u help me understand what that code actually means ion want to be a dumb ass i wanna actually learn what it means
this line
i want to know what it does
do i have to change "Model"?
its a tree traversal search
ahh alr ty
2 or 4 could technically be the be the hit
maybe even an 8
i dont know how nested it gets
god damn u got knowledge
yeah
anyways ty again i almost lost the motivation to work on this game i had gotten help from 4 different programmers and searched the entire internet
i think this is better res then the last one i made
who scripts + does vfx i need sword effects for my game dm for details i pay per task
it couldnt identify leaderstats at all
?
just scroll up
why do people think hit.Parent is the best way to find the character
this is imo
your error isnt even from this script
then from what?
ay bro i need another help
when i die and respawn the code doesnt work
but the gui is still there
the ui?
turn resetondeath off on the ui
those error at the bottom doesnt belong to anything
i did that already
like a bug
then whats it doing
you have no error from that script you showerd me
what its doing is making the gui invisible but it isnt teleporting me back to the spawn
i tihnk the error is that the code cant identify the player after it dies
idk how to fix that
youre also checking hit.parent stuff at the top, try my way and make sure the model has a "Cow" child
Humanoid.Died
so i should make it when the humanoid dies it makes the gui invisible
and when it respawns back
it becomes visible again is that right?
if thats what youre trying to do, yes
died, make it invisible, character added, its visible again
but when i touch the part it doesnt give anything or show me any error and not working
alr tysm
thats probably because your if statements at the top
someone hire me!! i need money
cant post there
send code i don't think you sent the right one earlier. it might help to name your scripts
I re did the script but doesnt send any error
so is there still a problem?
yes
I enabled it first
the amount of meat that you get
make sure its not 0 and put a print after the if statement to see if exeuctions gets passed that if
wym
when i touch the part, its sends me Workspace.Cow.Beef.MeatCollect:13: attempt to index nil with 'FindFirstChild'
what is the new code
still with the same error
Workspace.Cow.Beef.MeatCollect:13: attempt to index nil with 'FindFirstChild'
so it seems like leaderstats doesn't exist
i think its the leaderstats i doubt something with a humanoid thats not a player is touching this part
what did you change
BeefModel.Touched:Connect(function(Hit : Model)
local Player = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
if not Player then return end
Player:FindFirstChild("leaderstats"):FindFirstChild("Meat").Value += Amount
end)
Also the error is prob bc NPC's can also trigger the event, given that you check for humanoid instead of actually checking if its a player
function StartTutorial()
print('starting')
game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true
local cloned_element = UIs_Module.HighLight(Announcements_Frame)
UIs_Module.updateTextLabel(cloned_element.Title, "This is where the announcements are made.")
wait(3)
UIs_Module.HighLight(nil)
wait(2)
step = 1
UIs_Module.updateTextLabel(Announcements_Frame.Title, Orders[step])
wait(3)
step = 2
UIs_Module.updateTextLabel(Announcements_Frame.Title, Orders[step])
local beam = Instance.new("Beam", workspace)
beam.Attachment0 = workspace.Forest_Map.Shack.Main.Chairs.Chair1.Seat.Attachment
beam.Attachment1 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootRigAttachment
beam.Texture = "rbxassetid://51478209"
game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = false
repeat wait(.5) until set == true
beam:Destroy()
step = 3
Announcements_Frame.Title.Text = "Good !"
wait(1)
Announcements_Frame.Title.Text = ""
UIs_Module.updateTextLabel(Announcements_Frame.Title, Orders[step])
Remotes.Tutorial:FireServer("NPC")
repeat wait(.5) until step == 5
step = 6
UIs_Module.updateTextLabel(Announcements_Frame.Title, "Now if the players find your response correct or good they can vote for you to get gems.")
end
StartTutorial()
is this a good way to make a tutorial game ?
idk
theres plenty of ways to make a tutorial
theres not really a true definite right way
uh yoda
could i myabe get some help with this
is anyone willing to volontear to help me with something
with what
so the entire gui is fixed now
guys can yall name me a fair price for someone to optimize a roblox obby? im not good at scripting
but when i reset the gui doesnt teleport me back to spawn
when i click on it
it does remove the gui when i click on it but doesnt teleport me
i just looked backa t your code
and the teleport and resetting the gui lines and in the same function
if you dont know how to code, why are you trying to optimize
why do you have nested touched events
oh wait
wdym
nvm im stupid nvm
OH NO
a touched event inside a touched event
i guess it depends on how are they gonna recode ur obby
this my new code
cuz its crashing players and it uses high cpu, but my knowledge is 0 lol
i was on some drugs before
still a little weird to nest a connection inside a connection like that
i made it better and removed the ones i didnt need
dont do this btw (handling gui in server)
yeah you could put that all on the client
like local scripts and in the starterplayerscripts?
yes
ah
alr ill try that maybe it fixes the problem
you can run normal scripts in the character too btw
server would need to fire a remote that the client uses to reveal the leave game button
okay so the thing is
how do i refer to the part in my script
its in the starter player scripts now
before it was a children of the part
you need multiple scripts
so all i had to was script.parent
find where its located in workspace
i did that but it gives me an error alr but ill give it a go again
waitforchild
If a client call LoadAnimation on the animator which is server side, and then play the track, will the track also be replicated onto the server?
you can also make your code cleaner by using guard clauses
I could take a look at it if u want me to
if not player then return end, instead of if player then
waitforchild if it doesnt load
waitforchild my guy
should i do game.workspace:waitforchild?
If the answer is yes, that would be a weird thing to do because it would consume server resources for nothing
sure, its group game tho
you shouldnt need multiple wait for childs, only one on a part like that
you can downlaod a copy of the game and send me that
and put it on the last one
may ik why wait for child is so important there?
the client takes a while to load in
in the client instances are not immediatly loaded when the script runs
as its taking a copy from the server
waitforchield yields the script (aka stops it) until the instnce is loaded or it timeouts if it cant find it
make sure you dont do something like game.Workspace["Teleportation Portals"]:WaitForChild("Portal2"):WaitForChild("Teleport")
you will only ever need one wait for child
and it would go on the last instance
okay so its glitching out
it teleports me to the spawn but my character like disappears
my camera is at the spawn but my character isnt
after 2 seconds i go to a random place and i can only see the sky
show the script again
still dont know why you nested your connections
can u explain that one in monkey terms
im new to coding
my simple brain cant under this
a mousebutton1click is inside a touched connection
understand
so should i make a new function outside of the touched event
ahhhh
alr
okay if i do that then i cant access the variables above like char and player
how do i fix that
move it ouside the scope
you dont even need to define the character as the hit anymore, if its local it will already know
local Plr = game.Players.LocalPlayer
local Char = Plr.Character or Plr.CharacterAdded:Wait()
on characteradded redefine the character and humanoid if you use
alr
yep i fixed that
but there is still an error
the error isnt fixed i just teleport to a random place
you should be teleporting to that vector
alr im gon teleport to a different place lemme see
what the hell it teleports me to that location but my camera keeps on moving like crazy and after 2 seconds it just dies
instead trying Char:PivotTo(Vector3.new(-9.348, 5.473, 32.468))
wait
it expects a cframe iirc
alr
Char:PivotTo(CFrame.new(Vector3.new(-9.348, 5.473, 32.468)) * CFrame.Angles(0, math.rad(90), 0))
np
like for what reason it requires :pivotto
or cframe
and why not the humanoidrootpart's position
pivot is for moving the whole model i think
Nobody is helping in code help so ima ask here
Anyone got an idea how to make it so when a user follows me and they rejoin they receive a prize like a pet in game for example ? And after they receive it they can’t get it again
If it’s even possible
ahhhhh gotcha
| Right.X Up.X -Look.X Position.X |
| Right.Y Up.Y -Look.Y Position.Y |
| Right.Z Up.Z -Look.Z Position.Z |
| 0 0 0 1 | i think this is right
the 4th row is for the affine transformation iirc? hardly understand what it means but just know its usually 0 0 0 1
roproxy service
Players.PlayerAdded:Connect(function(player)
local success, result = pcall(function()
return HttpService:GetAsync("https://friends.roproxy.com/v1/users/"..player.UserId.."/followings")
end)
if success then
local data = HttpService:JSONDecode(result).data
local followsTarget = false
for _, follow in pairs(data) do
if follow.id == targetUserId then
followsTarget = true
break
end
end
if followsTarget then
player.TotalBoostLuck.Value = player.TotalBoostLuck.Value + 0.15
end
else
warn("Failed to check follow status:", result)
end
end) ```
make targetID your id and change the boost to whatever
whats the error
its disabling the gui but it isnt teleporting me back to the spawn
Ty
there is no error shown in the output but it isnt working
did you die when that happened?
you didnt redefine your character
and reset on spawn is disabled
thats what i need help with
i have been trying to do that but i found like 10 more errors and i fixed them but i cant fix the error that im trying to fix
local Plr = game.Players.LocalPlayer
local Char = Plr.Character or Plr.CharacterAdded:Wait()
Plr.CharacterAdded:Connect(function(NewChar : Model)
Char = NewChar
end) ```
bruh how do u do this shi 😭
wdym
ur just talented 😭
okay so i can understand everything except the plr.characteradded part
why did u add that
ty, look at documentation it helps learn roblox API
because thats a new character
Can y'all help me
yeah i learned half of what i know from documentation and yt
what does newchar : model do?
when you die and dont add that, it was referencing the old character
ahhh
thats a type check
Where the scripts at
ohhh i see
the first param on characteradded is the character, saying : Model means its type is a model
replacing the old char with new
alr alr
a
yall im a solo dev, who wants to try my game i have really good system and i want to know any improvements on what to add?
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢀⣴⠟⠋⠉⠀⠀⠈⠉⠙⠻⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣴⠟⠁⠀⠀⢀⣀⣀⣀⠀⠀⠀⠈⠻⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣼⠃⠀⣠⡾⠛⠉⠀⠀⠉⠛⢷⣄⠀⠀⠘⣧⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢸⡏⠀⢰⡏⠀⠀⠀⠀⠀⠀⠀⠀⢹⡆⠀⠀⢹⡇⠀⠀⠀⠀⠀⠀⠀
⠀⠀⣿⠁⠀⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⠀⠀⠈⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⣿⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⣿⠀⠀⣿⠀⠀⢀⣀⣀⣀⠀⠀⠀⠀⣿⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⣿⠀⠀⠹⣆⠀⠘⠿⠿⠛⠁⠀⠀⣰⠏⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢿⡀⠀⠀⠙⠻⢦⣤⣤⣤⣤⠴⠞⠋⠀⠀⠀⢀⡿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠈⠻⣦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣴⠟⠁⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠈⠙⠛⠒⠶⢤⣤⣤⣤⠤⠶⠒⠛⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
i want to make a function that spawns in different types (like shopper, criminal etc) of npcs simultaneously
i was thinking about creating a thread, for each npc type, with a while true loop that spawns the npcs of its type every random seconds
can anyone help me on the best way to go about this
im not sure my idea is efficient
your idea sounds fantastic! it really depends on what you want pacifically.
wdym pacifically?
Put the buttons less on the edges when doing the minigame.
Also where do I sell
he means specifically
like so you basically explained that you want an npc that spawns with a diffrent outfit randomly, correct?
its not really a different outfit
its actually the action he's supposed to do
for example a shopper npc is going to go shopping
you cant sell yet 😓 im a solo developer does the game look for 3 days? as a really busy person
a criminal npc is going to do criminal stuff
are you using oop to construct the npcs?
yes
Add a smaller bounding box for the buttons.
you can make a spawner function that takes in argument for type of npc and maybe amount and then just do get a random npc and call it with task.delay inside of itself
i would make an array of all the possibilities, then loop through them using random function if u want it random
what im trying to do is similar to restaurant tycoon ,where each player has its own restaurant and each restaurant (im guessing) has its own npcSpawn function
the thing is, a game like restaurant tycoon would only have "eater" npcs
are you using subclasses or extending your npcs? Criminal = setmetatable({}, (__index = NPC}) or something else
and in my game i have airports instead of restaurants, so in an airport npcs do different stuff
are you using pc or phone? on the game
yea but depending on the type of npc i also have different behaviors you know
i mean the behavior is the same (following a pre-defined path), but different type = different path
just make a dictionary with functions that control the behaviour and then call it based on the npc. you can have the npc’s name as the key for example
like, the "shopper" npcs should follow the path that leads them to the shop
if youre using subclasses just use polymorphism to override the existing spawnfunction on the main class
the "eater" npcs should follow the path that leads them to the restaurant
not using metatables because they're complicated
i thougght you said you were using oop
dont use them either they are bad for oop
polymorphism is the best use case for different functions that inherit off the main class
i just pass the instance as the first parameter
because it has fundamental flaws i cant remember
none ive heard of
i cant attach links
so your constructor passing in the mode such as criminal and shopper?
that video is about not using metatables
i havent defined the various modes yet
you are not using metatables so you can still use methods
exactly
as in : functions
well either way even with metatables you can still use methods
i am using methods just not directly on the instance
sounds like youre overcomplicating it
theres no point tho
it is a little verbose
but it looks clear enough to me
can we go back to the npc problem pls btw lol
i do
? i thought you werent using oop
ok interesting
metatables just make it so u can call the methods directly on the instance
like npcInstance:getGender()
no
the way i do it is Npc.getGender(npcInstance)
methods can be attached to any table
metatables just make it so you don't have to store the methods in the same table
metatables are for manipulating/overriding table behaviour
okay
i think using one would help you
which is against the core idea of oop and it makes it slower 💔
honestly i couldnt really understand metatables so i decided to use oop this way
yeah its not real oop in lua but it works
metatables are bad for oop
good dont use them for oop
🙏
you should only be aware of their existance and use them when you reallyyyyy need to
just use my method
this is how i was doing it before with just one type of npc btw
don't mind the second parameter passed to loopSpawn()
i cut some code out
ok
so should i run on a single thread like i already am doing
put the npc types into an array and then choose a random number in the array and spawn the type at the chosen index
do you have it to where like npcs named female and the other male try to clarify it more in the code?
yeah i think it should be fine for what you are trying to do
that's pretty much the only place where npc gender appears
is this a good tutorial i made
its just to know whether i should use a male model or a female one
well what about for large airports
where a lot of people come in
in real life you have multiple people coming in at the same time you know
scripts in parts 🥀
i told him not to use hit.Parent
well it depends i see you have a spawnrate over there
use collectionservice
yes its pretty good but try to explain more like what local does and function and etc.
so if you want it to be faster then maybe make a constant at the top that specifies the amount of threads and then just create them in a for loop
this isnt a advanced tutorial yet
this is beginner
oh i see
bet
you are teaching bad habits to beginners then
make it use hit:FindFirstAncestorOfClass
so people stop using hit.parent
so intead of having a thread for each type i just use N amount of threads to spawn various types
nuh uh
i am a beginner myself
and i dont find it bad habit
if you want it to be faster then yes
the blind leading the blind ahh
then why tf r u making tutorials
cuz i want to teach my own kind
u think the game is going to suffer from bad performance if i have like 6 airports
with say 3 spawn threads for each
DOESNT SOUND RIGHT
nah threads wont lag the game
wdym
but the functions will
i have like 300k trheads in my game
if they are bad or have laggy stuff in them
in this case its just about following a certain path
that's pre-defined
its just a vector of cframes that the npc must reach
what race
💀
cframes are 4x4 matrices
all
for each cframe in vector do
reachCframe() --this waits until the cframe was reached
end
🤣 it got me when you said your own kind lol
vectors dont have cframes
if it is predefined path it should be fine
vectors are better if you ydont need orientation
cframes are not vectors
yes cframes are 4x4 matrices that include rotation and the affine transformation
vectors are just 3 points
yes cframes include vectors but cframes themselves are not vectors. thats like saying coffee and fanta is the same because they are both drinks
paused threads
either way only 1 thread can be running at a time
right
in a vm
its just a bunch of task.spawns
yeah they would be paused most of the time
waiting to be resumed by either task.wait or whatever paused them
they dont have long execution times either
Explain cframes to 9 yo
Dm me if u do death effects (no vfx needed just know cframes)
ill pay per task/effect
No I'm in 8th class
what does this mean
So where
can u do cframes.
8th grade/standard
yea
can i commission you? i need death effects.
i have like 10 projects
i already explained cframes to you
u dont get moderator by doing that ❤️
Ik
I keep seeing this guy everywhere
Do cats actually do that?
i dont own two so i havent seen in my own eyes but i think so
I take most important decisions of my life in morning in bathroom idk why
I literally used to think of game ideas in the bathroom and it helps me think
I'm in bathroom rn☠️
Yeah I don't like it
Just put your phone away
little weird
Okayyyyyyyyyyyy
Might as well watch TV while taking a shower
the shower 💪💪💪
phone
ohh phone is glitched lol but i fixed it
.
Published fix?
uhm im still able to move and everything but my couch is not being a tool
yup it spawns into a frame on the middle of the screen
@Someone
You want to make your couch a tool?
sam!!!
:/
I haven't met you before
yup
Istg you guys have weird ideas
anyone know how to show orientation indicator?
I have a question i am making a Skill With moon animator But Idk how to make the Vfx Visible how do i do it ?
whats the problem
slider going off the backgroundbar
local Slider = script.Parent
local Fill = script.Parent.Fill
local Trigger = script.Parent.Trigger
function UpdateSlider()
local output = (Mouse.X-Slider.AbsolutePosition.X)/Slider.AbsoluteSize.X
Fill.Size = UDim2.fromScale(output,1)
end
local sliderActive = false
function ActivateSlider()
sliderActive = true
while sliderActive do
UpdateSlider()
task.wait()
end
end
Trigger.MouseButton1Down:Connect(ActivateSlider)
game:GetService("UserInputService").InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
sliderActive = false
end
end)```
im in the middle of a making a slider for a volume setting
i think i have a slider in one of my projects
i had to use a canvas group
for the bg frame
oh
Is it good to use proximityprompt?
is ur couch a model
For popping up billboard gui
local Mouse = game.Players.LocalPlayer:GetMouse()
local Slider = script.Parent
local Fill = script.Parent.Fill
local Trigger = script.Parent.Trigger
function UpdateSlider()
local output = (Mouse.X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X
output = math.clamp(output, 0, 1) -- Clamp the value between 0 and 1
Fill.Size = UDim2.fromScale(output, 1)
end
local sliderActive = false
function ActivateSlider()
sliderActive = true
while sliderActive do
UpdateSlider()
task.wait()
end
end
Trigger.MouseButton1Down:Connect(ActivateSlider)
game:GetService("UserInputService").InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
sliderActive = false
end
end)
try that
@high stream
yea what are u using it for
For example getting near a part it shows up billboard gui etc
And interacting with it
worked like a charm
thanks
np
Is it a good choice to use proximity prompt in this case or scripting that part is more preferred? @high stream
use the proximity prompt if ur a beginner since its easier
But what’s the best choice? Scripting it?
you have more customization if u script it
wdym by best choice
performance?
Idk 😭😭
i dont think it matters based on performance
the proximity prompt
Alright thank youu
np
No…?
mistake
yea
if u want a fast and easy way to add a button that can be pressed using keys/controller buttons is okay to use proximity prompt
but for more complicated stuff youll need to script it urself
Hmmmmm lemme think of an example
u can change the keybind
Okay what if I want the interaction to be with an image then?
Costume button
Oops typo
ive seen it be done but im not quite sure
Oh complicated right?
you can change how the proximity prompt looks
if i remember correctly
yea u can
Alright thank you, but if I use script instead it wouldn’t make much difference right if it works?
you have to set a property so it uses a gui that its parented inside the proximity prompt
i dont remember that well cause i usually just use billboards
But don’t you need something like proximity prompt to interact with it?
you dont have to use proximity prompt to make billboards interactable
again, proximity prompt is the quick and easy way to add a billboard button
but it doesnt do anything else other than what its designed for
Interactable Billboards is like the advanced mode of proximity prompt
So you make a script for it to interact? With custom gui?
Alright thanks
Also module scripts, it’s used when you have a lot of scripts doing same thing right?
not necessarily
i personally use them more as like libraries tho
Meaning?
library is essentially a collection of functions that a code can import from (so you dont have to write em into the code itself)
But isn’t library storing scripts then to use? That’s to prevent same scripts being duplicated bunch of times right?
functions not scripts
Oooh okay
Functions I see
my library has helpers that i can use universally between games
not really
Not a necessity but its a good way to organize games
and to also update multiple scripts
And are there times where using modules may ruin the game? For example let’s say you creating an npc and its attack function is the same and you have 3 diff types of npcs and you use module to store the attack function
i use my own framwork which isnt a "necessity" but so helpful
they can just be objects
not really unless ur misusing em
But is that a good time to use it?
What do you mean? The npcs?
that object orientated for what youre pointing at not just a modukle
I didn’t understand my bad 😭
Yoda Imagine you making a npc for attacking running, will you use module for its running and attacking functionality?
well yeah bc the 3 npc's share an atatck function
Ooohh, so module can make everything for it?
unless their attacks are unique, why not just write one attack function they can use form the module
when you make a new object youre giving it meta functions (perchance) and varaibles so it wont ruin it
yeah
I see
withtimeout and oncomplete are metafunctions that can be used for each constructed object created in new
Thank you both of you
can someone hire me 💔
rl
I didn’t fully understand but uhm I think I got the core idea
Do you guys also put tables in modules?
if its needed yes
when you call the with timeout youre passing in the constructed object automatically so it runs for that object
self is the first parameter for : functions
Ooh alright I think I get it a bit now
Also when making custom inventory for players it doesn’t need module right?
For what?
as a library
backpack type inventory or a different one
for functions that i need to call multiple times
Alright alright, I will try learning on Google about it more aswell, but thank you guys
I hope I didn’t bother with too many questions
i dont think you understand how modules work
nothing NEEDS modules, it just makes life like
Can someone give me an idea on what to script : D
50x easier
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remotes = ReplicatedStorage:WaitForChild("Events")
local SpellCast = Remotes:WaitForChild("SpellCast")
local Spells = {
Motus = require(script.Parent.Parent.Runtime.Modules.Spells.MotusCast),
Incendia = require(script.Parent.Parent.Runtime.Modules.Spells.IncendiaCast),
ErroxFemus = require(script.Parent.Parent.Runtime.Modules.Spells.ErroxCast),
Tornado = require(script.Parent.Parent.Runtime.Modules.Spells.TornadoCast),
Strangutare = require(script.Parent.Parent.Runtime.Modules.Spells.ChokeMeDaddyCast)
}
SpellCast.OnServerEvent:Connect(function(player, spellName, ...)
local spell = Spells[spellName]
if spell and typeof(spell.Cast) == "function" then
spell.Cast(player, ...)
end
end)
is this good or na
does it work?
Anyone here over 3 years of scripting experience?
Yes! I have a variety of experience with prints. Worked over 3 years with them.
💀 🔥
.
code my roblox game
code my roblox game
u paying?
what ur price
They aren't chatgpt dude
dms
They the new Model: HumanGPT
if my brain could work like chatgpt i wouldve been rich
chatgpt is extremely limited to programming, so u would need another job
Well it´s a chat bot
But that other guy said he would be rich
yes probably cause his "knowledge"
but for what job
That could be "activated" in seconds
Different type of jobs
investments
can someone help the tool is not going into the player's backpack
local Context = game:GetService('ContextActionService')
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local Hum = Char.Humanoid
local Tool = Instance.new('Tool')
local Handle = Instance.new('Part', Tool)
Handle.Name = 'Handle'
Tool.Name = 'Test'
Tool.Parent = game.Players.LocalPlayer:WaitForChild('BackPack')
oh so like lower rcase?
yea
tysm bro
np
yo
Abyss, when making an egg hatch for example in game do they animate it by script or manual?
idk but i would "animate it by script"
ah yes modularisationa maake me moan
😭
you no like modularisation?
no theres so many modules
yeah its good for scalabilty
lf scripter who can do combat system, scripting animations and VFX etc dm for more info (small- medium) tasks.
anyone know how to make it so if u buy a gamepass it makes the player equip a hat?
Any good programmers here?
this looks like a nightmare
Maybe
can someone PLEASE help with this. i want to make a hat gamepass that if u buy it the player equips a hat. im not sure how to do this please help
pleasee brooo
yo im project manager for a group with me and my mates, currently building a team to make a gang beasts inspired game with the goal to spend no money, if anyones down to code the game with me (bring as many mates as u want but u will be splitting the % between u). The payment will be commision once the game has released
dSGZORNG
I HATE
CODING
WHYAMIDOINGTHIS
I AM JUST A CHILD I SHOULD BE GOING OUTSIDE
I FUCKING HATE THIS
😭😭
IDG
I FUCKING HATE EVERY ONE
KFJGZJFGN
FGZDFGFDHDGDG
What the freak
Can anyone fix a small bug in my game, I’m able to pay
if you go to #scripter-hiring mayhaps
or show the issue
most people here will help fix the bug for free if you jsut show it
just wait for irl job as programmer.. for your first sallary 😄
Is there any plugin that helps autoattach a player to a alignorientation / alignposition in a part
anyone know how to fix this
i want my player to move with the part but lowkey theres like 0 script help tutorials or anything i can find in a forum that helps with sticking a player to an object
while Sounds.ButtonSfx.IsPlaying
or
if Sounds.ButtonSfx.IsPlaying
Also selected doesnt exist in that function(?)
what should i do instead
What is selected supposed to be?
if (I asume )Value.GuiState.Selected == Enum.. and Sounds.ButtonSfx.IsPlaying then
what about this?
if condition and condition then
--code
end
I am not an UI expert, but are you sure .selected exists?
https://create.roblox.com/docs/reference/engine/enums/GuiState
wait I didn't put the code
what am i looking at
idk lol
anyone know how to make the awakening bar fill up? like how to set it up and make a topbar with a characters dropdown, shop, settings and emotes
what is the best line of code in the entire world?
workspace:ClearAllChildren()
can anyone recommed a tutorial for the topbar v3 plus?
more like workspace:Destroy()
game:Clone()
This would make about 4999 copies of datamodel before it would crash if this method would've worked
print(“Hello World!”)
print(“Bye World :(”)
game:Destroy()
can anyone recommed a tutorial for the topbar v3 plus?
local Color = game.Workspace:WaitForChild("color")
local touched = false
Color.Touched:Connect(function(otherPart)
if not touched then
touched = true
print(otherPart.Name .. " touched the part!")
task.wait(1)
touched = false
end
end)
It's giving error attempt to index nil with 'Touched' 😦
hey, can i apply attributes to players ?
Yea
Not with that code it ain't
does anyone know where can i find free assets to use since im learning and i dont want to see see stuff that ugly for now
If you put a UICorner and UI stroke as children of the buttons it should look less ugly
No scripting required
yeah i know i meant stuff like that
alr thx
Anyone here scripter . modeler or animator?
yes it would work, you just need to make a client side script to send the message and in the sever display what you said with billboard guis, but yo may want to make a filter for it
can anyone recommed a tutorial for the topbar v3 plus?
Any tips how to start with scripting Grind building system? Basically how to limit movement by studs (grid) and get position of mouse in 3D
local testPart = game.Workspace:WaitForChild("testPart")
local touched = false
local function changeColor()
testPart.BrickColor = BrickColor.New("Toothpaste")
task.wait(1)
testPart:BrickColor = BrickColor.New("Medium stone grey")
end
testPart.Touched:Connect(function()
if not touched then
touched = true
changeColor()
task.wait(2)
touched = false
end
end)
It's not working 😦
is it local or server script
Only script
hmm
try printing "touched"
to see if it actually touches
Ok
is it possible to restrict mouse movement within a specific radius on the screen?
or would i have to create a custom mouse for something like this
wdym like the mouse gets stuck?
stuck but not in a way where it can't move at all
hold on
so there's the screen, which normally your mouse can't move beyond, but it doesn't get locked when it reaches the edge, which is exactly what i wanna do with the mouse in the radius
i can just set a central rotation point for what i wanna do, but then if i move my mouse too far one direction and keep moving the cursor in a circular motion, it obviously stops working the way i want it to
because of that actually, i kinda want the mouse to only be able to follow that circular line
Then you will need to make your own
Can't you just check if mouse position gets outsize Y X of that area, force its position to border?
just bought violet valk, w or l purchase?
i regret it already ❤️
At least you can pick up huzz or duzz at club Iris now
lol right it will look even better if u buy headles
lowkey goated
Sick, easy as, thanks dude
u just gave away your game idea
💀
also add a option to go back
for the previous prompt
not only next
its coming out tmr and i got budget for the ads so theres no way someone within 12 hours gonna copy
😭
oki dokie
you're smart
BUT U LOWK SCARING ME SO GOOD IDEA
i thought its fine bc its a short tut and you can spam next
yeah true, thanks i'll add that
my script works but there errors like in the leaderstats that lead to freezing the game (not from my pc)
L
Naruto puzumaki
big L
also change the text on the client
also this is pointless
I solved it
why the hell do u change a textlabel on the server
does anyone actually like the new explorer ui
there are so many errors there man
i dont blame him hes a begginer
yo
What
someone can leran me lua?
pay me and ill teach u some sh*t
when you do inventory systems, for weapons that have unique qualities (like an enchant or modifier) but also items that can be acquired at high amounts without modifications (for example, potions or resources), should they be stored in arrays or dictionaries, or should I use a hybrid system for this?
ngl this sets you up for everything
though there are some other good stuff to know like in BrawlDev's tutorials, everything in this is a fundamental
local weapons = {['Norma'] = {Enchants = {}, Quantity = 0}} etc
ofc u can do table.insert but im not gonna write it all
write it all
So something like this?
local inventory = {
['Sword'] = {
['Enchants'] = {}
['Quantity'] = 1
['UUID'] = D098HSDKA24921GHJG -- jibberish
['Health Potion'] = {
['Quantity'] = 1
}
ya
I see, interesting
or u can do an event called Add Item and then local Inventory = Decode(Data.Inventory.Value); -- json
if Inventory[ItemName] then
Inventory[ItemName].Amount += Amount;
else
Inventory[ItemName] = {
Item = ItemName;
Amount = Amount
};
end
then set the new value to Encode(Inventory)
Your problem is the boundaries. Take a base price of 2000, you buy a land with this price so the new price is 2000 * 1.2. However the price is now greater than 2000 so the reverse multiplier 1.05. This makes the sell price 2000 * 1.2 / 1.5. So the user makes a profit of 2000 * 1.2 / 1.05 - 2000 ~= 286.
If you want to account for this you need to check the previous adjustment when doing a reverse. Check if dividing the multiplier of that adjustment lands you in range of it, if thats the case then use that multiple to reverse instead.
For example with 2000 * 1.2 you would use the second adjustment normally, which means you check the previous adjustment first by dividing 1.2, 2000 * 1.2 / 1.2 = 2000 <= 2000, thus use the first adjustment to reverse instead.
Ideally you would use a function that takes the number of land as input and manipulates that to return a price rather than a recursive one.
Then you can reverse with the price of #land - 1
hey guys, i started learning how to script like 6 months ago, its going really well but now im confused. I can make many cool things but im not that good to make some more complex stuff like whole egg system etc. what should i do now?
keep on doing stuff untill u can
why do people make simulators when they start scripting
and a egg system aint hard its just alot off tweening
simulators are like the hardest shit to make, rpg games are the easiest unless we talking about easy sims
yeah thats the hard thing
like what stuff
roblox sims usally take up to 1 month to create ???
scripting stuff duh
should i take commisions?
maybe a sim that has nothing in it
no u just create a tween play with the values untill u see something u like
u could
a good sim takes a shit ton with the framework and everything else
tell me 1 good sim on roblox
never heard of it
anime and good lmao
send ss
especially in roblox
btw crimson what should i make for my portfolio cuz i have no idea, i just made 2 things that are pretty simple for my youtube
that is enough put those in ur portfolio
the more u make the more u can put it
its not even that its hard, its just that it takes a SHIT TON OF TIME to make, cover all the systems, make sure there arent any bugs, and they did it insane, and the math in there is very hard to make too
but they are pretty simple and idk if people will like it
fun fact most hirers arent coders so they dont care about how it is scripted they just wanna see the function of it
^ not true btw
it is lol
unless u code for a 3year old then no
most players who are looking for a scripter cant script them self
can you tell something more, if you argue with his opinion please give some arguments on it
ya but they have basic understanding of how a script should look
lol no
yes
so what
even if
all they want is it is ez to either add stuff to it things like that
and it has to work good in game
i only made inv save system with custom item saving and codes system
dont listen to him, when u start getting hired by people who have experience they will not hire u anymore if they dont like how u organize
but showing portfolio usually isnt showing a script though
CrimsonVH — 5:23 PM
fun fact most hirers arent coders so they dont care about how it is scripted they just wanna see the function of it
thats what i think
who have experience
ye cuz its true ???
listen im not gonna argue anymore please dont listen to him
if they could code themselve why the hell would u hire someone
do what u think is best for u
yall/you have way more experience than me and went through allat
if a normal player is playing a game do u think they care how it is programmed no all they care is about how good the game is
learn how to organize, please type in either camelCase or PascalCase, keep things in check dont try to go for the easy way to make a script because its bad practice
and thats the way u make ur game have 30 bugs
oh yea no i agree on this
so uhmm
some cool code
Lf smone to make inventory ill pay 700 robux
local testPart = game.Workspace:WaitForChild("testPart")
local touched = false
local function changeColor()
testPart.BrickColor = BrickColor.New("Toothpaste")
task.wait(1)
testPart:BrickColor = BrickColor.New("Medium stone grey")
end
testPart.Touched:Connect(function()
if not touched then
touched = true
changeColor()
task.wait(2)
touched = false
end
end)
It's not working 😦
touched is always false, does it change anywhere?
nvm im dumb lol
bro
testpart:BrickColor
please use Script Analysis
doesnt it highlight the errors even without script analysis
yeah only if you run it it outputs errors in output
i remember it would've highlighted the : with red line underneath it
how did bro not notice the long red line
oh yeah
💀
can someone help me make a game in roblox (i will give 35% of the entire earnings of the game) i am looking for someone with experience to work on GUI and script
what is the error here
if youre using string keys use the [] bracket, ["Play"] = true; or just Play = true without it being a string
ty
@bleak glade Yoda when making for example pet inventory is it better to script the folder where pets will be or a manual folder?
what do you mean?
the actual pets or where theyre stored
I’m tripping
U put brick color as a method
i need someones help please
my animation doesnt play even tho its set to action
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildWhichIsA("Animator") or Instance.new("Animator", humanoid)
local holderModel = ReplicatedStorage:WaitForChild("HolderAL"):Clone()
holderModel.Parent = character
for _, part in pairs(holderModel:GetDescendants()) do
if part:IsA("BasePart") then
part.Anchored = false
end
end
local cube = holderModel:WaitForChild("Cube")
local leftHand = character:WaitForChild("LeftHand")
local motor = Instance.new("Motor6D")
motor.Name = "HolderMotor"
motor.Part0 = leftHand
motor.Part1 = cube
motor.C0 = CFrame.new(0, 0, 0) -- adjust position if needed
motor.C1 = CFrame.new(0, 0, 0)
motor.Parent = leftHand
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://86365348603778"
local track = humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = true
track:Play()
print(" Animation playing using Motor6D")
paying 2k robux for someone to recode my game its a simple game ngl
how big is the codebase
Like hmmm, when you make a inventory for pets right, and you create a new storage for it by script instead of manually making a folder for its pets
How do I make a part move up and down
Use electromagnetism
In Roblox Studio
What's the difference between Remote Events & Remote Functions?
Remote events are one way
Remote functions are 2 way
i use tables for pet storing not folders
guys i have my code here but i talk to the npc my name and avatar pops up but no the npc one but i cant manage to delete my avatar in this script what and where do i delete?
server isnt dat good lowk
this is the code
replace with ur npc namme
how does one go about making a projectile system with dynamic physics like the one that diddy forces has where you can lead your shots and colliding with the projectile while its still moving will damage you
thank you
"lke the one that diddy forces has"??
which line btw
DURRRRR
phantom forces
21
could you show me your setup
ya sure in a bit
That only changes the name of the character
the script
it does this now
how much?
Since when can I store tables in datastores?...


