RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a command chat system with 4 random commands"
-- server script local commands = {"dance", "spin", "jump", "wave"} game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) for _, command in pairs(commands) do if message:lower() == "/"..command then -- do something based on the command if command == "dance" then player.Character.Humanoid:LoadAnimation(game:GetService("ReplicatedStorage").Animations.Dance):Play() elseif command == "spin" then player.Character.HumanoidRootPart.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.Angles(0, math.rad(360), 0) elseif command == "jump" then player.Character.Humanoid.Jump = true elseif command == "wave" then player.Character.Humanoid:LoadAnimation(game:GetService("ReplicatedStorage").Animations.Wave):Play() end end end end) end)