|
| 07 Jul 2017 04:36 PM |
I've been using it the way it's described on the wiki, but that doesn't seem to be working. For instance, I have several scripts trying to communicate with each other in a FilteringEnabled game, using ReplicatedStorage as a medium for transferring models. In this case, the player calls a car from RepStor to the workspace to customize it. When they click a GUI, the Local Script copies that to RepStor to be used again elsewhere. But when a Local Script calls a Server Script to pull that to Workspace with a remote event, it doesn't work. It pulls the old, non customized version to the Workspace.
WHY |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
|
| 07 Jul 2017 04:50 PM |
in the local script fire a remoteevent in replicated storage
in server script listen for the fire, once received
clone the car from server storage into workspace
-- is this what you tried doing? |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2017 04:52 PM |
Yes it is.
Local Script: function click() if char.Humanoid.Sit == true then end if char.Humanoid.Sit == false then Close.Visible, Maps.Visible, CarsGui.Visible, BasicMapCars.Visible, MapsGui.Visible = false event:FireServer() wait(0.5) teleport() EndRun.Visible = true end end script.Parent.MouseButton1Click:Connect(click)
Server Script: local RepServ = game:GetService("ReplicatedStorage") --Create the car, named after the player. function spawncar(plr) wait (0.5) local carpack = RepServ:WaitForChild(plr.Name.. "s_CarPack") local car = carpack:WaitForChild("Nissan") car.Remover.Disabled = false local FindAlreadySpawnedCar = game.Workspace:FindFirstChild(plr.Name.. "s_Car") local CarCopy = car:Clone() CarCopy.Name = (plr.Name.. "s_Car") --Check if there's already a car named after the player. Remove the old one if there is. if FindAlreadySpawnedCar then FindAlreadySpawnedCar:Destroy() end
--Randomly spawn the car in the spawn zones CarCopy.Parent = game.Workspace CarCopy:MoveTo(Vector3.new(math.random(-235, -70), 2, math.random(1650, 1885))) CarCopy:makeJoints() end game.ReplicatedStorage.CarSpawnerEvents.NissanSpawn.OnServerEvent:Connect(spawncar) |
|
|
| Report Abuse |
|
|
| |
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
|
| 07 Jul 2017 05:21 PM |
| Is ReplicatedStorage something I could use to track scores? |
|
|
| Report Abuse |
|
|
| |
|