of     1   

buildmodel
#189997558Sunday, May 29, 2016 5:53 PM GMT

So what I want is > player touch brick and identify what team player is on But I want to use a regular script How would I go about doing this?
CeaselessQuokka
#189997916Sunday, May 29, 2016 5:57 PM GMT

script.Parent.Touched:connect(function(hit) local hasHumanoid = hit.Parent:FindFirstChild("Humanoid"); local player = hasHumanoid and game:GetPlayersFromCharacter(hit.Parent); if playerthen local teamColor = player.TeamColor; print(teamColor); end end); Matthew is my little PF snake.
Pyracel
#189997975Sunday, May 29, 2016 5:57 PM GMT

brick.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local Player = hit.Parent:GetPlayerFromCharacter() print(Player.TeamColor) end end) Somethijng like that, if anyone would edit my code that would be gr8.
buildmodel
#190000665Sunday, May 29, 2016 6:22 PM GMT

@Cease GetPlayersFromCharacter is not a valid member of DataModel
CeaselessQuokka
#190001705Sunday, May 29, 2016 6:33 PM GMT

Whoops, game.Players:GetPlayerFromCharacter(hit.Parent), sorry. Matthew is my little PF snake.
Pyracel
#190004797Sunday, May 29, 2016 7:27 PM GMT

...I does it correctly, gets no credit...
CeaselessQuokka
#190005246Sunday, May 29, 2016 7:33 PM GMT

You should expect nothing back if you're going to help someone. Give more, expect less. Matthew is my little PF snake.
CeaselessQuokka
#190005298Sunday, May 29, 2016 7:34 PM GMT

Also, no you didn't. Yours would error. Matthew is my little PF snake.
buildmodel
#190010387Sunday, May 29, 2016 8:40 PM GMT

Alright thank you all! Cease nice to see you again :)
buildmodel
#190011642Sunday, May 29, 2016 8:57 PM GMT

Uh.. shouldn't this work? main.Touched:connect(function(hit) local hasHumanoid = hit.Parent:FindFirstChild("Humanoid") local player = hasHumanoid and game.Players:GetPlayerFromCharacter(hit.Parent) if player then if player.TeamColor == "Black" then print("hello") end end end)
Oslayis
#190011747Sunday, May 29, 2016 8:58 PM GMT

Try this; main.Touched:connect(function(hit) local hasHumanoid = hit.Parent:FindFirstChild("Humanoid") local player = hasHumanoid and game.Players:GetPlayerFromCharacter(hit.Parent) if player then if player.TeamColor == BrickColor.new("Black") then print("hello") end end end)
buildmodel
#190015454Sunday, May 29, 2016 9:40 PM GMT

Alright it works thanks!

    of     1