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

How to make typewalker animation appear after touching something?

Asked by 4 years ago

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)
0
i in first script should be small, i know, thats not an error, that because im on mobile AnasBahauddin1978 715 — 4y

1 answer

Log in to vote
1
Answered by
starmaq 1290 Moderation Voter
4 years ago

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.

0
I put the first script in a localscript AnasBahauddin1978 715 — 4y
0
ah i c starmaq 1290 — 4y
Ad

Answer this question