Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont my superadmin script with chat commands work?

Asked by 4 years ago

this is a local script

local player = game.Players.LocalPlayer
    player.Chatted:Connect(function(msg)

    if msg:lower():match("gravity") then

    local value = msg:sub(8)

    print(value)

    game.ReplicatedStorage:WaitForChild("gravity"):FireServer(value)

    end

    if msg:lower():match("kill") then

    if game.Players:FindFirstChild(msg:sub(6)) then

    local target = game.Players:FindFirstChild(msg:sub(6))

    print(target)

    game.ReplicatedStorage:WaitForChild("kill"):FireServer(target)

    end

    end

    end)

no prints and no errors, when i run this from a script inside a folder it works perfectly, WHY

Answer this question