@ToxicalGamer2006 what if I have MULTIPLE tools that can vary from player to player?
you can use the same RemoteEvent if you want in my game my inventory system I got the same RemoteEvent.
I don’t think that would work. This is because each player has DIFFERENT weapons and also have multiple ones.
let me explain you use one local script for FireServer the remoteEvent with the tool you want inside the SSS that will clone the tool (finding the tool name) into the local player starterGear
Imagine I have one button and it makes.
game.ReplicatedStorage.RemoteEvent:FireServer(“ClassicSword”)
and other makes
game.ReplicatedStorage.RemoteEvent:FireServer(“Pistol”)
I will get this 2 tools on my StarterGear bc the script inside the SSS did:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr,toolname)
local clone = game.ReplicatedStorage:FindFirstChild(toolname):Clone() – ok he selected the ClassicSword the (toolname) I will clone is ClassicSword (same thing for the pistol)
clone.Parent = plr.StarterGear
end)
It won’t work @ToxicalGamer2006 game.ReplicatedStorage.ShopEvent.OnServerEvent:Connect(function(plr,toolname)
local clone = game.ReplicatedStorage:FindFirstChild(toolname):Clone()
clone.Parent = plr.StarterGear
end)
Here is the code inside a server script.
This is the local script:
game.ReplicatedStorage.RemoteEvent:FireServer(“Bow”)
Also got a remote event named ShopEvent in RS. No errors. Isn’t working.
you dont get erros did you check StarterGear? (Not StarterPack)
OH I am soo sorry I forget to change the RemoteEvent name sorry It was shopevent and not RemoteEvent.
I noticed but that shouldn’t effect anything I changed the remote event name to ShopEvent and it still didn’t work. Nothing in starter pack nor gear either.
what is the real RemoteEvent name? you got inside the RS?
ok so in RS will be:
game.ReplicatedStorage.ShopEvent("toolname") -- put the tool name here
and in SSS will be
game.ReplicatedStorage.ShopEvent.OnServerEvent:Connect(function(plr,toolname)
local clone = game.ReplicatedStorage:FindFirstChild(toolname):Clone()
clone.Parent = plr.StarterGear
end)
bro you dont have tools inside the replicatedStorage…
local clone = game.ReplicatedStorage:FindFirstChild(toolname):Clone() – this will find the tool for clone.
Where would I put that last script?
can you try to put the bow inside the RS?
and also it gives me an error when I remove it from SS bc you input a code that looks for tools in game.ServerStorage.Tools etc…
and no I can’t remove the bow from SS bc it gives me errors and infinte yeild warinings.
this works but you are doing something wrong.
please put one script inside the SSS like I said before(not server storage)
game.ReplicatedStorage.ShopEvent.OnServerEvent:Connect(function(plr,toolname)
local clone = game.ReplicatedStorage:FindFirstChild(toolname):Clone()
clone.Parent = plr.StarterGear
end)
and inside the RS one local script will be:
game.ReplicatedStorage.ShopEvent("toolname")-- put the bow name here
and the tool you want to clone will be inside the RS