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: Why doesn't this work?

Previous Thread :: Next Thread 
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
06 Jan 2015 06:26 PM
Client:
game.ServerScriptService.RemoteEvents.GunEquip:FireServer(menu.LoadoutPage.Primary.Value)

Server:
local event = Instance.new("RemoteEvent")
event.Parent = script
event.Name = "GunEquip"
event.OnServerEvent:connect(function(gun)
print(gun)
end)

The Awoken | Spectrum FPS
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
06 Jan 2015 06:27 PM
Im pretty sure local scripts cant access ServerScriptService
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
06 Jan 2015 06:27 PM
God dang it. Workspace it is, then.

The Awoken | Spectrum FPS
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
06 Jan 2015 06:28 PM
Or ReplicatedStorage to store basically anything you want?
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
06 Jan 2015 06:28 PM
in studio it just prints,
Player
Player

The Awoken | Spectrum FPS
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
06 Jan 2015 06:31 PM
The script doesn't run when in ReplicatedStorage.

The Awoken | Spectrum FPS
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
06 Jan 2015 06:33 PM
I mean store that gun youre trying to clone into ReplicatedStorage
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
06 Jan 2015 06:33 PM
thus GunEquip is never created. :/

The Awoken | Spectrum FPS
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
06 Jan 2015 06:33 PM
.

The Awoken | Spectrum FPS
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
06 Jan 2015 06:42 PM
19:40:41.518 - ServerScriptService.RemoteEvents:5: bad argument #2 to '?' (string expected, got userdata)
19:40:41.523 - Script 'ServerScriptService.RemoteEvents', Line 5
19:40:41.523 - Stack End
19:40:41.524 - Disconnected event because of exception

game.ServerScriptService.RemoteEvents.GunEquip:FireServer("Secondaries",menu.LoadoutPage.Secondary.Value)

Secondary is a string value.

The Awoken | Spectrum FPS
Report Abuse
BowtieMod is not online. BowtieMod
Joined: 01 Apr 2013
Total Posts: 804
06 Jan 2015 06:44 PM
Hm. Could jsut be fussy Roblox.

Try assigning the value to a variable, and then pass the variable.

local var = whatev.Value

FireServer(var)
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
06 Jan 2015 06:49 PM
I also tried tostring(menu.LoadoutPage.Secondary.Value) but it didn't work either.

local secondary = menu.LoadoutPage.Secondary.Value
local primary = menu.LoadoutPage.Primary.Value
game.ServerScriptService.RemoteEvents.GunEquip:FireServer("Primaries",primary)
game.ServerScriptService.RemoteEvents.GunEquip:FireServer("Secondaries",secondary)

local event = Instance.new("RemoteEvent")
event.Parent = script
event.Name = "GunEquip"
event.OnServerEvent:connect(function(type, gun)
local newgun = game.ReplicatedStorage.Guns[type][gun]:clone()
end)

The Awoken | Spectrum FPS
Report Abuse
BowtieMod is not online. BowtieMod
Joined: 01 Apr 2013
Total Posts: 804
06 Jan 2015 06:51 PM
function(player, type, gun)

It receives a 'player' argument too
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