==== WARNING! THIS IS ARCHIVED ANSWER =====
I am not sure about the code you're writing and I don't know how to explain the solution. Anyway here's the code to fix
Solution Code
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
end)
end)
You can't save an event in a variable and then call it later like the code below
local Players = game: GetService("Players").PlayerAdded
Players:Connect(function(Player)
end)
I don't know why but it just happens that you can't save an event into a variable and then make a variable (event) connect function.
Happy Scripting!
==== REWRITTEN ANSWER ====
You are trying to check something that never exists. It's possible that you never declared the variable which when the script tries to check then it will return nil because the variable never exists.
Fixed Code (Note: Using Var as true)
local Var == true
local Players = game:GetService("Players").PlayerAdded
Players:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if Var == true then
else
end
end)
end)
In the future, you may want to try and check if the things you are checking actually exists if it never exists then it will return nil. You can even use if var == nil then and it will trigger this condition.
Happy Scripting!
1 comment
line 1 works perfectly by the way