Can't find dummy

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I would like to get in each script the dummy

  2. What is the issue? Include screenshots / videos if possible!
    I have 3 scripts. Each of them has to search the dummy that is located in a folder with the player name as folder name. One script can find it, the others can’t, mind telling me why?

1^ script - - In this script i find the dummy

--Variables
local Main = script.Parent.Parent
local Value = script.Parent

--Fuction
Value:GetPropertyChangedSignal("Value"):Connect(function()
	local Dummy = game.Workspace.Dummies:FindFirstChild(Main.Name).Dummy
	Dummy:MoveTo(game.Workspace.GrassLand.Spawner.Position)
end)

2^ Script the dummy doesn’t get found here

--Variables
local Main = script.Parent.Parent
local Value = script.Parent
local Player = game.Players:FindFirstChild(Main.Name)

Value:GetAttributeChangedSignal("Name"):Connect(function()
	local Dummy = game.Workspace.Dummies:FindFirstChild(Main.Name).Dummy
end)

Value:GetAttributeChangedSignal("ShirtColor"):Connect(function()
	local Dummy = game.Workspace.Dummies:FindFirstChild(Main.Name).Dummy
end)

Value:GetAttributeChangedSignal("BodyColor"):Connect(function()
	local Dummy = game.Workspace.Dummies:FindFirstChild(Main.Name).Dummy
end)

3^ script the dummy doesn’t get found here

--Variables
local Main = script.Parent.Parent
local Value = script.Parent
local Player = game.Players:FindFirstChild(Main.Name)

Value:GetAttributeChangedSignal("Energy"):Connect(function()
	local Dummy = game.Workspace.Dummies:FindFirstChild(Main.Name).Dummy
end)

Value:GetAttributeChangedSignal("Speed"):Connect(function()
	local Dummy = game.Workspace.Dummies:FindFirstChild(Main.Name).Dummy
end)
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried looking online, i found nothing.

How did you reach the conclusion that the dummies are not being found?

when i print each of them from each script, only the first script does return me it. The others return me “nil”

first, is all "Main"s named exactly as existing Dummies children?
second, what type of script working? local or server?

1 Like

Try using WaitForChild. It seems you are searching for them before they even get to appear (i.e., too soon).

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.