Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

3 comments

0

so this script is inside a script? where is the location of the two scripts

0

StarterCharacterScripts.

0

I updated the script and changes its location to the ServerScriptService.

1 answer

✓ Accepted answer

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 '='.

This discussion is preserved as it was. New answers, comments, and votes are closed.