Character isn't blinking in-game

My Character isn’t blinking in-game why?

I’m still pretty new to scripting and I don’t know why the script isn’t in the character in-game.

help
in-studio

help2

in-game

help3
and the script is gone?

1 Like

Did you put the starter character into StarterPlayer?

Are the textures valid on roblox yet? (Moderation-wise)

and the script is gone?

How are you applying the script to the model?

EDIT: Also that script can be improved. You could make a table for the changing of the eye texture and then iterate across it. Here’s an example (note: i didn’t really test this, but it should work in theory)

local anim = {
	{
		["TextureId"] = "assetid";
		["Delay"] = 0.1;
	};
	{
		["TextureId"] = "assetid";
		["Delay"] = 0.1;
	};
}

while true do
	for _,v in pairs(anim) do
		script.parent.mesh.TextureId = v.TexturedId
		wait(v.Delay)
	end
end

That’s pretty cool. Didn’t know we can do that. I think, with my work with scratch, you need an event and then make it increase or decrease the time and change it once and then put that in a loop. Don’t take my advice though, as I don’t know if I’m right or not.

2 Likes

Another issue you may be having is that the decals are taking time to load. A image of the output would help greatly.

Also, go to Roblox and see if the decals are cleared. (Not showing the N/A page)

Another issue you may be having is that the decals are taking time to load.

This is a good point, and it would be a good idea to preload your assets.

I would like to point out that the tone of this reply is not encouraging Anthony to improve. His suggestion was in good faith, and it would’ve been more appropriate to point him to a resource for him to read up on instead of just saying “go learn roblox lua”.

Going along with this: @Anthony2003Epic, events in scratch do not translate over to Roblox. If you want to learn how to use Lua in the context of Roblox, here is an index of all the tutorials Roblox has to offer.

EDIT: fixed incorrect apostrophe in final paragraph

5 Likes

What this would look like in code:

local CP = game:GetService("ContentProvider")
local assets = 
{
  "assetid",
  "assetid"
};

local decal = Instance.new("Decal");

for i = 1, #assets do
    decal.Texture = assets[i]
    spawn(function()
       CP:PreloadAsync({decal}) -- yielding function
    end)
end

edit: replied to wrong person :stuck_out_tongue:

Continuing down this thread of suggestions, you could potentially store all of the animations as ModuleScripts, and then have a module in charge of preloading assets and running animations on objects.

Example hierarchy:
image

EDIT: they are not called module files, they’re called ModuleScripts

If memory serves me correctly, scripts in StarterCharacters do not get cloned when constructing the humanoid. You should instead look to putting the blink script under StarterCharacterScripts and having it work differently.

I don’t typically recommend adding scripts into parts like this. My principle is usually to have a script operable from a top-level in the hierarchy: in this case, the script being under the character.

Put the script in the StarterCharacterScripts folder. You can find it in the StarterPlayer folder

There are some useful tips here :smile:
I apologize for this very long reply but I hope you find it useful!

Here are some things to keep in mind:
If you are using a LocalScript (a client script) to change the location of the Face Changer Script it will only be moved on the client which means the server which executes that script will have it in a different location.

If you are placing this script anywhere in StarterPlayerScripts it will not work in live games. StarterPlayerScripts only loads scripts on the client so the same problem will happen and the server script will not even exist on the server.

As @CodeAnomaly pointed out you can place your script in StarterCharacterScripts which will move the script into the player’s Character every time it is loaded.

Also here’s a neat tip which I use: To achieve a similar effect to StarterPlayerScripts for server sided scripts you can use a slightly hacky solution and create a ScreenGui inside of StarterGui with the ResetOnSpawn property disabled. This means that the gui will never be reset and that also means the script located inside of it will also never be reset which is the same effect of StarterPlayerScripts but server scripts can load there.

You can also place scripts inside of the StarterPack or by themselves in the StarterGui and they will reset when the player respawns.

This is all due to replication. Replication is basically a “filtering” system which only lets the client do some basic things like remotes and character movement. That means the client can’t change the Parent of objects or move parts around on its own. The reason that Roblox works this way is to prevent people from modifying the game and doing unwanted things which other players can see (like changing their score).

Fun fact: Roblox used to have the option to disable this and before that they did not even have this “filtering” system which was originally called “FilteringEnabled.”

Also welcome to Roblox! Funnily enough I’ve actually just started learning to use scratch haha :smile:

Somewhat off-topic a little, you can improve the script and loading by utilizing the texture offsets feature/making a sprite. You can arrange the eye decal into one image, make sure you know the size/dimensions, once you got that in your mind, you can offset it to fit it, effectively giving the illusion of the image changing to multiple images/moving. Someone created a tutorial/resource just for this type of deal.

2 Likes