Tool not appearing after buying it

Strange problem. When I use an item shop I made in the game, it takes an item from replicatedstorage and clones it to the player’s backpack, but when i equip the tool it doesn’t show in the player’s hand. Please tell me if this is the wrong category.

This is the wrong category. Move this to #help-and-feedback:scripting-support.

Can we have a bit of code? At least the bit that registers the purchase and clones.

Are you sure that this is done on the server?

Does the tool have a Part called Handle?

Also, Does the tool have RequiredHandle enabled in its properties?

Can you post a chunk of code so we can see wheres the error?

local player = game:GetService("Players").LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	if player.leaderstats.Money.Value > 500 then
		player.leaderstats.Money.Value = player.leaderstats.Money.Value - 500
		game.ReplicatedStorage.Notepad:Clone().Parent = player.Backpack
        print("Purchased")
		script.Parent.Parent.BUYSOUND:Play()
	else
		script.Parent.Text = "Not enough money!"
		wait(0.6)
		script.Parent.Text = "Notepad"
	end
end)

i am moving the category so sorry!

edit: it changed by itself…?

yes they all have handle and requiredhandle on!

The problem here is that you are doing all of this in a local script. Use a remote event to check when the player wants to buy something and process the rest on the server.

1 Like

so what would i do then? sorry im not very advanced

the tools work its just that they arent going to the players hand

Use Remote Events. 30 chars

1 Like

Make a RemoteEvent in replicated storage and fire it from the local script, make a server script in server script service that listens to the remote event and does everything. to fire a remote event do RemoteEvent:FireServer() in the local script, then in a server script listen to it via RemoteEvent.OnServerEvent:Connect(function(plr)

1 Like

Essentially you are cloning the tool locally so it only exists for the client. In order for it to work properly you have to make the server handle stuff that must be visible for everyone.

the RemoteEvent… could i change it to the remote event’s name? because i need 3 different items to give…

If you need 3 different items then you could send out the data as an argument. If a player has clicked on the first item then it would send out an argument named 1, for example.

how do i send out arguements? :thinking:

Ok so, the player has clicked the first button, store that somewhere in a value and after that you can just do RemoteEvent:FireServer(choice)

On the server you would have to listen to the argument like that: RemoteEvent.OnServerEvent:Connect(function(plr,choice)

1 Like

Anyway it is getting late for me so I will leave you to it. One last thing I can suggest you is to examine developer.roblox.com a little regarding RemoteEvents and overall the Server-Client structure.

2 Likes

Do you have the Backpack game object enabled. I had mines disabled and was freaking out. :smile:

Had it disabled in something like this:

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
1 Like