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: How exactly does ReplicatedSotrage Work?

Previous Thread :: Next Thread 
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
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
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
07 Jul 2017 04:40 PM
b1
Report Abuse
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
07 Jul 2017 04:44 PM
b2
Report Abuse
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
07 Jul 2017 04:47 PM
b3
Report Abuse
Thedagz is not online. 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
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
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
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
07 Jul 2017 05:02 PM
b4
Report Abuse
complexo is not online. 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
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
07 Jul 2017 05:42 PM
b5
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