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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Question about RE/RF

Previous Thread :: Next Thread 
Dralian is not online. 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 is not online. 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 is not online. 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
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
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 is not online. 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 is not online. 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
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
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 is not online. 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 is not online. 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 is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
10 Jan 2016 01:34 PM
bump 4 help.
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
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 is not online. 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 is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
10 Jan 2016 01:41 PM
nope, doesn't work.
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
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 is not online. 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
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
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 is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
10 Jan 2016 01:48 PM
done.
Report Abuse
Dralian is not online. 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
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
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
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