I'm having difficulties changing an object's transparency to opaque when hello is said. I tried using EpicMetableMoment's script, when hello was said, it would change from white to black. I tried to change it to change the transparency of an object but I couldn't get it to work. Here is the code.
-- If true, make part visible
local players = game:GetService("Players")
local part = workspace:WaitForChild("Transparency")
local isTransparent = true --// our toggling variable
local function togglePartColor()
if isTransparent then --// check if transparent
isTransparent = false --// set to false since we are making opaque
part.Transparency = 0 --// change to opaque
elseif not isTransparent then --// check if transparent
isTransparent = true --// set to true since we are making Transparent
part.Transparency = 1 --// set part transparency to transparent
end
end
local function checkForCommand(message)
local command = message:lower() --// make message lowercase
if command == "hello" then --// check if this is our command
togglePartColor() --// if its the command then toggle part's color
end
end
local function playerAdded(player)
player.Chatted:Connect(checkForCommand) --// connect chat event
end
players.PlayerAdded:Connect(playerAdded) --// connect player added so we can get reference to players who join
I'm very new to Roblox Lua so please don't get mad if I'm doing this completely wrong. Thanks for any help I get!

1 comment
Great, thank you!