A simple pet blink system not working. Help appreciated

tried to make a pet blinking system and it wont work!

theres no errors and im wondering why it wont work!

local deer = script.Parent
local config = game.Lighting.Config

--------------------------- blink function

wait(4.5)
deer.Head.Eyes.Parent = config
config.Blink.Parent = deer.Head
wait(0.6)
config.Eyes.Parent = deer.Head
deer.Head.Blink.Parent = config

Did you weld the eyes and stuff to the deer?

Just use transparency instead, way simpler and easy

1 Like

Is that the whole script? If yes then it’s pretty obvious the code will run only once since from what I can see it’s not in a function or a loop. But I don’t really know how you’re trying to make it blink with the code you sent, you should prob send a image of how everything is set up in the studio.

1 Like

That is correct. If the code is not in a function than it won’t work at all because the game needs to know when it should run the script. It would be great if you showed us the picture of the script inside of the explorer and if you could tell us when you want the script to run(for example when you equip the pet).

I’m a bit confused! Can you show us how everything is set up in Studio? Also, I don’t see any functions nor loops in your code. Therefore, the pet will only blink once. There are other simple and easier methods that you could use as well such as transparency, etc.

you are setting a value not a propety
try

local deer = script.Parent
local config = nil

--------------------------- blink function

wait(4.5)
deer.Head.Eyes.Parent = game.Lighting.Config
game.Lighting.Config.Blink.Parent = deer.Head
wait(0.6)
game.Lighting.Config.Eyes.Parent = deer.Head
deer.Head.Blink.Parent = game.Lighting.Config

i replaced

with game.Lighting.Config

1 Like

That’s exactly what he did, he just used a variable for it instead. Also why did you keep the config variable and set it to nil?

its only going to run once you have to loop it