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

I need help! It says. LocalPlayer(nil value)???

local rebirth = game.Players.VenyxAllDayBaby.leaderstats.Rebirths
local close = script.Parent.Frame.Close
local frame = script.Parent.Frame
local whole = script.Parent

if rebirth.Value == 40 then
	frame.Visible = true
end

close.MouseButton1Down:Connect(function()
	whole:Destroy()
end)

2 comments

0

LocalPlayer isn't mentioned anywhere in the script. Are you sure this is the correct code snippet?

0

Try game.Players.LocalPlayer.leaderstats.Rebirths

1 answer

You are trying to index a nil value, you didn't mention LocalPlayer anywhere, make a local script and put this:

local rebirth = game.Players.LocalPlayer.leaderstats.Rebirths --Use LocalPlayer instead
local close = script.Parent.Frame.Close
local frame = script.Parent.Frame
local whole = script.Parent

if rebirth.Value == 40 then
    frame.Visible = true
end

close.MouseButton1Down:Connect(function()
    whole:Destroy()
end)

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