Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Please help me, there is an error code in my AFK System Scripting. How can I fix this?

Hello, I really need a help on this AFK System Script. There is an error code on this script:

wait ()

local Char =script.Parent local AFKTag = script:FindFirstChild("AFKTag")

local AFKTagClone = AFKTagClone:Clone() AFKTagClone.Parent = Char:FindFirstChild("Head") AFKTagClone.Adornee = Char:FindFirstChild("Head")

The 'local AFKTagClone = AFKTagClone:Clone()' second AFKTagClone has an orange underline, I know the meaning of it but I really need a help. It would mean a lot if you helped me out, thanks.

2 comments

0

Please put your code in a code block with the blue lua button. It's really hard to read

0

Do local AFKTagClone = AFKTag:Clone()

1 answer

You are trying to clone something that doesnt even exists there is your fixed script

wait ()
local Char =script.Parent
local AFKTag = script:WaitForChild("AFKTag")

local AFKTagClone = AFKTag:Clone()
AFKTagClone.Parent = Char:FindFirstChild("Head")
AFKTagClone.Adornee = Char:FindFirstChild("Head")

Also other players cant see it because its LocalScript inside StarterCharacterScripts right?

1 comment

0

You should do WaitForChild("Head") cause if the head doesn't exist yet...

This discussion is preserved as it was. New answers, comments, and votes are closed.