I’m trying to create a script that gives money to Premium players only every few minutes. In the output window it says this about line four
"attempt to index nil with ‘MembershipType’ "
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.MembershipType == Enum.MembershipType.Premium then
while wait(180) do
player.leaderstats.Money.Value = player.leaderstats.Money.Value + 10000 --10k
end
end
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
if player.MembershipType == Enum.MembershipType.Premium then
while wait(180) do
player.leaderstats.Money.Value = player.leaderstats.Money.Value + 10000 --10k
end
end
end)