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

Can Someone check if this script is also correct? [It's a local script]

script.Parent.MouseButton1Click:Connect(function(Player)
    if game.Players.LocalPlayer.leaderstats.LifeFormFound.Value >= 4 then   
     game.Players.LocalPlayer.Character.LowerTorso.CFrame = CFrame.new(workspace.Point.Position)
    Player.PlayerGui.TestGui.Frame.Visible = true
    else print('Fail')
    end
    end)

can someone check why is it not correct? it keeps giving me the error message that says " Players.RainbowBeastYT.PlayerGui.ScreenGui2.TextButton.LocalScript:4: attempt to index local 'Player' (a nil value)"

1 comment

0

Please properly indent your code as it makes it easy to read and debug.

1 answer

✓ Accepted answer

Here

script.Parent.MouseButton1Click:Connect(function(Player)
	    if game.Players.LocalPlayer.leaderstats.LifeFormFound.Value >= 4 then  
	     game.Players.LocalPlayer.Character.LowerTorso.CFrame = CFrame.new(workspace.Point.Position)
	    game.Players.LocalPlayer.PlayerGui.TestGui.Frame.Visible = true
	    else print('Fail')
	    end
	    end)

If its correct mark it as correct

4 comments

0

Do not remind users to accept your answer! If you truly helped them, it's nature for them to accept your answer, also, you'll get a nil value error LMAO.

0

ok , and no i wont get nil value , because hes using a local script

0

Yeah, but the MouseButton1Click doesn't pass anything. Line 1 will still error.

0

Please properly indent your code as it makes it easy to read and debug.

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