I would like to make a invis cmd that allows me to change the invis for other players but be slightly transparent to still see myself
1 Like
The new ROBLOX TextChatService
service provides native command support.
Insert a TextChatCommand
named "InvisCommand"
into TextChatService
, set it aliases to /invis
and /invisible
(or whatever you prefer, it doesn’t quite matter here).
Here is a framework for such a command:
-- Variable paths to TextChatService and your invisibility command instance
local TextChatService = game:GetService("TextChatService")
local InvisCommand = TextChatService:WaitForChild("InvisCommand")
-- When a user types /invis or /invisible, this event will be triggered
InvisCommand.Triggered:Connect(function(textSource, message)
-- Code that makes users invisible goes here!
end)
Of course, you will have to make sure
- The player using the command has permissions to do so
- The invisiblity occurs on the client, unless you want the effect to be global
Once you can run code, there’s 2 scripts you need: a server script and a client script. The server script will set all parts to invisible, and if it was already invisible, add a tag (value or something). On the client, make sure it runs second, then set all untagged parts to 0.5 transparency. To reverse, make all untagged parts visible on the server, as nothing needs to be done on the client.