Can anyone see a problem with what is indexed below? I have made sure the variables are correctly found, I have tested this script in game with a report-error thing, and it doesn't show an error. (Yes, there is more to the script, this is just a piece of it.)
elseif string.sub(string.lower(msg),1,13) == "openFrontDoor" then mdoor.Transparency = 0.4 mdoor.CanCollide = false elseif string.sub(string.lower(msg),1,14) == "closeFrontDoor" then mdoor.Transparency = 0 mdoor.CanCollide = true
elseif string.sub(string.lower(msg),1,13) == "openfrontdoor" then mdoor.Transparency = 0.4 mdoor.CanCollide = false elseif string.sub(string.lower(msg),1,14) == "closefrontdoor" then mdoor.Transparency = 0 mdoor.CanCollide = true
Your script was not working because you were calling string.lower on the message, which makes all letters lowercase, then comparing it to a string that contains capital letters.
There's supposed to be a space in between else and if. I know I didn't fully answer this because I'm new to scripting also, but this is what I know.
else if string.sub(string.lower(msg),1,13) == "openFrontDoor" then mdoor.Transparency = 0.4 mdoor.CanCollide = false else if string.sub(string.lower(msg),1,14) == "closeFrontDoor" then mdoor.Transparency = 0 mdoor.CanCollide = true