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 |
|
|
|
| 06 Jan 2015 06:27 PM |
| Im pretty sure local scripts cant access ServerScriptService |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 06 Jan 2015 06:28 PM |
| Or ReplicatedStorage to store basically anything you want? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 06 Jan 2015 06:33 PM |
| I mean store that gun youre trying to clone into ReplicatedStorage |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 14 Sep 2014 |
| Total Posts: 8903 |
|
|
| 06 Jan 2015 06:33 PM |
.
The Awoken | Spectrum FPS |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|