Pls help me with this, I wanted to make a typewalker animation text with touched function
I tried this in the gui
game.Workspace.Part.Touched:Connect(function(hit) Local h = hit.Parent:FindFirstChild("Humanoid") If h then Local text = "My text" for I = 1, #text do script.Parent.Text = string.sub(text, 1, i) wait(0.3) end end end)
It doesn't work nothing happens I also tried on a local script(not the same)
game.StarterGui.LocalScript.Disabled = true game.Workspace.Part.Touched:connect(function(hit) Local h = hit.Parent:FindFirstChild("Humanoid") If h then game.StarterGui.LocalScript.Disabled = false end end)
Welp the typewriter animation should work good try, but what's wrong is youre using server scripts and local script in a weird manner. For the first: I'm assuming that you made it into a server script (maybe im wrong), and you parented it to the gui, and server scripts don't work with GUIs, since UI elements are local sided which means they only work with local script, so maybe changing it to a local script would make it work.
For the second script which is a local script and should work with UIs, you have one minor problem. The script that you're referencing (game.StarterGui.LocalScript
) isn't really there. Because once the game starts everything inside of StarterGui gets copied to player.PlayerGui
including the scripts you have there.
And also the whole idea of disabling and enabling scripts isn't really recommended.