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

How can I get this "GroupHandler" to work correctly?

Asked by 9 years ago

Hello everyone, I have been trying to make a "GroupHandler". Basically this is supposed to give Speed, Health, Gear, and Cash when you are in a certain group.. This following script is what I have so far, the script is in "ServerScriptService" and its a normal Script.

pcall(function()
    game.Players.PlayerAdded:connect(function(player)
        if player:IsInGroup(2628023)                then
        local cashmoney = game.ServerStorage.MoneyStorage:WaitForChild(player.Name)
        cashmoney.Value = cashmoney.Value + 500
        player.CharacterAdded:connect(function(char)
            if char:WaitForChild("Humanoid") then
                char.Humanoid.MaxHealth = char.Humanoid.MaxHealth + 15
                char.Humanoid.Health = char.Humanoid.Health + 15
                char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + 3
                game.Lighting.Minigun:Clone().Parent=player.Backpack
                end
            end)
            local msg = Instance.new("Hint",workspace)
            msg.Text = player.Name.." joined the game with Ultra V.I.P."
            wait(2)
            msg:Destroy()
            end
        end)

I am not sure why it isn't working, can you please halp?

1
You missed a end) for the pcall, BlueTaslem will say you never need to use a pcall, I would say use a pcall if someone has the potential of messing the script up. The pcall function will hide any error since it is a protective call, I would recommend putting the pcall into comments for testing purposes. M39a9am3R 3210 — 9y

Answer this question