|
| 28 Mar 2017 12:18 AM |
| I'm trying to make a GUI TextButton that respawns the Player, but I can't get it past FE, any idea how I can do this? |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2017 12:23 AM |
--Local script local Remote = game.ReplicatedStorage.RemoteEvent --Get remote event
script.Parent.Button1Click:connect(function() --is it button1click? fire when click Remote:FireServer("Respawn") --Fires remote to server event sending request as "respawn" end)
--Server script local Remote = game.ReplicatedStorage.RemoteEvent --get remote event
Remote.OnServerEvent:connect(function(Player, Request) --waits for remote to fire if (Request == "Respawn") then --if they request to "Respawn" then Player:LoadCharacter() --LoadCharacter end end)
|
|
|
| Report Abuse |
|
|
|
| 28 Mar 2017 12:24 AM |
| Oh wow, I was close, thanks! (still new to fe) |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 28 Mar 2017 12:27 AM |
Well FE doesn't really affect anything here.
You can't use LoadCharacter from local scripts at all. |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2017 12:36 AM |
| ##### I have a question (I don't want to make a new thread), how would I use a LocalScript in FE to change IntValues? I currently have a LocalScript that changes Values in the Player's Humanoid, but for some reason it doesn't get past FE, I'm using RemoteEvents (Server To Client). |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 28 Mar 2017 12:51 AM |
--local script local Remote = game.ReplicatedStorage.RemoteEvent local IntValue = script.IntValue
Remote:FireServer(IntValue, IntValue.Value + 1)
--Server script local Remote = game.ReplicatedStorage.RemoteEvent
Remote.OnServerEvent:connect(function(Player, IntValue, Number) IntValue.Value = Number end)
--pretty sure thats how you do it
|
|
|
| Report Abuse |
|
|
|
| 28 Mar 2017 01:01 AM |
@Phantom
Oh wow, you didn't really have to write out the script, could of just told me lol. Thanks though! |
|
|
| Report Abuse |
|
|