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 |
|
|
|
| 13 Mar 2015 11:18 PM |
| LoadCharacter() can't be used in localscripts, try using it in a regular script |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 13 Mar 2015 11:28 PM |
That's because they are.
You run a LoadCharacter call through a RemoteEvent. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|