- BrickPlanet Forum
- Game & Scripting Discussion
- anyone have a script for this
ok i need a script that when you touch the script's parent you get set to a specific team based on its name idk if its actually possible but soemeone please make it
This is from roblox but you can try to see if it works...
Place the following script inside of the block, or sphere, or whatever other object - Make a new part for every team and copy-paste the same script just changing the team colour. For example, you have a "police" team, so you make the team let's say light blue and have this script inside of a block. Then you have a "military" team, which is neon green, or whatever other colour and put the same script inside of a new block, just changing the colour on the second line:
in the second line change the 'BrickColor' to the colour of the team you want the player to become
local Enabled = true local Team = BrickColor.new("your colour here")
script.Parent.Touched:Connect(function(Hit) if Hit.Parent:FindFirstChild("Humanoid") then if Enabled == true then Enabled = false local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) Player.TeamColor = Team Enabled = true end end end)
Ignore the indentation errors here - brick planet did that ~_~
Ignore the indentation errors here - brick planet did that ~_~
*Brick Planet auto-ajusted the text
And, before anyone says anything: BP uses lua in a very similar way to Roblox, so in theory, scripts should be easy to carry over from one platform to another
Here ya go (this one will like actually work lol)
-- set a team name variable
TeamName = "Team 1"
-- give it a color
TeamColor = PartColor.New(255, 0, 0) -- (R, G, B)
-- set a variable that goes to the brick
local TeamPart = Workspace.Brick
-- create the teams
Leaderboard.CreateTeam(TeamName, TeamColor)
-- make a function that sets the players team
local function setPlayerTeam(plr) if plr.UserId then -- check if the touched part is a player Leaderboard.SetPlayerTeam(plr, TeamName) -- set the players team when the function is fired end end
TeamPart.Touched:Connect(setPlayerTeam) -- connect the function to when a player touches the part
waltuh
waltuh omg
Walter white!,!,