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

Way to check what number a player says?

Asked by 5 years ago

So I'm trying to make a 'SetHealth' command for players, where if they type '/sethealth' and then a number after, it will make their health that number. But the problem is, I know of 0 way to reference that number. I'm trying something like:

game.Players.PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(msg)
        if msg == "/sethealth"..a and a == type.Number then
            local H = game.Workspace:WaitForChild(plr.Name).Humanoid
            H.Health = a
        end
    end)
end)

but it's not working /: any help?

0
type(a) == "number" User#19524 175 — 5y
0
Bro we discussed this before. Don't just say stuff without context SBlankthorn 329 — 5y
0
i'm sure you'd know where to place it lol User#19524 175 — 5y
0
Doesn't really warrant an explanation considering you were trying to do the same thing o.O Azarth 3141 — 5y
View all comments (2 more)
0
who me User#19524 175 — 5y
0
And actually No, Incapaz, I don't know where to place it. SBlankthorn 329 — 5y

Answer this question