generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

"LoadCharacter can only run through backend of server"

Previous Thread :: Next Thread 
Qivr is not online. Qivr
Joined: 22 Aug 2014
Total Posts: 5407
13 Mar 2015 11:17 PM
what

local allies = {1176283, 72321, 28356, 7013, 123123, 2530177}
script.Parent.SF.MouseButton1Click:connect(function()
local player = game.Players.LocalPlayer
local ingroup = false
for i,v in pairs(allies) do
if player:IsInGroup(v) then
ingroup = true
else
--ok
end
end
if ingroup and player.TeamColor~=BrickColor.new("Bright red") then
player.TeamColor = BrickColor.new("Bright red")
game.Players.LocalPlayer:LoadCharacter()
elseif not ingroup then
script.Parent.SF.NotSF.Visible = true
wait(2)
script.Parent.SF.NotSF.Visible = true
end
end)

script.Parent.Raiders.MouseButton1Click:connect(function()
local player = game.Players.LocalPlayer
local ingroup = true
for i,v in pairs(allies) do
if player:IsInGroup(v) then
ingroup = false
else
--ok
end
end
if ingroup and player.TeamColor~=BrickColor.new("White") then
player.TeamColor = BrickColor.new("White")
game.Players.LocalPlayer:LoadCharacter()
elseif not ingroup then
script.Parent.Raiders.NoSF.Visible = true
wait(2)
script.Parent.Raiders.NoSF.Visible = false
end
end)
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
13 Mar 2015 11:18 PM
LoadCharacter() can't be used in localscripts, try using it in a regular script
Report Abuse
ChoongJae is not online. ChoongJae
Joined: 10 Oct 2009
Total Posts: 670
13 Mar 2015 11:18 PM
http://wiki.roblox.com/index.php?title=API:Class/Player/LoadCharacter
"This item should be used in a Script to work as expected online."
Report Abuse
Lamar is not online. Lamar
Joined: 18 Nov 2006
Total Posts: 523
13 Mar 2015 11:19 PM
"This item should be used in a Script to work as expected online." -ROBLOX Wiki, LoadCharacter page

http://wiki.roblox.com/index.php?title=API:Class/Player/LoadCharacter
Report Abuse
Lamar is not online. Lamar
Joined: 18 Nov 2006
Total Posts: 523
13 Mar 2015 11:19 PM
omg ninja'd every time and i posted on the wrong account grrrr
Report Abuse
Qivr is not online. Qivr
Joined: 22 Aug 2014
Total Posts: 5407
13 Mar 2015 11:19 PM
o i knew that...
jk
i always used regular scripts before someone told me "local scripts are meant for GUIs"
so i never knew mb :///
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
13 Mar 2015 11:28 PM
That's because they are.

You run a LoadCharacter call through a RemoteEvent.
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
13 Mar 2015 11:32 PM
In addition you should be declaring LocalPlayer at the top of your script one time.

GroupService should now be used rather than tables of allied groups.

There's no reason for "ingroup", simply put the code inside the loop if the player is in the group and add a break statement.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image