Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Scrip in StarterGUI isnt working?

Asked by 3 months ago

so this is a script inside a frame that's inside a GUI and that GUI is inside a StarterGUI. The script makes it so if you touch one part, a GUI appears, but if you touch another part then the GUI disappears (or at least the text) The 1st part of the script works, but the 2nd part doesn't. any help?

local Part = workspace:FindFirstChild("Why")

Part.Touched:Connect(function(PartThatTouchedThePart)

wait(1)



script.Parent.Text.TextTransparency = 0



script.Parent.Text2.TextTransparency = 0

end)



local Part = workspace:FindFirstChild("PIZZA")

Part.Touched:Connect(function(PartThatTouchedThePart)

wait(1)



script.Parent.Text.TextTransparency = 1



script.Parent.Text2.TextTransparency = 1

print("NYEAH!")

end)

1 answer

Log in to vote
1
Answered by 3 months ago
Edited 3 months ago

you only tell the script to make the text invisible, instead of doing that you should make the gui invisible(the text will be invisible too) by typing the following

local Part = workspace:FindFirstChild("Why")

Part.Touched:Connect(function(hit)
if hit:FindFirstChild("Humanoid") then--this will see if u have touched the part

wait(1)



script.Parent.Parent.Enabled= false--this will make the gui invisible and not active
end



end)



local Part = workspace:FindFirstChild("PIZZA")

Part.Touched:Connect(function(hit)
if hit:FindFirstChild("Humanoid") then

wait(1)



script.Parent.Parent.Enabled= true--this will make the gui visible and active



print("NYEAH!")
end

end)
0
tried it out and it worked! thanks! Adenandpuppy 45 — 3mo
Ad

Answer this question