|
| 23 Dec 2016 12:43 PM |
Hi everyone,
How should I go about making a player have a instance of Lighting for when they're in a cave, but a different instance of Lighting when they're outside? |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 01:00 PM |
Turn on FE.
Make a function that runs everytime they move. If they are in a certain Vector3 region, make the client (using a local script) have a different lighting. Then add an else statement which changes the lighting back to normal.
http://wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:13 PM |
Ok, I didn't want to have to, but I think it's for the better. I'll use FilteringEnabled, but I need to understand if using Localscripts with it on will act differently. Is there anything specific I need to be aware of when FE is on? |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 23 Dec 2016 02:15 PM |
FE prevents data from the clients to replicate to the server.
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=198426552
|
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:17 PM |
In addition to OAuth2, if you want the clients to replicate to the server, you must use remote events or remote functions.
http://wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:25 PM |
"if you want the clients to replicate to the server,"
Could you emphasize what this means? |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 23 Dec 2016 02:29 PM |
Basically, any changes you do on a server/other clients, other clients cannot see this change. It's like having your own world. This is to prevent hackers from deleting stuff, changing data, etc.
This is also useful for local objects. Replicating a house from a client to the server, only you can see the house.
Consider checking the link I responded with earlier.
~ lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao ~ |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:31 PM |
Let's say if FE was off and there was a local script in the player's backpack that created a part in workspace everytime the client clicked on their mouse, it would work.
BUTTTTT, if FE was on, the code wouldn't run because the client can't change the server in anyway. It would have to use a remote event or remote function.
What I don't think you understand is what 'replicate' means. If there server was to replicate to the client, it would change something only to that client, nothing else. If the client was to replicate to the server, the client would change something in the server which affects everyone as they are replicated from the server.
Bad people replicate to the server to do the bad things.
Lol me and Auth are posting at the same time.
http://wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:33 PM |
Ok, so if I were to change something in the server by a regular script, that change would affect ALL clients, but if I used a local script to change something in the server, it would only affect that client, not the server or any other clients.
If that is the case, I need to use remove events and functions so that a client can manipulate the server?
If so, how would I do that for simply inserting a brick above the client's character's head via local script? |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 23 Dec 2016 02:34 PM |
You're pretty much on point.
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial
Here's a tutorial on how to do it.
~ lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao ~ |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:38 PM |
| Alrighty, sounds like I know what I must do, gg ty both for your help. |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:44 PM |
#code -- Inside Server Script local event = game:GetService("ReplicatedStorage"):WaitForChild("Remote Event") -- Get's the event object event.OnServerEvent:connect(function() -- define the function that will be called when the event is fired local part = Instace.new("Part", workspace") --[[Weld the part to the clients head. But it's too long to type here. Make sure to use a module script! ]] end) #code --[[ Inside Local Script Let's make a part spawn on the player's head when they click anywhere ]] local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.Button1Up:Connect(function() game:GetService("ReplicatedStorage"):WaitForChild("Remote Event"):FireServer() end)
http://wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:44 PM |
I'm proud about that!
http://wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 02:46 PM |
Inside the server script, Line 5, Add a space after '--[[' to make '--[[ '
This will fix the code so that 'end)' isn't a comment at line 7.
http://wiki.roblox.com |
|
|
| Report Abuse |
|
|
Sutic
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 338 |
|
|
| 23 Dec 2016 03:05 PM |
Put it in the Camera. Done.
-Sutic |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 05:53 PM |
| Thank you, it looks great. |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 06:05 PM |
One question, I don't know where to put the remote event.
Here's what I did,
I put the local script code into a local script in StarterPlayerScripts
I put the server script code into a regular script in ServerStorage
I put an instance of 'RemoteEvent' into ReplicatedStorage
Here's what I'm getting as output:
19:02:48.598 - Infinite yield possible on 'ReplicatedStorage:WaitForChild("Remote Event")'
What's up? What goes where? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Dec 2016 06:08 PM |
--local script
game.Lighting.FogEnd = 100
Boom done.
|
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 23 Dec 2016 06:09 PM |
WaitForChild("RemoteEvent"), not "Remote Event".
~ lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao ~ |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 06:20 PM |
| Fixed that, doesn't do anything, I changed it so the server would print out 'clicked' and it won't display anything in the output |
|
|
| Report Abuse |
|
|