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: Filtering Enabled

Previous Thread :: Next Thread 
SonGohan1234 is not online. SonGohan1234
Joined: 01 Feb 2012
Total Posts: 23
26 Nov 2017 11:00 AM
I'm starting to learn Filtering Enabled now, and lets say a character has a ShopGui, and normally when he clicks the choice, he will get the weapon which is stored in lets say the lighting. Pretty simple, but does any of that change now that I have FE on? Do I have to fire some kind of event to tell the server something somehow?
Report Abuse
Y0_dude is not online. Y0_dude
Joined: 03 Aug 2016
Total Posts: 113
26 Nov 2017 11:05 AM
You will have to give the player the weapon server sided rather then on a local script.


Report Abuse
SonGohan1234 is not online. SonGohan1234
Joined: 01 Feb 2012
Total Posts: 23
26 Nov 2017 11:08 AM
So just use a server script instead of a local script?
Report Abuse
Y0_dude is not online. Y0_dude
Joined: 03 Aug 2016
Total Posts: 113
26 Nov 2017 11:16 AM
You would still do everything as normal on the local script. However when making a change to the overall state of the play, in this case giving the player a tool, you signal a server script to give the player a tool rather then doing it all in a local script. In order to do this you can use remote events/functions.


Report Abuse
SonGohan1234 is not online. SonGohan1234
Joined: 01 Feb 2012
Total Posts: 23
26 Nov 2017 11:24 AM
Can I get an example?
Report Abuse
Y0_dude is not online. Y0_dude
Joined: 03 Aug 2016
Total Posts: 113
26 Nov 2017 11:31 AM
--Assuming that there is a remote event called "GiveWeapon" in workspace

--In local script
local event = workspace.GiveWeapon
event:FireServer()

--In server script
local event = workspace.GiveWeapon
event.OnServerEvent:connect(function(player)
local tool = SomeTool
tool.parent = player.Backpack
end)


Report Abuse
SonGohan1234 is not online. SonGohan1234
Joined: 01 Feb 2012
Total Posts: 23
26 Nov 2017 11:57 AM
So would the local script have to be in the gui, and the server script would be where? also the gui?
Report Abuse
Y0_dude is not online. Y0_dude
Joined: 03 Aug 2016
Total Posts: 113
26 Nov 2017 12:00 PM
Yes, the code in the local script should be implemented in your ShopGui and the server script should probably go into ServerScriptService.


Report Abuse
zC0LX is not online. zC0LX
Joined: 02 Apr 2017
Total Posts: 59
26 Nov 2017 12:06 PM
script:

local s_shp = Instance.new("RemoteEvent",game.ReplicatedStorage)
s_shp.Name = "give"

s_shp:OnServerEvent:connect(function(plr)
local a =game.Lighting.TOOLNAMEHERE:Clone()
a.Parent = game.Players:FindFirstChild(plr).Backpack
end

localscript:
game.ReplicatedStorage.give:FireServer(playername)


#code print('oh no an error!!')
Report Abuse
SonGohan1234 is not online. SonGohan1234
Joined: 01 Feb 2012
Total Posts: 23
26 Nov 2017 12:53 PM
How does the script in the serverstorage know how to get the player? Sorry, I'm just not used to this
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