Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:05 PM |
So let's say that there is a GUI. That GUI when clicked does something to a part inside of the workspace. When FE is enabled, it doesn't work when two+ players are in the server. Can I use RE/RF to fix this? Because I can't fire anything when the button is clicked, can I? Since RE use something in the server to happen. Sorry if that doesn't make sense. As in they originate in the server, not the client.
Thanks! |
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 10 Jan 2016 01:14 PM |
it does work, it just won't replicate the change to other clients nor server
you'd need to do this on each client separately so latency wouldn't be a problem use a RE |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:18 PM |
| can i fire a remotevent from a localscript or naw? |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 01:19 PM |
@Dralian, Using :FireServer(), yes.
#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217") |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:20 PM |
| Oh, never knew that was a thing, thanks. |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:22 PM |
| So instead of using "OnClientEvent", what would I use? |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 01:24 PM |
OnServerEvent.
go to ObjectBrowser and view the properties/events of instances there.
#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217") |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:27 PM |
Thanks, I'm so clueless w/ RE, sorry.
I'll let you know if it works. |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:30 PM |
What I'm doing seems to not be working.
In the LocalScript inside a GUI, I have this:
local player = game.Players.LocalPlayer local event = Instance.new("RemoteEvent") event.Parent = game.ReplicatedStorage script.Parent.MouseButton1Click:connect(function(player) event:FireServer(player) --[[local x = workspace:FindFirstChild("Home"..script.Parent.Parent.Parent.Parent.Name) if not (x) then return else if script.Parent.Text == "Open Garage" then script.Parent.Text = "Close Garage" x.Home.GarageDoor.Transparency = 1 x.Home.GarageDoor.CanCollide = false else if script.Parent.Text == "Close Garage" then script.Parent.Text = "Open Garage" x.Home.GarageDoor.Transparency = 0 x.Home.GarageDoor.CanCollide = true end end end--]] end)
Inside the script which is inside a part that's inside a few models, I have this:
local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") event.OnServerEvent:connect(function() print("hi") end) |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
| |
|
|
| 10 Jan 2016 01:37 PM |
Try this:
local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") event.OnServerEvent:connect(function(...) local tuple = {...} print(tuple[1]) end)
should print with the players name.
#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217") |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:40 PM |
| Aight, I'll see, I'll put that in the part/script. |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
| |
|
|
| 10 Jan 2016 01:42 PM |
Since the script goes from top to bottom, the player in here: "script.Parent.MouseButton1Click:connect(function(player)" is a nil value. Remove the 'player' in the brackets.
#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217") |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:44 PM |
Still nothing.
No biggy if we can't figure it out.
If you have skype, I can screen share what I mean. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 01:46 PM |
By the way, if your going to Instance.new a remote event in a local script, your going to be having a the same amount of remote events as players.
Just insert one into replicatedstorage via studio then define it as a variable: local event = game.ReplicatedStorage:WaitForChild("Event") for both scripts.
#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217") |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
| |
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 10 Jan 2016 01:51 PM |
| I can't get this to work, and probably the most simplistic mistake ever <_< |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 01:52 PM |
Try putting your server side script in serverscriptservice.
#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217") |
|
|
| Report Abuse |
|
|