Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Can you Combine two script together?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

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 User#5423 17 — 8y

1 answer

Log in to vote
0
Answered by
DevNetx 250 Moderation Voter
8 years ago
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)


0
Doesnt work User#13091 0 — 8y
0
Did you change the groupid from 0 to your actual group id? DevNetx 250 — 8y
0
Yes User#13091 0 — 8y
Ad

Answer this question