So I want something like when u buy a tool from shop, I want to fix the bug so you can’t buy multiple one’s only one and after you bought it a textlabel will set the property to visible = true and if you try to buy again an error sound will play
This is what i got: if player.Backpack:FindFirstChild(toolname) or player.Character:FindFirstChild(toolname) then return end; print("bought")
Btw the system is like once the remote events get fired on client it will give you the tool and play a bought sound
Okay, there small script you can try, just replace part which you need
Its part of localscript in button
local event = game.ReplicatedStorage.RemoteEvent
script.Parent.MouseButton1Down:Connect(function()
local plr = game.Players.LocalPlayer
if plr.Backpack:FindFirstChild("tool") then
print("tool bought")
else
event:FireServer()
end
end)
Forgot to say, when you equipping the tool its moving to your character, so you can have 2 tools
You can make it so when you try to buy an item and it hasnt been bought yet, it gives you the item, and the text of the textbutton that you clicked on to buy the item will change to something like: You bought this item already, and you can use an if statement to determine wether the player already bought the item or not. Here’s an example code:
```script.Parent.Activated:Connect(function()
if toolbought.Value == false then -- boolvalue inside replicatedstorage
--give player tool
else
errorsound:Play-- errorsound inside soundservice
script.Parent.Text = "Already bought this!"
end)
--Script.Parent is the button that you buy the item with
No Problem, glad it worked!
You can also try changing the BackgroundColor to something like grey(55,55,55) so players see immedantly if they bought the item or not, also, a better way to tell players that they bought the item instead of changing the text would be adding a notification system, you could also use it for like in-game events. If you don’t quite know how to create something like that you can ask me😀
Also this is just a suggestion so yeah Good luck with your game😀