How To Make a Team Cap Limit | Roblox Studio
HTML-код
- Опубликовано: 30 июн 2024
- Welcome back to another video! If you enjoy then leave a like and subscribe for more videos.
Download Today's Project: www.roblox.com/library/818695...
Time Stamps:
Introduction: 0:00
Making Animation: 0:10
Making UI: 3:00
Scripting: 4:25
Finished Product: 7:15
------------------
Links
------------------
Server Team Cap Script: pastebin.com/HAqCvwR3
Set Team On Spawn Script: pastebin.com/L8Sm7tzF
Local Script Manage: pastebin.com/zjwN4H6f
Discord: / discord - Хобби
THANK YOU. Imma try his out when I get the chance :)
THANKS SO MUCH OMG!!! criminally underrated tutorial!!!
Glad it helped!
OMG THXXXXXX
bro you need like 200k subs ngl
I couldn’t make a one person only door for my roleplay game, so I’ll make it a team cap of one for the certain roles
i like how he just cuts the video when he says "and then"
can you please make it so when you click the button it tps you to the spawn you chose.
i JUST want the team cap, not the GUI with it
Man why does the video cut off early, I couldn't finish the code D:
Thank you mate! this is really helping me! and now my game are finished!
EDIT : It doesnt work lol-
What seems to be the issue
desprately trying to notifi this person so they can finish there game
@@KashTheKingYT the fact you added like 3 things when u cut the vid
Put a remote function in replicated storage
It dosen't work, I used an int value, I copied your code in the pastebin, and it still wont work.
can you do like you need to be in a group to join a team? pls i need it
Remind me 3 years when his voice gets way deeper
Lol
Its been a year already not sure if his voice is deeper or something but check him out
It says edited but I didn’t edit it to make it like that
Reminded!
i just wanted to know how to set a cap for a 2 person game, not for everything else!
I have been on my computer, trying to fix it but it still won't work at all... Everytime I clicked a team button to select, it only says the Error label. I did not skip (kinda) I copied the whole code, and still no luck. Can you help?
Here's the code (with some different stuff) : Assign Team Script (The ServerScriptService one) : game.ReplicatedStorage.Selected.OnServerInvoke = function(plr, teamName)
local team = game.Teams:FindFirstChild(teamName)
if team and team:FindFirstChild("MaxPlayers") then
if team.Cap.Value > #team:GetPlayers() then
plr:LoadCharacter()
plr.Team = team
return true
else
return false
end
end
end
Manager (One in the GUI) :
local gui = script.Parent
local buttons = gui:GetChildren()
for _,button in pairs(buttons) do
if button:IsA("GuiButton") then
button.Activated:Connect(function()
local success = game.ReplicatedStorage.Selected:InvokeServer(button.Name)
if success ~= true then
gui.Error.Visible = true
wait(1)
gui.Error.Visible = false
else
gui.Joined.Visible = true
wait(1)
gui.Joined.Visible = false
end
end)
end
end
Lastly Team Pick (StarterCharacterScripts) :
local gui = script.Parent
local buttons = gui:GetChildren()
for _,button in pairs(buttons) do
if button:IsA("GuiButton") then
button.Activated:Connect(function()
local success = game.ReplicatedStorage.Selected:InvokeServer(button.Name)
if success ~= true then
gui.Error.Visible = true
wait(1)
gui.Error.Visible = false
else
gui.Joined.Visible = true
wait(1)
gui.Joined.Visible = false
end
end)
end
end
There, please let me know if there is any problem with my script.
(I have a feeling you're just going to heart react it tbh)
Make sure to follow the step where I add the limit values to each team
Reupload this tutorial with better cuts, the reason it doesnt work is because he cuts and doesn't show us stuff that we are supposed to do
WHY COULDENT YOU HAV THE SCRIPTS IN BIO WHY
Oh dam his alive
Ikr
Can you make a hat tool? If you click it’ll equip the hat on your head and if you click again it’ll take it off
Its not working when i click to change team it dont work
same
can you make a random team chooser with a limit? P L S
YES
Im trying to make an infection type game but i want the infector to be randomized instead of selected.
local allPlayers = game.Players:GetPlayers()
local infector = allPlayers[math.Random(1,#allPlayers))
@@KashTheKingYT Where do we put it
IS NOT WORKING
whats with the random cuts
Idk why did he stop?
32nd
it doesn't work, not at all. I highly recommend you make another one please.
check your code
and then....?
Edit: I see you liked this comment but i need an answer
Edit 2:Now you unliked it
This didn’t work btw :/
What happened!?
@@KashTheKingYT when I press switch team it just says “team limit full” and the values were set to 3. Even though the team isn’t full.
@@brandon6114 god
I dont know if i skipped on bideo or what but how to make like the specific team have like 4 or 5 team limit? I dont understand where to edit the value.
The MaxPlayers int value in each team will determine it.
Change the value inside it.
Here is the timestamp: 3:53
:/