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
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Localscript/script affecting one Player help

Previous Thread :: Next Thread 
Epicface_0 is not online. Epicface_0
Joined: 23 Jul 2012
Total Posts: 516
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 is online. Vulkarin
Joined: 17 Mar 2013
Total Posts: 282
10 Nov 2017 10:32 PM
Filter has to be enabled


Report Abuse
Technomantic is not online. Technomantic
Joined: 14 Oct 2017
Total Posts: 161
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
Epicface_0 is not online. Epicface_0
Joined: 23 Jul 2012
Total Posts: 516
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
Technomantic is not online. Technomantic
Joined: 14 Oct 2017
Total Posts: 161
10 Nov 2017 11:05 PM
No problem man! Good luck :^)
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