- BrickPlanet Forum
- Game & Scripting Discussion
- This script causes a huge error. . .
This script causes a huge error. . .
Posted Feb 28th 2023 at 9:00PM
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
[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
Posted Mar 2nd 2023 at 5:25AM
It makes sense.
Posted Mar 2nd 2023 at 9:15PM
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
"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
Posted Mar 2nd 2023 at 10:02PM

Originally posted by
Ronaldinho
on Mar 2nd 2023 at 9:15PM
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
"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
Posted Mar 6th 2023 at 11:46AM
hala madrid
Posted Mar 20th 2023 at 8:00PM
Leaderboard.CreateTeam('Barcelona', PartColor.new(0,0,255))
script.Parent.Touched:Connect(function(hit)
Leaderboard.SetPlayerTeam(hit, 'Barcelona')
end)
your function asks the leaderboard to put nothing in the team because you forgot to include the player in it which is hit
script.Parent.Touched:Connect(function(hit)
Leaderboard.SetPlayerTeam(hit, 'Barcelona')
end)
your function asks the leaderboard to put nothing in the team because you forgot to include the player in it which is hit
Search Forum
Thread Info
Replies
5
Views
52