#code-discussion
1 messages · Page 3 of 1
?
chat tags with textchatservice are made on clients now but do they replicate to everyone? like does everyone see them or only that client
that newish audio api & associated instances
realistic two-way repeated infrastructure/subscriber??? potential
ray casting to simulate vhf/uhf wave propagation 🥺
you can do it
and the property in audolistener is pretty much a talkgroup
why
So I've been wondering for a while how pls donate can have 2 leaderboards which 4 different time periods, essentially 8 leaderboards without hitting datastore limits. I can't even have 2 datastores working at once, let alone 8
@tacit tendon if you use modules i think you can also return typechecked table in general
because they dont update every second
They update every min
they have intervals and they update the data on leave/every few active minutes
also having a data module really helps
Oh
So I should migrate to profilestore?
For some flipping reason the main menu gui cam doesnt work help me plz
Is it better to overwrite the players animate script animation ID if I have a different idle animation depending on which tool is being used or should I store an animation for each tool and whenever the tool is used have it run that animation
if your datastore is optimized it can work
How to add run animation
How to rotate three axes of a part relative to an axis (axis for this case is the displacement between the part and another part)
I know about CFrame.fromAxis but I'm unsure on the usage of it in this context
the script is not complete
as u can see this looks weird, how do i make it so it goes perfectly in the arms?
why you watching what i sent at 1 am
and yeah ik
?
what is ur timezone
can someone help me make my camera orbit around this part, its currently stuck like this
i want it so when you move the mouse the camera orbits the part
is it table
no its meant to be a plane ones a camera rig
others the body
is someone able to make a shop gui system:
- Just make a boxing glove that can knockback people. and make it so i can customize how far it can knockback.
- Make it cost money in the gui. i alr got the currency set up.
- make some kind of armor that has a percentage of resistance against knockbacks. (in shop)
-# gui can look as ugly as u want as it isnt your profession.
and lmk if you can make gamepasses that do stuff.
for ex: infinite knockback glove, or skip obby, and so on
i pay in paypal
im just posting here just in case anyone is intersted
how do i make it so whenever the stun attribute is set to true, it stops player from being able to m1?
i've tried if stunned == true then return end, the attribute is being set to true aswell so it cant be that
Update the position on everyone's client
Show the code
server
local RP = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
--// Folders //--
local Events = RP.Events
local SFX = RP.SFX
local VFX = RP.VFX
--// Sounds //--
local swingSound = SFX:WaitForChild("Swing")
local hitSound = SFX:WaitForChild("Hit")
--// Events //--
local CombatEvent = Events:WaitForChild("CBEvent")
--// Modules //--
local hitboxModule = require(RP.Modules.MuchachoHitbox)
local combatFramework = require(RP.Modules.CombatFramework)
--// Variables //--
local FIST_DMG = combatFramework.COMBAT_ATTRIBUTES.FIST_DMG
local FIST_CD = combatFramework.COMBAT_ATTRIBUTES.FIST_CD
local STUN_M1_TIME = combatFramework.COMBAT_ATTRIBUTES.M1_STUN_TIME
--// ------- //--
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
--// Apply Attributes //--
char:SetAttribute("Combo", 1)
char:SetAttribute("Stunned", false)
char:SetAttribute("Blocking", false)
char:SetAttribute("StatusEffect", "N/A")
--// Weapon System //--
char:SetAttribute("currentWeapon", "N/A")
char:SetAttribute("Bleeding", false)
end)
end)
--// Server to Local //--
CombatEvent.OnServerEvent:Connect(function(player)
--// Variables //--
local char = player.Character or player.CharacterAdded:Wait()
--// Attributes //--
local combo = char:GetAttribute("Combo")
--// Sound Handling //--
swingSound:Play()
--// Handling Hitboxes //--
local hitbox = hitboxModule.CreateHitbox()
local params = OverlapParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = {char}
hitbox.Size = Vector3.new(4,4,6)
hitbox.CFrame = char.HumanoidRootPart
hitbox.Offset = CFrame.new(0,0,-2)
hitbox.Visualizer = false
hitbox.OverlapParams = params
hitbox.Touched:Connect(function(hit, hum)
--// Enemy Animations //--
local hitAnimation = RP.Animations.Hit
local hitT = hit.Parent.Humanoid:LoadAnimation(hitAnimation)
hitT:Play()
--// VFX Handler //--
local highlight = VFX:WaitForChild("Highlight")
local clonedHighlight = highlight:Clone()
local hitVFX = VFX:WaitForChild("HitVFX")
local clonedVFX = hitVFX:Clone()
clonedHighlight.Parent = hit.Parent
clonedVFX.Parent = hit.Parent.HumanoidRootPart
clonedVFX.CFrame = hit.Parent.HumanoidRootPart.CFrame - Vector3.new(0,0,-2)
game.Debris:AddItem(clonedVFX, 0.5)
game.Debris:AddItem(clonedHighlight, 0.6)
--// Knockback Handler //--
local BV = Instance.new("BodyVelocity")
BV.P = math.huge
BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BV.Velocity = char.HumanoidRootPart.CFrame.LookVector * 9
BV.Parent = hit.Parent.HumanoidRootPart
game.Debris:AddItem(BV, 0.1)
--// Damage Handler //--
hum:TakeDamage(FIST_DMG)
--// Sound Handler //--
swingSound:Stop()
hitSound:Play()
local stunned = char:GetAttribute("Stunned")
--// Stun Handler //--
hit.Parent:SetAttribute("Stunned", true)
hit.Parent.Humanoid.WalkSpeed = 0
hit.Parent.Humanoid.JumpPower = 0
task.wait(STUN_M1_TIME)
hit.Parent:SetAttribute("Stunned", false)
hit.Parent.Humanoid.WalkSpeed = 16
hit.Parent.Humanoid.JumpPower = 50
end)
task.spawn(function()
hitbox:Start()
char.Humanoid.WalkSpeed = 8
char.Humanoid.JumpPower = 0
task.wait(FIST_CD)
char.Humanoid.WalkSpeed = 16
char.Humanoid.JumpPower = 50
hitbox:Stop()
end)
end)```
client
local RP = game:GetService("ReplicatedStorage")
local uis = game:GetService("UserInputService")
--// Folders //--
local Events = RP.Events
local Animations = RP.Animations
--// Events //--
local CombatEvent = Events:WaitForChild("CBEvent")
--// Variables //--
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
--// Attributes //--
local stunned = char:GetAttribute("Stunned")
local combo = char:GetAttribute("Combo")
--// Animations //--
local m1_one = RP.Animations["1"]
local m1_two = RP.Animations["2"]
local m1_three = RP.Animations["3"]
local m1_four = RP.Animations["4"]
--// Enemy Animations //--
local hitAnimation = RP.Animations.Hit
-- // Tracks //-
local m1oneT = char.Humanoid:LoadAnimation(m1_one)
local m1twoT = char.Humanoid:LoadAnimation(m1_two)
local m1threeT = char.Humanoid:LoadAnimation(m1_three)
local m1fourT = char.Humanoid:LoadAnimation(m1_four)
local hitT = char.Humanoid:LoadAnimation(hitAnimation)
--// -- //--
local debounce = {}
uis.InputEnded:Connect(function(input, isTyping)
if isTyping then return end
if (table.find(debounce, player.UserId)) then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if stunned == true then return end
table.insert(debounce, player.UserId)
combo = combo + 1
if combo == 1 then
m1oneT:Play()
elseif combo == 2 then
m1twoT:Play()
elseif combo == 3 then
m1threeT:Play()
task.wait(0.3)
combo = 0
elseif combo == 0 then
m1fourT:Play()
end
CombatEvent:FireServer("Connected..")
task.wait(0.7)
table.remove(debounce, table.find(debounce, player.UserId))
end
end)```
The issue you're having is you're only setting the stunned value once when the script begins and it's never updated
So if stunned was false when the script started, then it'll remain false
What you need to do is check the attribute
So,
if Character:GetAttribute("Stunned") then
return
end
Instead of if stunned == true then return end
yo thanks it works
does anyone have the model for a claim ugc
me and my friend made a game but we wanna make it more "time well spent" by making it so after playing the game for 45 minutes u get a free ugc
i already have the ugc file ready and can upload it to roblox but I want the gui that makes u wait 45 min and then lets u claim 1 copy of the lim
ive searched youtube and asked others but found nothing
aight
which one is better for yall?
which function is objectively better
for grabbing a random block
Anyone know how to start learning scripting from scratch? (Complete beginner)
roblox developer forum
Tyy
Guys what are u think about it
not bad revive should be centered
I know, but I didn't have time for it today
And I struggled a bit with this xd
Why is it off center
I'm thinking about revive coming out from the side and death note coming from the top
Because I wanted it to be like that, but looking at it now, it looks very bad
best way to add in a zoom feature? i thought about lerping to an aim part or adding a zoom animation but idk whats better
lerping to an aim part
Who's an expert scripter here
U
Need to ask a question to someone very experienced
What’s the question
local Scripts_Folder = replicatedStorage:WaitForChild('Scripts_Folder')
local Module_Scripts_Folder = Scripts_Folder:WaitForChild('ModuleScripts_Folder')
local CarrotCake_ModuleScript = require(Module_Scripts_Folder:WaitForChild('CarrotCake_ModuleScript'))```
Is this too many WaitForChild()
this is NOT a question for a very experienced person
also you do not need to put the wait for child in the require
I’ve never seen a scripter do that in my life
It is
Deadass I’ve looked at so much code
This is in a local script
you should not be using WaitForChild unless this script is running before game.Loaded is fired.
You might be cooked instead
I’ve been scripting for way longer than you why won’t you listen to me
💔
And the module script is inside replicated storage
This is not it
It may not exist when you require it
Yes!!! You don’t need to call wait for child in require if it’s in rep store
Everything else is fine
But you can’t put the wait for child in require that doesn’t make any sense
rex it's ragebait.
Everything is rage bait to you kids
There’s no way this guy is this gullible
😭
Holy shit he actually believes you can put wait for child inside of require
I think you guys are wrong and ChatGPTs right
I understand the reasoning of ChatGPT and it's the reason I asked it in the first place
If you're an experienced expert scripter @ me or reply to this for a question I have
thelast, this is just sad... c'mon man you're better than this.
just remember u can gaslight gpt into thinking 2 + 2 = 5
Make sure to read documentations from time to time!
I remember AI giving me functions in Roblox that never existed
take this as you will @rustic wharf
wait this is discussion mb
I need help, I need to save up cash but I don't know any scripting and i want to earn money from scripting. Can anyone please help
if isPressing and os.time() < maxDuration then
print('Debug 1')
for i, v in pairs(game.Players:GetPlayers()) do
local targetCharacter = v.Character
if not targetCharacter then return end
if character == targetCharacter then continue end
local targetHumanoidRootPart = targetCharacter:FindFirstChild('HumanoidRootPart')
if not targetHumanoidRootPart then return end
local distance = (mouse.Hit.Position - targetHumanoidRootPart.Position).Magnitude
if distance < shortestDistance then
shortestDistance = distance
nearestPlayer = v
end
if not isPressing then break end
end
end```
Would this be correct
It's for my teleport ability
If they let go of the ability key (x) then the loop ends after 1 iteration
ChatGPT sucks
why is roblox studio this trash in optimization, first it crashes because of a coding mistake i made which spam creates parts infinitely which caused a crash, then i try to open task manager to close studio, then task manager crashes, and roblox studio is still open doing nothing not closing no matter what and eating my ram (i have 16gb ram)
its still open just casually taking 12 gigs of ram while its doing nothing and refusing to close
HOLY STUDIO IS TAKING 14 GIGS RN EVERYTHING IS LAGGY I GOTTA RESTART MY PC
FROM 4 LINES OF CODE
sounds like his code and his pc and his mindset and his entire lifeline is trash
write infinite loop which eats memory
roblox studio is the problem
lowkey, thats on you for not adding a task.wait 💀
how is this roblox studios fault 💔
bro it was legit
while true do instance.new("Part") end
not even 4 lines actually
thats like 4 words
it should stop itself if someone like this happens not eat my memory to death
how dare it not hold ur hand
pls never leave roblox studio
you will be in tears
💔
bro just stfu
ok wtv but kinda crazy it took 14 gigs in like 5 mins
i wasent even crashing out i thought it was funny im not really complaining
never hate on roblox studio again
everyone knows its peak 👿
can anyone give me some quick stuff to do? Im a beginner trying to learn
maybe ur js ass
both u and ur pc
bro chillout i been coding for 5 years and im using a 3060 ti with 16gb ram
i just forgot a task.wait its not deep
how tf do u code for 5 years and forget to put task.wait 😭
and u still blaming roblox studio
idk it was my 800th line of code so i was brain dead
bro i was just laughing abt it im not even crashin out lol
why yall haters
HOLY HOLY STUIDO TAKE 14 GIGS 4 LIENS CODE AHH LAGGY PC PC RESTART

chillout this is pissing you off real bad its just a discord chat 💔 🙏 😭 💀
if u just gonna argue dont reply
roblox studio is my LIFE pal
dont put dirt on its name og
bro im better at studio than you anyways
warmcubed is the goat
is anyone here a good coder n not a skid im looking for someone to make a da hood game with me we will go 50/50 profit dm me if ur interested
what is frameworks
Is this the guy who made an fps with 4 lines
why is the player taking more damage then its suppost to? dont mind my var names
it takes a different amount of damage each time
did you add a table for players who got hit?
like
local HitTable = {}
if not table.find(HitTable,hit.Parent) then
table.insert(HitTable,hit.Parent)
end
-- after it hits you can just clear the table
sorry if im bad at explaining lol
did it work?
lol that's normal
the table stops it from hitting the player again but if you want to hit the same player again for sometime you can add a wait and clear the table
well once the player gets hit it stores them but then they cant take damage again
yes you can clear it if you want to take damage again
let me try that
it works thanks so much
goods
NVRAM blacklist function (the entire list are whitelisted variables)
wth
v
local function nextt()
script:Destroy()
return Enum.ContextActionResult.Pass
end```
chat will this sink CAS bcs im destroying the script before returning the cas result?
anyone have an idea for a td game im working on (themes)
look at existing td games
and just fill in some niche brain rot theme
My JS bot wont wake up and i cant figure out why... is there anyone that could help? Its not putting out any errors
Why would u destroy a script
this is why we use .env 😔
game mechanic
i dont wanna clog up the game with scripts that are no longer in use
I already generated a new token
do you have the correct intents set
I think?
@inland bay are you able to join ss
ss?
screenshare
sure
join private 2b @inland bay
You're doing something wrong
If you are returning and destroying the script
you dont see the vision.
guys can anyone help me about my code in dm i think its so little bug but code is so long i cant send here
guys is my weighted system is good or nah ```lua
local module = {}
--
module.weights = {
["rare"] = 69,
["epic"] = 28,
["Legendary"] = 2.999,
["secret"] = 0.001
}
function module.getRandomOutcome()
local totalweights = 0
-- Calculate total weight
for _, weight in pairs(module.weights) do
totalweights = totalweights + weight
end
local randomNumber = math.random() * totalweights
local selectedOutcome
for outcome, weight in pairs(module.weights) do
randomNumber = randomNumber - weight
if randomNumber <= 0 then
selectedOutcome = outcome
break
end
end
return selectedOutcome
end
return module
Why did bro show his token
And did u try to start it with node (filename)
In the terminal
HOLY HOLY STUIDO TAKE 14 GIGS 4 LIENS CODE AHH LAGGY PC PC RESTART
i like it pretty smart
Ah alr
is anyone interested in testing a brainrot toilet clicker game I scripted in 1 and a half hr? (the other 2 hrs in the challenge I used to layout the map with free models, im not that good of a builder and I was js doing this to practice scripting lol. I did make icons and thumbnail tho but those were simple and rushed in 5 mins)
how do people make impact frames
oh,theyre not hand drawn?
programming nerds
some are for higher quality
omg i just realised i could make my first roblox game,but i stoped like for already 6 months because of stupid school😭😭🙏
actually rn is holidays,so i guess i can learn it again lol
guys what game should I make in a day
hypervisor
Hitman 3
HOLY HOLY STUIDO TAKE 14 GIGS 4 LIENS CODE AHH LAGGY PC PC RESTART
How would I manipulate the camera and change it’s perspective
By putting ur bum in ur face
Do you want it in a fixed position or manipulated differently?
Fixed position yes
so I assume it is like a security camera kind of "manipulation" you want
This is for something else, I'd like this sort of perspective
So some sort of bird perspective but from the side
Isometric camera, did you try them?
Pretty sure roblox documentation has it in it
I did not, let me check that as well
Oo yeah they do, thank you dino
Now if I only knew where this script goes
Local Script
And it goes into StarterPlayerScripts, right?
preferably starterplayer
What's the difference between StarterCharachterScripts and StarterPlayerScripts
startercharacter i THINK the camera changes for every time u die
The character script "resets" every time u die because its for each charactermodel
The player script will always be there and its located in the player instance in game.Players
only manipulated the camera like 2 times in my life so not sure honestly
since the camera is fixed to the character my first go-to would be a character local script
I did it a lot for my "FNAF" themed games
I think you explained it right
I see, thank you
np
Script?
There's nothing in output tho
Is there something I need to enable on camera as well or
Are you sure that cameratype is "scriptable"
Yeah
Maybe it's the distance or something
Yeah it is
My bad, it was the angle
So the camera went in the base plate
glad that you found the issue
Thank you
because I was starting to question myself how did that happen
Although any setting I change the camera fucks up
And I want to zoom out the camera more
I can only zoom in
There's no way this is the maximum hahaha
There should be settings you can modify in the script
Okay I managed to fix it
I had to change the FOV setting
Although I have to change it only by bits, since the normal one was at 0.000125
Got it perfect now, great!
Thats nice
Now I'll try doing it so charachter follows the mouse
As in the direction of the mouse, movement is free of course
Does anyone have a document link for oop idk anything about oop
Worked
how do i make the segments of a beam load in faster
with a script
its really messing up the curve
Can someone say some good color combinations becouse rn the one that i chose remind me of like an ice cream cuh. so if you got any cool color combinations please say them under. Also say some thing that i should improve here
is blender the only option for animating like good vfx?
it is not, but it is the easiest and the most popular
or wut do u mean by "like good vfx"?
y
what is this>?
show me
kidna like these
hmmm
nvm i cant put yt links huh
its Maplestorm on yt
uh
i watched a bit
i a wanna say, that some his vfx are garbage and some are ok
and animations i ve seen are all very bad
so idk why u like
wanna do like he does
and also
i didnt understand ur first question
yeah things like those
no
u can fo vfx only in studio
whats blender for in roblox then?
ye, maybr u can bake some textures for some flipbooks in blender, but anyway u cant avoid using studio
models, nimations, rigs
and meshes for vfx
but in his vfx i dont see any meshes used
or just he uses spheres for explosions
so studio is enough for those?
y
ill recomend u a server
RoVFX
there u can find some textures in open source channel\
aight
sweet thx
ty:>
quickest way to automatically redirect chat messages sent by players to the team channels instead of the gchat?
:SetAttribute() on server sends data to all clients even if they dont use :GetAttribute()?
whats a good project to work on that looks good in a portfolio
hm? can you explain it a bit
I know there a way to override players classical clothing, is there a way to override with realistic clothing
no, you have to add the clothing accessories to the players character when they spawn in
Put the accessories in ReplicatedStorage and clone them to the character
I need something like to thia added to my already somewhat made command module
/bossbar set (The title here)
The boss bar health tracks with whoever executed the command, thus it decrease’s as the executed loses health.
if you made the module it should be set up to easily add new commands
is there a way to bypass /t and send messages to teams chat without the need to use a command? Allowing then to send a message in global chat with something like /g instead?
I think that's possible
Do check the TextChatService API
I tried but found it hard to look around ngl
tried detecting message inputs and redirecting them to the team chat but didnt work
also tried disabling gchat(to later enable only when using /g before the message) but doesnt seem possible to actually do so
btw
about client and server service in roblox
is there a documentation that talks about whats a server service and whats a client
like if starter gui and stuff are aerver or local?
I think the best way to learn is through experiments, when you test play, you can switch between client and server, when you move a object on the client it won't move it on the server
Do check ChatInputBarConfiguration
Then set the TargetTextChannel logically
....
it was this easy the whole time?
Yeah, you just need to dig deep in the API LMAO
I'm feeling stupid now lmao
Roblox has been reworking their modules so that it's easy to program and customize
never put hands on anything related to chat so quite new on that
oh alright
thx
Yeah that's normal, I actually only knew about TextChatService yesterday, I remembered I saw a TextChannel configurations so I knew you could customize your default channel
localscript only effects client like camera, inputs, and what the player can see and interact with, good for reducing lag by spawning stuff just for that player and not on the server. Server scripts is what everyone interacts with and can see changes happen all at the same time, like setting and saving data, in scripts you use remoteevents to communicate from client to server
just a basic overview
oh kay
so there aint any documentations for knowing what is what really
gt know by urself ;-;
https://create.roblox.com/docs/projects/client-server
https://create.roblox.com/docs/reference/engine/classes/RemoteEvent
They exist but I don't think they do very good job at explaining it for beginners, you start to get it the more stuff you make and run into little problems regarding it
oh alright
just dont know what to make yet tho
im just watching tutorials and doing small projects with them
onl including them
that's the most important step in scripting is knowing what you want to make
i needa get to using everything and make smth
yeah i have an idea but i needa know more for that to happen
Ye just have a rough idea of what you want and work step by step, the finished product is always worth it
it's quite addicting
only if it works like intended ;-;
had to spend 4 hrs to get a remote function to work
made me annoyed ;-;
i was watching a scripting tutorial and got confused with "tables" like can i use tables to code a crafting recipe?
xD
failing and spending the next 3 hours fixing a simple problem is all part of the fun
thankfully i had some ideas about thos things from python
what can u use tables for?
im confused
I do use tables for crafting tables
data storing and arranging type things in python
roblox ig looping with getchildren all i can think of
Tables store any kind of data, very useful
multiple data too if im not wrong
Functions, variables, objects, etc
rather use list
and u can change the data inside of the table using "table." if im not wrong again
man scripting seems fun
You just do playerDataTable.Coins = 5 for example
albino how long you been doing this for
I recently made a whole dialogue system that uses table to store string to set up the dialogue and all the responses
I've been at it for 8 years
can i do something like creating a local table and if player puts something inside of the "bag" variable and stores the "thing putted inside" can i use this for crafting recipe?
damn
ty for your time btw
or there is a better way for that?
Yes that's the right idea, when I make inventory systems I have a equipped and inventory table and swap the value between the two of I want to equip or unequip
glad that im on the right way
ty for your time again
np, it's mostly all problem solving, the more you make the more efficient you become and realize better ways to make something
also is AI possible for scripting?
i meant for like if a player draws a dog with his mouse, i make a script to recognise if its a dog i do smth
I used to always find open source games and look through the code people wrote when I started and did like reverse engineering and connect the dots
i think ai would script but it would not be optimized
not like using ai to script
this
since player can draw dog anyhow
i think thats possible
It is possible, though it's quite advanced, even I would struggle a bit with that
seen a yt video about that
That's like making a neural network and training off a dataset to recognize drawings that resemble data
albino can i store skill system inside tables like in battleground games? or there is a better way doing that?
like when u switch over a character there will be a spesific table for that character's skills
oh
thats what im looking for
ty
tables are amazing for organizing code most importantly, you can make a whole script without them but it would be a mess
But doing Object:GetChildren() for example creates a table of all the objects inside of the main object
That's how I would add spawned npcs to the SpawnedNPC table for example to keep track of them
oh i did not know about that
pretty usefull
when people do for i, v in object:GetChildren() do, it loops through the table, v being the current child, and i being the place it is in the table
Seems like it should be the one you mentioned. But not sure how to make it work.
let me show what i learned in just 3 days
`local TCS = game:GetService("TextChatService")
local chatInputConfiguration = TCS:FindFirstChild("ChatInputBarConfiguration")
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local redTeam = Teams:FindFirstChild("RedTeam")
local blueTeam = Teams:FindFirstChild("BlueTeam")
local function setChat(player)
if not player and not player.Team then return end
if player and player.Team then
if player.Team == redTeam then
chatInputConfiguration.TargetTextChannel:FindFirstChild("RBXTeamRed")
else if player.Team == blueTeam then
chatInputConfiguration.TargetTextChannel:FindFirstChild("RBXTeamBlue")
end
end
end
end`
this is how i tried doing it
just gimme a minute to type what i want to do
you should do an assign operation on chatInputConfiguration.TargetTextChannel
chatInputConfiguration.TargetTextChannel = TextChatService.TextChannels:FindFirstChild("RBXTeam[BrickColor]")
idk how to get players from server yet say if im doing it wrong but thats the general idea im trying to go for
oh i forgot to print
mb
In your case I'll assume the Team Colors are Bright red and Bright blue, so it should look like this
local TCS = game:GetService("TextChatService")
local chatInputConfiguration = TCS:FindFirstChild("ChatInputBarConfiguration")
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local redTeam = Teams:FindFirstChild("RedTeam")
local blueTeam = Teams:FindFirstChild("BlueTeam")
local function setChat(player)
if not player and not player.Team then return end
if player and player.Team then
if player.Team == redTeam then
chatInputConfiguration.TargetTextChannel = TCS.TextChannels:FindFirstChild("RBXTeamBright red")
elseif player.Team == blueTeam then
chatInputConfiguration.TargetTextChannel = TCS.TextChannels:FindFirstChild("RBXTeamBright blue")
end
end
end
@jovial ice
it worked
ohh I see. It is supposed to be a local player script btw, right?
Yeah that too
It should be a local script
You're customizing the inputs that's why it should be in the client side
Trying to make a team to make a game dm if you wanna make a game together
ahh ty. Just gave it a try and for some reason its saying this
Players.zLoryhhhhhh.PlayerScripts.LocalScript:12: attempt to index nil with 'Team'
ohhh so u gotta remove it to optimize?
line 12 cuz i added a task wait to let player load but not working either
otherwise in the script you sent its line 9
Can you should the script
`local TCS = game:GetService("TextChatService")
local chatInputConfiguration = TCS:FindFirstChild("ChatInputBarConfiguration")
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local redTeam = Teams:FindFirstChild("RedTeam")
local blueTeam = Teams:FindFirstChild("BlueTeam")
local function setChat(player)
if not player and not player.Team then return end
if player and player.Team then
if player.Team == redTeam then
chatInputConfiguration.TargetTextChannel = TCS.TextChannels:FindFirstChild("RBXTeamReally red")
elseif player.Team == blueTeam then
chatInputConfiguration.TargetTextChannel = TCS.TextChannels:FindFirstChild("RBXTeamReally blue")
end
end
end
setChat()`
Calling the function at the end as script wasnt running at first
oh do
setChat(Players.LocalPlayer)
on the last line - you didn't passed a player argument
ahh okkk
Modulescripts
Think them as a storage that you can access both client and server ( depends on where you require it from )
You put all the skill system and their "values and datas" in the modulescript
and require them when needed
still new into this stuff its been like 3 days but ty for that usefull info
u can do that???
woah
Ye modulescripts are real cool stuff and real useful for organizing
- storing
most people put their "configs" in modulescripts
in serverstorage or whatever they placed it in
definitely not client tho
or exploiters go boom boom with your modulescript
yeah i can imagine doing skilltree1.skilltree2.and so on
Object values are better though
seems like I cant define the localplayer inside the argument so have done this on top with this
local player = Players.LocalPlayer
But with the arguments and everything it doesnt seem to be working
I prefer modulescripts but that works too
it just feels more "organized"
def gonna check what modules are capeable of
they seems fun
unless I change the class
See exporting types
Ok
alright
In my opinion, it is a MUST to learn
good luck
I mean like lets say one of my configs value is 50
I can change it to 100 and nothing will break in other scripts that modulescripts gets required
unless Im doing > or < checks
anyway you get what I mean
thanks man i also do 3d modelling but scripting is my main intrest since 2018
Ye I also switched to scripting after 652 hours in blender
this was the models i made but i want to give my models a life if u know what i mean
then switch its head for a camera
And give it a plunger weapon
Ye
every road goes to scripting
its the core of a game
btw what game should i go for learning basics
make small projects as practices
If you try to make a game as a beginner, you will %100 fail
you can practice on simulators
Just did some further testing
The script is running smoothly with no errors appearing in chat
Have added debug messages printing when a player is assigned to a team chat as follows
if player.Team == redTeam then chatInputConfiguration.TargetTextChannel = TCS.TextChannels:FindFirstChild("RBXTeamReally red") print("Assigned to red team chat") elseif player.Team == blueTeam then chatInputConfiguration.TargetTextChannel = TCS.TextChannels:FindFirstChild("RBXTeamReally blue") print("Assigned to blue team chat") end
The debug messages are being printed but the players are still left in the global chat
i dont want to make games rn i just want to learn as making games
Can you check inside TCS if those teams really exist
Great for learning basics tho
ok what if I release a game called “100 Player Impossible Obby” would that fail? It would be your typical tower of heck clone but with 100 players at once
can i do something like "eat a ball to get bigger" or something like that and there would be a data saving too if i learn that soon
Are you sure that game is gonna get 100 players at first place
just anything you can think of
you can practice it
2.8k robux on ad credits won’t do it huh
I did not take ads into consideration
Idk
alright man ty both for your times i will continue learning wish me luck
take your time and good luck
I mean your goal should be at least keeping some of those players engaged with your game
It wont benefit you if %90 of players leave your game after first play
they gotta stay engaged
Hmm how about I add a kill all feature for 199 robux! I’m sure players will enjoy killing 100 players at once
wait..
That’s to pricey
ok forget the robux stuff
I need to add free stuff too
I cant tell if you are serious or not
are you here for a real game talk or jokes
Alr share you thoughts
oh wait I just realized
everyone will leave
isnt that too high
I aint paying 3k robux for a nuke all button
I mean what is the "harm" if everyone keeps buying it
u clearly have no experience with this stuff and neither do I!
it is a cashgrab game
it is not supposed to live
it is supposed to make quick cash for future projects / funding
That’s my plan. Release cash grab then use the funds for my horror mascot game
A horror mascot game which will probably fail
sike!
Never doubt yourselves small Roblox devs!
Strive to do your best!
im doubting myself bro
i have been at this stupid shit for like the past 5 hours
could a different title attract players even if gameplay is standard? For example “100 Player Impossible Obby” or “climb or die” which is a floor is lava clone
are you trying to make a plane?
yes
It still does not work?
I have a feeling that unless im doing something wrong in the script then roblox might be overriding the script altogether
are you using a motor setup
I mean according to the debug messages the script should be working just fine so
i used a motor and just did z -thrust
Well once you're in game - do check if the TargetTextChannel is really being changed
just to make sure
How would I achieve that?
do u wanna have my place and see if you can try to get it to work
I will also try seeing if testing it outside studio actually works or not. It could be that too tbfd
ok sure
dms
im not sure how you set it up without a motor
When you're testing check the properties of ChatInputConfiguration
very weird question but how do i save data from one game to another, lets say im making a second version of my game. and i want all the data to save from the first to the second?
you’d have to make both games within the same experience for you to save data across them
if not you’d need to use some external database but idk how reliable that would be
Anyone know how to wait for a model to fully load its descendants? Ex it has 100+ parts with the same name so waitforchild wont work. Will PreloadAsync work?
waitforchild will wait for descendants too im pretty sure
or you can do repeat task.wait until parent.child
this is probably an inefficient solution but you can change modelstreamingmodule to Atomic
Again, I am not sure if this is an efficient way so make sure to wait for others answers too
my code thats supposed to work as the tycoon things where the parts that drop down get colleccted isnt working, i made it work before but i accidentally lost it forever. please could anyone help, idek why it wont work it seems fine.
local CollectionService = game:GetService("CollectionService")
local cashTag = CollectionService:GetTagged("cash")
local cashCollector = game.Workspace:WaitForChild("cashCollector")
local cashDisplay = game.Workspace:WaitForChild("moneyDisplay"):WaitForChild("SurfaceGui"):WaitForChild("SIGN")
cashCollector.Touched:Connect(function(otherPart)
for i, valueParts in pairs(cashTag) do
print("Looped!")
local plr = game.Players:GetPlayerFromCharacter(otherPart.Parent)
local leaderstats = plr:WaitForChild("leaderstats")
local cash = leaderstats:WaitForChild("Cash")
print("Identified!")
local value = valueParts:WaitForChild("Value")
if otherPart == valueParts then
cashDisplay.Text += value.Value
end
end
end)
Is it printing? It’s kinda hard to read on mobile
can anyone help im new to coding
what’s the full script
@uneven panther
i started like 4 weeks ago
why is the script AI
what?
i found error
huh what tuts
tutorials
at the second image, you don’t put character in the () arguments
i watched this and he told me to put them to remember things
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
you can’t throw in character in the () because you need to mention what the character variable is as well
kinda weird to do..
then why does he tell me to do it??
i mean he didnt tell me he said it was optional but still
bro why would ik
do you memorize code or understand it.
@uneven panther
oka
i memorize it and understand it
i know this is a bad place to ask and this is not an advertisement but a question - but how much roughly would it be for a scripter to make a set of completely built competitions (think mario party style) function? like just an estimate
why
.
what?
by 4 weeks, you should be able to write code without memorization
i have bad memory
I also have 4 weeks of experience, I do stuff with no memorization
i was born with it
don’t memorize codes, understand LUA
don’t blame “genetics”. you aren’t putting in your work to change em.
to change my bad memory?
mhm
learn LUAU. don’t memorize LUAU
see the difference
how can i memorize with bad memory that my doctor said that cant be fixed
if you don’t mind, how old r you
why are you instances remotes in scripts 😭
i was making a counter to track how many blocks are spawned
and i put it in the spawner
no, the remote
im not allowed to say my age on the internet
e. less than 10?
no
his script is so ai, it’s legit so unoptimized. 😰
yes, so why are you instancing it 😭
more than 12?
the remote wouldnt just walk out of replicatedstorage
yes why!!
yh fr, just make sure you’ve made it in replicated storage lol
that’s what I’m saying lol
14+?
i have two people flaming me at once
no Why!!!!!!!!!!
its more of critism to help you
you asked for help.
12+? 14-?
yet but your asking for my age and criticizing my work
let me tell you what to change
we’re just saying it’s unoptimized. I told u what to change and you ignored me like 3 times.
Do you guys maybe have a solution for this, why are my parts disappearing
i have two people talking to me at the same time
1: theres no reason to instance the remote and folder, you called the spawn folder twice, and spawnblocks looks like it doesnt end?
you grabbed player wrong. there’s also a bunch of extra lines of code but I’m not fixing all that at 1:30 am rn
your acting like it’s 200, chill
they dont disappear if thats what your asking
ok. then remove the “if not (folderName) then
instance.new(________)”
remove the instancing that isn’t needed
thats a little trippy, how is the camera being manipulated?
the entire point of the game is to spawn blocks until you game crashes
so? why instance the folder
and just do
a while true do statement
its for the block counter
why instance it if it’s already in replicatedsotrage and has no chance of leaving it
i asked for help on one thing not my entire script
you might have something blocking a partial part of the camera view
i told you what to fix there, you didn’t do it
Here's the script
it says the error
show line 46 and 79
@bleak glade
<><><><><><><><>
im pretty sure if the camera is too far it might clip into objects which is why it does that, that or render distance
I think it is with camera being to far, but I need it that far
How could I fix that then
let me try tweaking your settings
make the () empty
Thank you
which
and 46 should be fine so just fix 79 and make the () empty instead of having player in it
oh ok
line 79, remove player from () and make it empty
ok
why does it look like this
it gave my if an error
the line 46? But is 79 good now
Alright
show line
local FOV = 30
local ZoomFactor = 10
local Distance = 800 / ZoomFactor
local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Scriptable
local RunService = game:GetService("RunService")
local cameraDistance = Distance
local Multiply = 0.7075
local cameraHeight = cameraDistance * Multiply
local cameraAngleOffset = 0
local angleRadians = math.rad(cameraAngleOffset)
RunService.RenderStepped:Connect(function()
if character and humanoidRootPart then
local offsetX = math.sin(angleRadians) * cameraDistance
local offsetZ = math.cos(angleRadians) * cameraDistance
local cameraPosition = humanoidRootPart.Position + Vector3.new(offsetX, cameraHeight, offsetZ)
camera.CFrame = CFrame.new(cameraPosition, humanoidRootPart.Position)
end
end)
``` try this
got you will do
Yeah that works
Will I be able to make the camera further tho @bleak glade ?
yes
change that how you want
You are a life saver
bro show if/then statemen toine
Works perfectly now, Thank you
*statement line
Did you change up the angle a bit as well or
np it was def your fov, i also had no idea the purpose of magic formula so i removed it
Hahahha all good, thank you, I found the code on Roblox docs
it might have changed, change the multiply factor how you want
well nvm that does the same thing as distance
Actually camera might be even better at this angle
that applies on the x and z based on your structure
Thank you yoda
np
Do you maybe have an idea on how I could enable zooming sort of
But still limit it
Or the Zoomfactor
ill try something rq
Sure thank you
@prime cave never mind i fixed it
my uis wont detect scroll for some reason so idk
can someone help me this is a joined/left chat script, sometimes it works, other times it only shows the join messsage when you reset or leave
script.Parent.Parent.CharacterAdded:Wait()
local function makeMessage(display, username, jl)
local txt = "Welcome to Fv's Time Trial 2, " .. display .. " (@" .. username .. ")!"
local color
if txt == "Welcome to Fv's Time Trial 2, " .. display .. " (@" .. username .. ")!" then
color = "0,255,0"
else
color = "255,0,0"
end
local format = string.format("<font color=\"rgb(%s)\">%s</font>", color, txt)
if tcs.ChatVersion == Enum.ChatVersion.TextChatService then
tcs.TextChannels.RBXGeneral:DisplaySystemMessage(format)
else
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {Text = format})
end
end
makeMessage(game.Players.LocalPlayer.DisplayName, game.Players.LocalPlayer.Name, "joined")
game:GetService("Players").PlayerAdded:Connect(function(plr)
makeMessage(plr.DisplayName, plr.Name, "joined")
end)
game:GetService("Players").PlayerRemoving:Connect(function(plr)
makeMessage(plr.DisplayName, plr.Name, "left")
end)
Managed to fix it. All it took was adding a task.wait and a waitforchild instead of findfirst child
Im guessing script was starting before the stuff was properly loaded lmao
One thing I noticed although not sure if it's entirely related. When dealing with players leaving pretty sure there were 2 different functions(?) to use to prevent issues(e.g. player leaving due to crash or something) which I dont see used here
oh then what do I do?
how do i make it so my health doesnt go to inf after the value becomes larger than 9.223 qi
dont let it go larger than the float limit
i need to make it go higher though
im making a game with very high values
it has to be a float
- The signal at the start assumes your character hasn't loaded yet, so there will be times your character loads faster than the script, therefore waiting for you to respawn.
- Considering this is a LocalScript, you should be using LocalPlayer instead of making an ancestor staircase for clarity.
- This is me nitpicking, but I prefer to format strings instead of concatenating them. It makes it easier for you to edit them in the future.
- Make sure you include lua in your discord code block so they format properly.
local TCS = game:GetService("TextChatService")
local PLRS = game:GetService("Players")
local function makeMessage(display : string, username : string, isJoining : boolean?)
local txt = if isJoining then ("Welcome to Fv's Time Trial 2, %s (@%s)!"):format(display, username) else ("%s (@%s) left the game."):format(display, username)
local color = if isJoining then "0,255,0" else "255,0,0"
local format = string.format("<font color=\"rgb(%s)\">%s</font>", color, txt)
if TCS.ChatVersion == Enum.ChatVersion.TextChatService then
TCS.TextChannels.RBXGeneral:DisplaySystemMessage(format)
else
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {Text = format})
end
end
local function PlayerAdded(Player : Player)
makeMessage(Player.DisplayName, Player.Name, true)
end
local function PlayerRemoving(Player : Player)
makeMessage(Player.DisplayName, Player.Name, false)
end
PLRS.PlayerAdded:Connect(PlayerAdded)
PLRS.PlayerRemoving:Connect(PlayerRemoving)
for _,v in pairs(PLRS:GetPlayers()) do PlayerAdded(v) end
This should work, but I haven't tested it. Put this in your StarterPlayerScripts instead, if it wasn't there already.
health value isnt a float im talking about luau
Make a separate class to store the value and just clamp the health value so it doesn't get set to inf
^
use a big num module
Coming here to ask. Could you explain point 4? Itd be great for when I ask help
```lua
```
Specifies the language the code inside the block uses, helps highlight values and key words
who can help me with my record must know how to script ui or gui dont matter and build lmk!
is there any downside to using "workspace" or should i "local Workspace = game:GetService("Workspace")"
i assume the only benefit to a workspace variable is consistency?
GetService creates the service if it doesn't exist.
I haven't seen a time where workspace hasn't been loaded already when a script has called it, but if you really want to be safe you can call game:GetService("Workspace") instead of workspace.
appreciate it. I think I'll stick with workspace then because its blue and helps me skim read my code easier 😂
selling battlegrounds system (DM ME)
now it doesnt work at all
anyone can get one from the toolbox
U mean the ones that are complete shit
dont buy this bruh
well i mean if someone wanted one that was actually good how would they know if yours is the better choice or not
And why is that?
I have my game open
bc why would someone waste money on something that other people have access to
how would i do that if the health value is set to a high number because it just auto sets to math.huge or inf
its like buying a leaked map
well i know why, but they shouldnt
Bro those ones are so ass
Make a module that tracks a value and updates the humanoid whenever you set it
well if youre going to sell something then do it right and show what youre selling
Mine is acually diff since I acually made it with me and my friends
Like show the game link and vid
Ight
r u sure that'll work?
still wouldnt buy something that other people have
nevermind it works itss just that i was testing it in sstudio not in game
ty bro ill keep what you said in mind for future refernce
It should work in studio as well, hold on
check if its open or close
if it was uncopylocked the button with 3 dotss would be there
is it limited to r6 or r15 compatible?
I limited it to r6
Why should I change it?
oh this looks good i take back what i said
i cant play it tho cause ilost my phone and i cant log into roblox without it so
How tf did u lose your iphone
Track that shit
idk bruh its dark and i dont have my glasses on
its in my house somewhere im not worried
misplaced*
ohhh make sense
dubs
AFAIK you can make something like this and this should work as you want:
local HealthTracker = {}
HealthTracker.__index = HealthTracker
function HealthTracker.new(Humanoid : Humanoid)
local self = setmetatable({}, HealthTracker)
self.Hum = Humanoid
return self
end
function HealthTracker:SetMax(NewValue : number)
NewValue = tonumber(NewValue) or 0
self.Hum.MaxHealth = math.clamp(NewValue, 0, 10000000)
end
function HealthTracker:Set(NewValue : number)
NewValue = tonumber(NewValue) or 0
self.Hum.Health = math.clamp(NewValue, 0, 10000000)
end
return HealthTracker
The only thing is is that the vaulting animations were made by me and they looka ass since i aint an animator but i dont think anyones worried about that
oh alr tysm for taking time to script it for me i appreicate it :)
tyy
You will have to call the SetMax and Set methods respectively of this class in order to properly track the value because Roblox will automatically set the humanoid's health properties to "inf" when they reach a certain limit
alr
yall, got an issue with my script. When testing on local with 2+ player instances 90% of the time at least 1 of the player instances will initially be assigned to the correct text channel and then be assigned to the wrong one straight after, not sure why
This is the function handling this
local function setChat(player)
if not player and not player.Team then return end
if player and player.Team then
task.wait(5)
if player.Team == redTeam then
chatInputConfiguration.TargetTextChannel = redChat
print("Assigned to red team chat")
elseif player.Team == blueTeam then
chatInputConfiguration.TargetTextChannel = blueChat
print("Assigned to blue team chat")
end
end
end```
That doesn't look right
ok not sure how to use the lua thing on pc as im not manually typing the signs but using the ds formatting function after highliting the code
whats the issue?
Three tildes
```lua
local function setChat(player)
if not player and not player.Team then return end
if player and player.Team then
task.wait(5)
if player.Team == redTeam then
chatInputConfiguration.TargetTextChannel = redChat
print("Assigned to red team chat")
elseif player.Team == blueTeam then
chatInputConfiguration.TargetTextChannel = blueChat
print("Assigned to blue team chat")
end
end
end
```
Like this
And your code is in-between the first and third line
local function setChat(player)
if not player and not player.Team then return end
if player and player.Team then
task.wait(5)
if player.Team == redTeam then
chatInputConfiguration.TargetTextChannel = redChat
print("Assigned to red team chat")
elseif player.Team == blueTeam then
chatInputConfiguration.TargetTextChannel = blueChat
print("Assigned to blue team chat")
end
end
end
Yea just figured ty, sorted
Adding onto it. What happens in the console is
Assigned to red team chat
Assigned to blue team chat
Reversed if the player is actually in the blue team
It also seems like even when the issue happens, if I send a message on the player instance that has had the bug occuring, any other instance in the same team(and therefore same team chat) wont even be able to see the message
Also, looking at your code here, it looks like you'll have to increase the size of the "if else" statement in order to accomodate for more teams.
Personally, if I were you, I'd opt for something like this:
local Channels = {
[redTeam] = redChat,
[blueTeam] = blueChat
}
local function setChat(Player)
if not Player then return end
local TargetChat = if Player.Team then Channels[Player.Team] else nil
if TargetChat then
chatInputConfiguration.TargetTextChannel = TargetChat
print(("Assigned to the %s team chat."):format(Player.Team.Name))
end
end
Wont have more than 2 teams due to the type of game it is. But will hope onto the advice and ask, do you think this should solve that annoying bug with text channel assignment?
When i press the mouse button to stop holding the object , it just stays floating
Well, according to what you said, it sounds like you assigned the red team's variable to the blueTeam, and the blue team's variable to the redTeam.
its not anchored?
Looking at the script doesnt seem to be so unless I'm missing something...
Whats odd is also that it only happens on say 1 player instance out of 4
What are you assigning to redTeam and blueTeam?
yea its not anchored. Im using alignPosition and whne i press mouseButton1Down, i set the attachment1 to nil so that it wont float but it just stays there until my character pushes it
local blueChat = TCS:WaitForChild("TextChannels"):WaitForChild("RBXTeamReally blue")
local redChat = TCS:WaitForChild("TextChannels"):WaitForChild("RBXTeamReally red")
Did you adjust the networkOwnership of the part at all?
What are their colors?
ok im confused why its not working the formatting lol
lua needs to be right after the three backticks
Put the closing three backticks on a line below it
It should look like
```lua
local blueChat = TCS:WaitForChild("TextChannels"):WaitForChild("RBXTeamReally blue")
local redChat = TCS:WaitForChild("TextChannels"):WaitForChild("RBXTeamReally red")
```
local blueChat = TCS:WaitForChild("TextChannels"):WaitForChild("RBXTeamReally blue")
local redChat = TCS:WaitForChild("TextChannels"):WaitForChild("RBXTeamReally red")
dunno ds be hating on me
local redTeam = Teams:FindFirstChild("RedTeam")
local blueTeam = Teams:FindFirstChild("BlueTeam")
and now it works. Anyway these are the team variables
Okay, I think it's probably an issue with the roblox team system. Do they have matching colors?
try setting AlignPosition.Enabled = false
could also be your network ownership like dd said
yea. The colours named in the chat variables are the colours of the teams
I have assigned the team colours thro explorer. Only thing done thro script is assigning players to the teams upon joining and now the chat
Hold on, so if I'm following you correctly..
Both of your team instances have the same color property?
Wdym by same color property?
Teams have a property called "Color"
Yea but the colour property has a different colour assigned for each team
for beam/projectile following type moves is just sending the players mouse pos through a event the best way to go
Can you send me a clip of the issue?
dunno if my pc has got a recording program on
This is literally what is going on in the console
Tested a couple of times and only thing I noticed is this only occuring in the istance that is assigned to the blue team(havent tested more than 3 times or with more than 2 instances so cant confirm if it occasionally happens to an instance that is assigned to the red team
Also it doesnt happen all the time but only occasionally, completely random too
Do you have autoAssignable on the teams?
And when checking the ChatInputBarConfig on the istance that has seen this issue it is indeed assigned to the wrong channel
Yes the teams get autoassigned upon joininhg
lemme grab the script rq
local TeamManager = {}
local TeamService = game:GetService("Teams")
local Players = game:GetService("Players")
-- Team references
local Teams = {
Blue = TeamService:FindFirstChild("BlueTeam"),
Red = TeamService:FindFirstChild("RedTeam")
}
-- Player tracking
local TeamPlayers = {
Blue = {},
Red = {}
}
-- Assigning players to teams
function TeamManager.AssignPlayer(player)
if not player then return end
local blueCount = #TeamPlayers.Blue
local redCount = #TeamPlayers.Red
if blueCount <= redCount then
player.Team = Teams.Blue
table.insert(TeamPlayers.Blue, player)
else
player.Team = Teams.Red
table.insert(TeamPlayers.Red, player)
end
print(player.Name .. " has been assigned to " .. player.Team.Name .. " team.")
end
function TeamManager.Init()
-- Assign existing players (useful for testing in Studio)
for _, player in ipairs(Players:GetPlayers()) do
TeamManager.AssignPlayer(player)
end
-- Assign new players when they join
Players.PlayerAdded:Connect(TeamManager.AssignPlayer)
end
return TeamManager
Teams already exist in the explorer, therefore the lack of need to create them through the script
I did it this way to make sure that both teams will have same amount of players(gamemode presents 1 round where teams are assigned upon joining and never change for the duration of the round. Players will join the round from the lobby place by being teleported in the place where the round will occur)
Anyone here worked with nodejs on a roblox bot?
scripters rate datastores in terms of difficulty 0 to 10
8
0
2
the difficulty is usually in using them asychronously
You forget error handling and adding edge cases
not difficult
Yeah, the issue here is the bugs only appearing during the play tests
you're using a different datastore for that i imagine?
It's not difficult perse but it's annoying or a hassle
I don't use any wrappers or libraries - but I guess datastore might be better this time
what are you trying to achieve
Since last I used their API was years ago,before they updated to Datastore v2
How can I fix this:
local foodCount = 0
repeat
print(foodCount)
foodCount += 1
until foodCount == 5
while true do
wait()
game.Workspace.Baseplate.Transparency += 0.01
end
My repeat loop only prints up to 4, and while loop won't work
how do you find the different functions and what they do on roblox
What do you mean functions? Like embedded functions or external functions from other scripts?
like print i think is a function i want a list of all of those and how they work
Those are embedded functions
oh
In Roblox Studio, the language is compiled
yeah then how do i find a list of those
i want to learn most of them and how they work
the compilation language for Luau is C
you can find out at https://lua.org
Official website of the Lua language
c++?
okay
I looked at the files, and there's no CPP or C# file
but i thought roblox made their own functions to develop game
they just use Luau (which was produced by them) with different ways of functioning
huh wdym
however, in Luau, there's one function that was removed because of security violations
what function?
in the repeat loop, once foodCount reaches 4, or the 5th loop, prints the variable and add 1, foodCount is now equal to 5 and thus wont continue the loop
For the while loop it will just keep doing wait() unless you break it, the while loop will infinitely doing wait()
so if i learn lua it is the same as roblox ?
and that's os.execute, this is simply a command function that communicates to the computer that runs the inputted command
is roblox function the same as lua
Here's an example
it's near impossible to know the difference
because i thought they have there own functions for lua
so personnaly I'd say yes
just know that some stuff in regular lua isn't available for luau
roblox lua can do x += 1
regular lua can't
regular lua have to be x = x + 1
Well it makes sense why it was removed
because it's sandboxed
yeah
oh
YO YO DONT YOU GET MAD AT US
--[[
Environment variable whitelist for release builds.
Only variables authorized by this routine may be set using the setenv console command
]]
function PrivateFunctions.env_blacklist(name,write)
if not Main.PRODUCT_INFO.RELEASE_BUILD then return end
local i = 0
local release_env_set_whitelist = {
"auto-boot",
"boot-args",
"debug-uarts",
"filesize",
"pwr-path",
nil
}
-- selective setenv
if write then
for i = 1, #release_env_set_whitelist do
if release_env_set_whitelist[i] == name then
return false
end
end
-- variable is blacklisted
return true
end
-- allow indiscriminate getenv
return false
end
Environment blacklist function for lib_env.
too long tyler
UwU
hey i have question how do i learn roblox coding because roblox has different things

