RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"can you make a cmdr invisible script with with a 'invisible' script and 'invisibleServer' script"
Yes, here's an example of how you can create a Cmdr command to make a player invisible using two scripts - "Invisible" and "InvisibleServer". 1. Create a new ModuleScript in ServerScriptService and name it "CmdrModules" 2. Inside the CmdrModules, create a new ModuleScript and name it "Invisible" -- Invisible ModuleScript ```lua local Invisible = {} Invisible.Name = "invisible" Invisible.Alias = {"invis"} Invisible.Description = "Makes the player invisible." Invisible.Args = { { Type = "players"; Name = "players"; Description = "The players you want to make invisible"; } } function Invisible:Run(context, players) for _, player in ipairs(players) do context.Executor:SendTo(player, "InvisibleServer", true) end return "Made " .. #players .. " player(s) invisible." end return Invisible ``` 3. Create a new LocalScript in StarterPlayerScripts and name it "InvisibleServer" -- InvisibleServer LocalScript ```lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local CmdrClient = require(ReplicatedStorage:WaitForChild("CmdrClient")) CmdrClient:RegisterCallback("InvisibleServer", function(isInvisible) local character = game.Players.LocalPlayer.Character if character then for _, part in ipairs(character:GetChildren()) do if part:IsA("BasePart") or part:IsA("Decal") then part.Transparency = isInvisible and 1 or 0 end end end end) ``` 4. Install Cmdr into your game (https://www.roblox.com/library/2484242319/Cmdr) and set up the CmdrClient in ReplicatedStorage and CmdrServer in ServerScriptService according to the documentation. 5. In the CmdrServer script, add the following line to require the CmdrModules folder: ```lua Cmdr:RegisterHooksIn(game.ServerScriptService.CmdrModules) ``` Now, you can use the "invisible" command in-game to make the specified player(s) invisible.