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

Can you Combine two script together?

Hey I need little help, this just a change team script, here is two script I need to combine

function Click(mouse) 
if script.Parent.Parent.Parent.Parent.Parent.Parent:IsInGroup(0) and script.Parent.Parent.Parent.Parent.Parent.Parent:GetRankInGroup(0) >= 1 then 
script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright blue") 
end 
end 

script.Parent.MouseButton1Click:connect(Click)

and this one

function onButtonClicked()
script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end

script.Parent.MouseButton1Click:connect(onButtonClicked)

and can you fix this script only change health player to 0 when player in group

1 comment

0

I dont know what you are trying to do with this script but, this is a way of linking scripts... http://wiki.roblox.com/index.php?title=API:Class/BindableEvent

1 answer

function Click(mouse) 
if script.Parent.Parent.Parent.Parent.Parent.Parent:IsInGroup(0) and script.Parent.Parent.Parent.Parent.Parent.Parent:GetRankInGroup(0) >= 1 then 
script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright blue") 
script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 -- Just add it to the bottom of the function!
end 
end 

script.Parent.MouseButton1Click:connect(Click)


3 comments

0

Doesnt work

0

Did you change the groupid from 0 to your actual group id?

0

Yes

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