What do you want to achieve? If player touched the part, the text changes.
What is the issue? IT do nothing.
What solutions have you tried so far? Yes, but no solutions.
local Text = script.Parent.Part2.SurfaceGui.TextLabel.TextTransparency
local Touch = script.Parent.Part
local character = script.Parent.Parent
local humanoid = character:WaitForChild("Humanoid")
Touch.Touched:Connect(function(hit)
if hit.Parent.Parent:FindFirstChild("Humanoid") then
Text = 0
wait(0.5)
Text = 1
wait(0.5)
Text = 0
wait(0.5)
Text = 1
wait(0.5)
Text = 0
wait(2.5)
Text = 1
end
end)
you need to index the property you want to change, otherwise you are changing the value of the Text variable instead of the property value
also you can use loop statements to repeat patterns
local Text = script.Parent.Part2.SurfaceGui.TextLabel
local Touch = script.Parent.Part
local Character = script.Parent.Parent
Touch.Touched:Connect(function(Hit)
local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
if Humanoid then
for i = 1, 3 do
Text.TextTransparency = 0
task.wait(0.5)
Text.TextTransparency = 1
end
end
end)