ModBasic

ModBasic is a simple module script for managing player actions in a game. It provides functions to kick, freeze, and unfreeze players. These functions can be used to control player behavior within the game environment.

Functions

kick(player, reason)

Kicks a player from the game with a specified reason.

Parameters:

Usage Example:

local mod = require(game.ServerScriptService.ModBasic)

local playerToKick = game.Players.LocalPlayer
local kickReason = "Inappropriate behavior"
mod.kick(playerToKick, kickReason)

freeze(player)

Freezes a player's character in place by anchoring their HumanoidRootPart.

Parameters:

Usage Example:

local mod = require(game.ServerScriptService.ModBasic)

local playerToFreeze = game.Players.LocalPlayer
mod.freeze(playerToFreeze)

unfreeze(player)

Unfreezes a player's character by unanchoring their HumanoidRootPart.

Parameters:

Usage Example:

local mod = require(game.ServerScriptService.ModBasic)

local playerToUnfreeze = game.Players.LocalPlayer
mod.unfreeze(playerToUnfreeze)

How to Use

  1. Add the ModBasic module script to ServerScriptService or ReplicatedStorage in your game.
  2. In your script, require the module using:
    local mod = require(game.ServerScriptService.ModBasic)
  3. Use the provided functions (kick, freeze, unfreeze) as needed.

Error Handling

Each function checks whether the input player is a valid Player instance. If the input is not a Player object or is not an instance, an error message will be printed in the output:

Example Script

Example Script:

local mod = require(game.ServerScriptService.ModBasic)

local function handlePlayerActions(player)
    -- Kick the player with a reason
    mod.kick(player, "Rule violation")

    -- Freeze the player
    mod.freeze(player)

    -- Unfreeze the player after some time
    wait(5)
    mod.unfreeze(player)
end

Platform Update Incoming!

SkunkPlatform ➜ DiamondPlatform

We're excited to announce that SkunkPlatform will soon be renamed to DiamondPlatform! Expect a fresh new look and improved features.