I am trying to make a script where if you touch a part UI come up. I have this for all of the parts but only the first function works. How do I make all of them work?
There are no errors in outputed, and the script is in StarterGui
Problom: When I hit the first one the UI come up but when I hit the other one UI should also come up But it does not. Like in the videio
local Animator = game.Workspace.Map.Jobs.HitBoxes:WaitForChild("Animator")
local Artist = game.Workspace.Map.Jobs.HitBoxes:WaitForChild("Artist")
local Builder = game.Workspace.Map.Jobs.HitBoxes:WaitForChild("Builder")
local ClothingDesigner = game.Workspace.Map.Jobs.HitBoxes:WaitForChild("ClothingDesiner")
local Composer = game.Workspace.Map.Jobs.HitBoxes:WaitForChild("Composer")
local Modeler = game.Workspace.Map.Jobs.HitBoxes:WaitForChild("Modeler")
local Scripter = game.Workspace.Map.Jobs.HitBoxes:WaitForChild("Scripter")
local UIDesigner= game.Workspace.Map.Jobs.HitBoxes:WaitForChild("UIDesigner")
Animator.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.JobUI.AnimatorFrame.Visible = true
repeat task.wait() until (Animator.Position - Hit.Parent.HumanoidRootPart.Position).magnitude >= 12
script.Parent.Parent.JobUI.AnimatorFrame.Visible = false
end
end)
Artist.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.JobUI.ArtistFrame.Visible = true
repeat task.wait() until (Animator.Position - Hit.Parent.HumanoidRootPart.Position).magnitude >= 12
script.Parent.Parent.JobUI.ArtistFrame.Visible = false
end
end)
Builder.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.JobUI.BuilderFrame.Visible = true
repeat task.wait() until (Animator.Position - Hit.Parent.HumanoidRootPart.Position).magnitude >= 12
script.Parent.Parent.JobUI.BuilderFrame.Visible = false
end
end)
ClothingDesigner.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.JobUI.ClothingFrame.Visible = true
repeat task.wait() until (Animator.Position - Hit.Parent.HumanoidRootPart.Position).magnitude >= 12
script.Parent.Parent.JobUI.ClothingFrame.Visible = false
end
end)
Composer.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.JobUI.ComposerFrame.Visible = true
repeat task.wait() until (Animator.Position - Hit.Parent.HumanoidRootPart.Position).magnitude >= 12
script.Parent.Parent.JobUI.ComposerFrame.Visible = false
end
end)
Modeler.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.JobUI.ModelerFrame.Visible = true
repeat task.wait() until (Animator.Position - Hit.Parent.HumanoidRootPart.Position).magnitude >= 12
script.Parent.Parent.JobUI.ModelerFrame.Visible = false
end
end)
Scripter.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.JobUI.ScripterFrame.Visible = true
repeat task.wait() until (Animator.Position - Hit.Parent.HumanoidRootPart.Position).magnitude >= 12
script.Parent.Parent.JobUI.ScripterFrame.Visible = false
end
end)
UIDesigner.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.JobUI.UIDFrame.Visible = true
repeat task.wait() until (Animator.Position - Hit.Parent.HumanoidRootPart.Position).magnitude >= 12
script.Parent.Parent.JobUI.UIDFrame.Visible = false
end
end)