|
| 04 Mar 2017 09:49 AM |
LoadCharacter can only be called by the backend server
I used a loadcharacter in a local script |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 09:50 AM |
| and what would be the alternative to respawn some1 |
|
|
| Report Abuse |
|
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 09:55 AM |
you can use a remoteevent to do it
|
|
|
| Report Abuse |
|
|
iiJameul
|
  |
| Joined: 11 Feb 2017 |
| Total Posts: 85 |
|
|
| 04 Mar 2017 09:56 AM |
You cannot use a server function in a local script. For what you are trying you must state the local player in a script and if you would like to to resplendent the player in a local script just kill the player.
68% of people cannot script that 1% is me.
|
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 09:57 AM |
| rip how i dont know how to use remoteevents |
|
|
| Report Abuse |
|
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 09:57 AM |
SCRIPT1 -- creating remote event
local event1 = Instance.new("RemoteEvent") event1.Name = "MyEventName" event1.Parent = game.ReplicatedStorage now this part is within your local script assuming you have a gui with a button LOCAL SCRIPT1 -- using that remote event script.Parent.MouseButton1Click:connect(function(hit) game.ReplicatedStorage.MyEventName:FireServer() end)
now this is back in the script SCRIPT1
event1.OnServerEvent:connect(function() do stuff end)
|
|
|
| Report Abuse |
|
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 10:01 AM |
what are you trying to make first of all :p
|
|
|
| Report Abuse |
|
|
| |
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 10:06 AM |
And you want to make the player respawn when they change teams?
|
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 10:06 AM |
I have a "MyEventName" remote event in replicated storage,
if player.TeamColor == BrickColor.new("Royal purple") then game.ReplicatedStorage.MyEventName:FireServer() end
and the script
local event1 = Instance.new("RemoteEvent") event1.Name = "MyEventName" event1.Parent = game.ReplicatedStorage
event1.OnServerEvent:connect(function() print("hi") end)
and its not printing hi rip |
|
|
| Report Abuse |
|
|
| |
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 10:10 AM |
if player.TeamColor == BrickColor.new("Royal purple") then game.ReplicatedStorage.MyEventName:FireServer() end
have you defined player?
|
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 10:10 AM |
yeah
local player = game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 10:13 AM |
did you put the local script into the backpack?
and what does this print out
player = game.Players.LocalPlayer print(player.TeamColor)
|
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 10:14 AM |
what i have (local script) local player = game.Players.LocalPlayer
if player.TeamColor == BrickColor.new("Royal purple") then game.ReplicatedStorage.MyEventName:FireServer() end
(regular script)
local event1 = Instance.new("RemoteEvent") event1.Name = "MyEventName" event1.Parent = game.ReplicatedStorage
event1.OnServerEvent:connect(function() print("hi") end)
Then a remote event called "MyRemoteEvent" in replicated storage |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 10:15 AM |
| the local script is inside of a frame in startergui |
|
|
| Report Abuse |
|
|
| |
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 10:21 AM |
The local script that calls the remotefunction has to be in the backpack
|
|
|
| Report Abuse |
|
|
| |
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
| |
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 10:30 AM |
/31584d248f0c041385d14483e5c5c4c8
like this
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 04 Mar 2017 10:43 AM |
in a local script in starterpack
local player = game.Players.LocalPlayer
if player.TeamColor == BrickColor.new("Royal purple") then game.ReplicatedStorage.MyEventName:FireServer() end
in a regular script in workspace
local event1 = Instance.new("RemoteEvent") event1.Name = "MyEventName" event1.Parent = game.ReplicatedStorage
event1.OnServerEvent:connect(function() print("hi") end)
does n0thinggg rip |
|
|
| Report Abuse |
|
|
Vercron
|
  |
| Joined: 18 Sep 2010 |
| Total Posts: 9418 |
|
|
| 04 Mar 2017 10:45 AM |
just sec ill set up an empty game with the setup in it so you can edit it and see what has to go where
|
|
|
| Report Abuse |
|
|