Hello, I've made a local script so when a player presses a button the tool is cloned into the players' backpack and starter gear through replicated storage. However, after trying to buy the item it doesn't seem to work, what is the problem as there are no errors coming up on the developer console.
local player = game.Players.LocalPlayer
local Repstorage = game:GetService("ReplicatedStorage")
local leaderstats = player:WaitForChild("leaderstats")
local price = script.Parent:WaitForChild("Price")
local ForgetMeNotTool = game.ReplicatedStorage:WaitForChild("Flashlight")
script.Parent.MouseButton1Click:Connect(function()
leaderstats.Money.Value = leaderstats.Money.Value - 3000
ForgetMeNotTool:Clone().Parent = player.Startergear
ForgetMeNotTool:Clone().Parent = player.Backpack
end)

2 comments
My goal was to not use remote events since it uses up memory, is there another way to do this without using remote events?
No