|
| 10 Nov 2017 10:29 PM |
For awhile now me and my friend have been in Studio trying to figure out how to have a script only affect ONE player via a Localscript and couldn't get anything to work. Here's the script that got us the farthest. ------------------------------------ function onTouch(part) local Test = game.Lighting.Bridge local c = Test:Clone() c.Anchored = true c.CanCollide = true c.Parent = workspace end script.Parent.Touched:connect(onTouch)
-----------------------------------
What is supposed to happen is, when a Player touches a specific Part, something shows up through their screen only, it's supposed to be something that the whole server can't see, only the Player that pressed the button. Anyone got any help on this situation? I'd love to solve this issue before midnight.
Also I hear that LocalScripts don't work through Workspace, if that's actually true then I am at a complete loss on how I will go about doing this.
|
|
|
| Report Abuse |
|
|
Vulkarin
|
  |
| Joined: 17 Mar 2013 |
| Total Posts: 282 |
|
| |
|
|
| 10 Nov 2017 10:46 PM |
So it looks like you're trying to make a button that will "build" a bridge for the player that pressed it, and only that player. Interesting concept! Here's how I would go about this (although if someone has a better idea, feel free to step in):
- Create a RemoteEvent and name it whatever you want. This will be used when the button is pressed. - Use a regular Script in the button being pressed - Make it so that when the button is pressed, it will use FireClient() on the RemoteEvent using the Player's name, so they are the only client affected by this - Have a LocalScript stored somewhere on the Player's client (PlayerScripts, PlayerGui, wherever.) that will listen for this RemoteEvent to be fired - When the RemoteEvent is fired, have the Bridge cloned into the CurrentCamera. This way, only the player who pushed the button will be able to see and interact with the Bridge.
I hope I was able to help. Someone else may have a better way but this is what I could say off the top of my head.
Here are some references:
http://wiki.roblox.com/index.php?title=API:Class/Workspace/CurrentCamera wiki.roblox.com/index.php?title=API:Class/RemoteEvent http://wiki.roblox.com/index.php?title=API:Class/LocalScript |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2017 11:04 PM |
@Vulkarin Filtering Enabled is active, thanks for the reminder though!
@Technomantic Thanks a TON! Now that I have a sense of direction it should be a lot easier, I'll ask if I have any other questions but until then I'll be experimenting with what you've told me in Studio!
Again, thanks!! |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2017 11:05 PM |
| No problem man! Good luck :^) |
|
|
| Report Abuse |
|
|