It isn't giving me the item when I buy it on the roblox server, but in roblox studio, it is giving me the item. Here's the script:
local p = game.Players.LocalPlayer
local replicatedstorage = game:GetService("ReplicatedStorage")
script.Parent.MouseButton1Click:connect(function()
if p.Backpack:FindFirstChild("GravityCoil") or p.StarterGear:FindFirstChild("GravityCoil") or game.Workspace[p.Name]:FindFirstChild("Backpack") then
script.Parent.Parent.YoruPrice.Text = "You already brought this item!"
wait(5)
script.Parent.Parent.YoruPrice.Text = " Gravity Coil - 1,000"
else
if p.leaderstats.Cash.Value >= 1000 then
replicatedstorage.Yoru:Clone().Parent = p.Backpack
replicatedstorage.Yoru:Clone().Parent = p.StarterGear
p.leaderstats.Cash.Value = p.leaderstats.Cash.Value - 1000
else
local cashrequirement = 1000 - p.leaderstats.Cash.Value
script.Parent.Parent.YoruPrice.Text = "You need " ..cashrequirement.. " more money to buy this item!"
wait(5)
script.Parent.Parent.YoruPrice.Text = " Yoru - 1,000"
end
end
end)

9 comments
I want it to disable so that the script would be easy, but how?
I don't have filter enabled afterall.
let me fix ur script :D itll be done in around 10 minutes mkay
That's the whole script, the error is from line 4 when I'm opening the game on roblox player.
recheck my comment for a fixed version of ur script :D
This time, it isn't working even in roblox studio
Did you look at my picture.
Has to be screengui > textbutton > script and in replicatedstorage the tool name GravityCoil. Works perfectly for me
did it work?