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

[Basic Scripting]How come my script isn't being enabled?

Asked by 2 years ago
Edited 2 years ago

I'm trying to enable a script whenever a character loads but it never happens, what's the problem? Its in the serverscriptservice

game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAppearanceLoaded:Connect(function(Character)
        local DropSystem = Character:WaitForChild("DropSystem")

        if Player.Team.Name == not "Selection" then
            DropSystem.Parent.Disabled = false
        end
    end)
end)
0
so this script is inside a script? where is the location of the two scripts FirewolfYT_751 223 — 2y
0
StarterCharacterScripts. vincentthecat1 199 — 2y
0
I updated the script and changes its location to the ServerScriptService. vincentthecat1 199 — 2y

1 answer

Log in to vote
1
Answered by 2 years ago

I don't think that "not" at line 5 should be there, instead you should change it with this:

game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAppearanceLoaded:Connect(function(Character)
        local DropSystem = Character:WaitForChild("DropSystem")

        if Player.Team.Name ~=  "Selection" then
            DropSystem.Parent.Disabled = false
        end
    end)
end)

if you want the if statement to check if the player's team name is not "Selection". But if you want the if statement to check is the player's team name is "Selection" just change the symbol '~' to '='.

Ad

Answer this question