I am not well experienced in scripting however this is the one true place I can understand.
Background: I am creating a model that starts an NPC as a child state and a few seconds later turns into an adult/adolescent. The way I am deciding to do this is with this script.
wait(5) script.Parent.Head.Transparency = 0 script.Parent.Left Arm.Transparency = 0 script.Parent.Left Leg.Transparency = 0 script.Parent.Right Arm.Transparency = 0 script.Parent.Right Leg.Transparency = 0 script.Parent.Torso.Skull.Transparency = 0 script.Parent.Torso.Carapace.Transparency = 0 script.Parent.Torso.Carapace1.Transparency = 1 script.Parent.Torso.Tail.Transparency = 0 script.Parent.Torso.Tail1.Transparency = 1 script.Parent.Torso.torso.Transparency = 0 script.Parent.Torso.Spines.Transparency = 0
The way this works is that there are two appearances in the model and the adult appearance is transparent for a given amount of time and then becomes visible as the initial appearance goes invisible. When I try this script on my NPC, it will only go up to line 2, and the head will be visible but everything else is invisible. I do understand that the spaces in the script affect it and I do not know what do I replace the spaces with.
Issue (just in case): The spaces in the script prevent it from working, what do i replace them with?
Edit 1: Inserted code block.
Hello, there is a simple issue to understand, spaces and . and those types of keyboard characters do not work when scripting, this is why your script does not function properly, to fix this problem, simply take dot away thats before the name and put name inside this --> [""]
for example, a line should like like this
script.Parent["Left Leg"].Transparency = 0
and not
script.Parent.Left Leg.Transparency = 0
I added [" "], hope this helps ! :)
Thanks to CommanderCaubunsia I was able to fix this script. Here is the script II have modified.
wait(5) script.Parent.Head.Transparency = 0 script.Parent['Left Arm'].Transparency = 0 script.Parent['Left Leg'].Transparency = 0 script.Parent['Right Arm'].Transparency = 0 script.Parent['Right Leg'].Transparency = 0 script.Parent.Torso.Skull.Transparency = 0 script.Parent.Torso.Carapace.Transparency = 0 script.Parent.Torso.Carapace1.Transparency = 1 script.Parent.Torso.Tail.Transparency = 0 script.Parent.Torso.Tail1.Transparency = 1 script.Parent.Torso.torso.Transparency = 0 script.Parent.Torso.Spines.Transparency = 0
She was on the right path however you only use (') instead of ("). The script works beautifully. Thank you all for your help.