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

Why isn't this script working?


-- Training Commands ----

if msg:lower():sub(1,9) == "Open Door" then a = game.Workspace.Door a.Transparency = 1 a.CanCollide = false end

if msg:lower():sub(1,10) == "Close Door" then a = game.Workspace.Door a.Transparency = 0 a.CanCollide = true end

if msg:lower():sub(1,7) == "Load SFT" then a = game.Lighting.SFT:clone() a.Parent = workspace end

if msg:lower():sub(1,7) == "End SFT" then a = game.Workspace.SFT a:remove() end

if msg:lower():sub(1,15) == "Load Sharks" then a = game.Lighting.Sharks:clone() a.Parent = workspace end

if msg:lower():sub(1,15) == "End Sharks" then a = game.Workspace.Sharks a:remove() end

if msg:lower():sub(1,17) == "Load Ruins" then a = game.Lighting.Ruins:clone() a.Parent = workspace end

if msg:lower():sub(1,17) == "End Ruins" then a = game.Workspace.Ruins a:remove() end

(This is a part of an admin script of a group's training holo)

2 answers

Your script isn't working because the message will never match up. You said

if msg:lower() == "Capitol Letters" then

msg:lower() would convert the whole message into lowercase, so trying to make an equality of lowercase letters to uppercase will never work.

if msg:lower():sub(1,9) == "open door" then a = game.Workspace.Door a.Transparency = 1 a.CanCollide = false end

if msg:lower():sub(1,10) == "close door" then a = game.Workspace.Door a.Transparency = 0 a.CanCollide = true end

if msg:lower():sub(1,7) == "load sft" then a = game.Lighting.SFT:clone() a.Parent = workspace end

if msg:lower():sub(1,7) == "end sft" then a = game.Workspace.SFT a:remove() end

if msg:lower():sub(1,15) == "load sharks" then a = game.Lighting.Sharks:clone() a.Parent = workspace end

if msg:lower():sub(1,15) == "end sharks" then a = game.Workspace.Sharks a:remove() end

if msg:lower():sub(1,17) == "load ruins" then a = game.Lighting.Ruins:clone() a.Parent = workspace end

if msg:lower():sub(1,17) == "end ruins" then a = game.Workspace.Ruins a:remove() end

"a" ~= "A"

Maybe it's because you use msg:lower() which means thee == should be in all lower case aswell or it would compare a automatically lowered text to your's which isnt.

Thumbs up if this helps.

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