so i made a script on tables and this is what i came up ( i got it from freemodels then modified it a bit so im actually trying to learn how to script plss dont sue me from copying it @_@)
ppl = 1 repeat ppl = ppl + 1 p = game.Players:GetChildren() team2 = {} team3 = {} for num, obj in pairs(p) do if obj then if obj.PlayerGui.Play.Alive.Value then if obj.TeamColor == BrickColor.new("Bright red") then table.insert (team2,obj) elseif obj.TeamColor == BrickColor.new("Bright blue") then table.insert (team3,obj) end end end
so it is possible to make a script where in if player in team3 touched a part named blah blah blah(only team3 can touch it) then blah blah happens? if yes so how? ow and where can i learn scripting?
To do what you wanted to do you wouldn't need to use a table at all. To achieve what you've asked you simply need to use the Touched event and an if statement. An example is shown below.
script.Parent.Touched:connect(function(Part) --// Anonymous function local Player = game.Players:GetPlayerFromCharacter(Part.Parent) --// Getting the player object associated with the touched part's parent - If there isn't one this variable will be nil later on when used. if Player and Player.TeamColor == BrickColor.new("Bright blue") then --// Checks if the player variable isn't nil, and checks whether their TeamColor is the Bright blue brickcolor. print("The player is real, and their team is blue.") end --// Ending the if statement end) --// Anonymous function end
To learn more about scripting, take a look at the ROBLOX Wiki, or alternatively look around online or on the ROBLOX forums.