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

My Dialog click detector script is not working, can someone help?

Asked by 3 years ago

--I tried making a script where the gui appears when you click the npc, here is the script. --script location: local script


local ReplicatedStorage = game:GetService("ReplicatedStorage") local NPCs = workspace.NPCs local HumanoidRootPart = NPCs:WaitForChild('HumanoidRootPart') local AnimateUI = require(ReplicatedStorage:WaitForChild("AnimateUI")) local ClickDetector = workspace.hum.ClickDetector local label = script.Parent local ScreenGui = game.StarterGui:WaitForChild("ScreenGui", 0) ScreenGui.Enabled = false function onMouseClick() ScreenGui.Enabled = true local message1 = [[Hi welcome to my pogr gam]] AnimateUI.typeWrite(label, message1, 0.05) wait(1) local message2 = [[thiz iz a test]] AnimateUI.typeWrite(label, message2, 0.05) end ClickDetector.MouseClick:Connect(onMouseClick)

I keep getting, "Infinite yield possible on 'Workspace.NPCs:WaitForChild("HumanoidRootPart")' "

0
does the npc have a humanoidrp? 0fficialHen 5 — 3y
0
"Infinite Yield Possible" means that when you used ':WaitForChild("HumanoidRootPart")', it couldn't find the part. May I ask, is "NPCs" a folder/model and what are the children? Hypoxla 125 — 3y
0
NPCs is a folder yes, and the child is just the Dummy. Guest_F4ke 5 — 3y

Answer this question