Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why can't I replicate a tool into StarterGear?

Asked by 6 years ago
Edited 6 years ago

I'm working on a saving system for my RPG. I've got the script below that is fired by an event.

game.Lighting.ServerEvents.SpawnWeaponShop.T1S1.OnServerEvent:connect(function(Player)
game.Players[Player.Name].leaderstats.Gold.Value - 150
local Weapon = game.ReplicatedStorage.ITEMS.BrigandSword:Clone()
Weapon.Parent = Player.StarterGear
end)

It works in studio, but not in-game. What could I do to make it work in-game?

1 answer

Log in to vote
0
Answered by 6 years ago

Hi, there.

Your script is using filtering enabled as seen by you remote event. I do suggest that you clone your weapon in the server script which activates this Server Event since I don't think you can clone in a local script. Also, it seems you have put your weapon into starter gear. I not very sure, but if you are trying to put the weapon into backpack, you should place inside Player.backpack.

0
Yes, that is the ServerSided script running that and I'm trying to get the tool into StarterGear. Is that not possible? Neodyne 0 — 6y
0
Startgear only works when the player joins the game. You should change Weapon.Parent to player’s backpack. AbandonedRick 112 — 6y
Ad

Answer this question