Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with this script?

Can you guys change this when touched a brick i change a team but not clicked pls

function Click(mouse)
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Really Black")
end


script.Parent.MouseButton1Down:connect(Click)

1 comment

0

This is not a request site. This is very simple to do, just go to the wiki and do some research.

1 answer

Not a request site, BUT i'm bored so i'll help.

local Brick = game.Workspace["BrickNameHere"]

Brick.Touched:connect(function(Hit)
if Hit.Parent and Hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players:FindFirstChild(Hit.Parent.Name)
if Player then
Player.TeamColor = BrickColor.new("Really Black")
end
end
end

3 comments

0

Using the GetPlayerFromCharacter() method of Players is a better way to do it than FindFirstChild().

1

Ik, I just got lazy.

0

I get the marked words Brick.Touched:connect(function(Hit)

This discussion is preserved as it was. New answers, comments, and votes are closed.