Customisable Spell Keybinds
Key Required

Customisable Spell Keybinds

Magic Trainingsquinchsquinch 331 views 12 executesUpdated Jan 27, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•55 lines (1670 chars)
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextChatService = game:GetService("TextChatService")

local spellKeybinds = {
    [Enum.KeyCode.Q] = "protego",
    [Enum.KeyCode.E] = "expelliarmus",
    [Enum.KeyCode.R] = "apparate",
    [Enum.KeyCode.F] = "avada kedavra",
    [Enum.KeyCode.G] = "deletrius",
    [Enum.KeyCode.Z] = "duro",
    [Enum.KeyCode.X] = "impedimentia",
    [Enum.KeyCode.C] = "crucio",
    [Enum.KeyCode.V] = "obliviate",
    [Enum.KeyCode.B] = "protego totalum"
}

local cooldowns = {}

local function saySpell(message)
    if TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then
        local channels = TextChatService:FindFirstChild("TextChannels")
        if channels then
            local rbxGeneral = channels:FindFirstChild("RBXGeneral")
            if rbxGeneral then
                rbxGeneral:SendAsync(message)
                return
            end
        end
    end

    local ChatEvents = ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents")
    if ChatEvents then
        local SayMessageRequest = ChatEvents:FindFirstChild("SayMessageRequest")
        if SayMessageRequest then
            SayMessageRequest:FireServer(message, "All")
            return
        end
    end
end

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end

    local key = input.KeyCode
    local spell = spellKeybinds[key]

    if spell and not cooldowns[key] then
        saySpell(spell)

        cooldowns[key] = true
        task.wait(0.5)
        cooldowns[key] = false
    end
end)

Features & Information

Remappable keybinds for this game ( [Enum.KeyCode.Q] = "protego", ) (change protego for any other spell etc.
#magic training

Community Comments (1)

squinchsquinchJan 27, 2026

forgot to mention, theres a cooldown so you dont get kicked for spam

More Scripts for Magic Training