- BrickPlanet Forum
- Game & Scripting Discussion
- This script causes a huge error. . .
So I made a script and It causes an error saying:
[Debug] Script error: Encountered an internal error, notify the brickplanet staff if the problem persists. (System.NullReferenceException at Void SetPlayerTeam(Brickplanet.Scripting.Api. PlayerProxy, System.String)
Lua (at [string "InternalStandardLua"]:40)
I'm making a script about touching a part and switching to that team. So the script is:
Leaderboard.CreateTeam('Barcelona', PartColor.new(0,0,255))
script.Parent.Touched:connect(function(hit) Leaderboard.SetPlayerTeam('Barcelona')
end)
Is my script itself just incorrect somewhere but the engine isn't telling me or is it just an error because of the limitations of the engine or an internal bug like Hivemind said
It makes sense.
It ain't roblox lua lol. I used the Brickplanet documentation that's where i got 'CreateTeam' from. Also im pretty sure you put the name of the team in that your wanting to create/set up and so not hex code because
"Leaderboard.CreateTeam('Barcelona', PartColor.new(0,0,255))"
Itself works and creates a team like i made it too
"script.Parent.Touched:connect(function(hit)" that line refers to the part getting touched and what line it uses under after getting touched. That of course is
"Leaderboard.SetPlayerTeam('Barcelona')"
so idk whats wrong with it rlly please correct my code if your able too and see that it's incorrect
It ain't roblox lua lol. I used the Brickplanet documentation that's where i got 'CreateTeam' from. Also im pretty sure you put the name of the team in that your wanting to create/set up and so not hex code because
"Leaderboard.CreateTeam('Barcelona', PartColor.new(0,0,255))"
Itself works and creates a team like i made it too
"script.Parent.Touched:connect(function(hit)" that line refers to the part getting touched and what line it uses under after getting touched. That of course is
"Leaderboard.SetPlayerTeam('Barcelona')"
so idk whats wrong with it rlly please correct my code if your able too and see that it's incorrect
you need to pass a player instance to setplayerteam
hala madrid