this is the script the script parent has a IntValue called "Cost" the value is 500 the LocalScript 2 is:
script.Parent.MouseButton1Click:Connect(function(player)
game.Players.LocalPlayer.PlayerGui.ropelength.Frame.Visible = false
game.Workspace.Teleport.RemoteFunction:InvokeServer()
game.Players.LocalPlayer.Character.Rope:Destroy()
end)
this is the original script. Name: LocalScript
local player = game.Players.LocalPlayer
local Cash = player.leaderstats.Money
local price = script.Parent.Cost.Value
script.Parent.MouseButton1Click:Connect(function(player)
if Cash.Value >= 500 then
local clone = script.Parent.Parent.yyyy.LocalScript2:Clone()
Cash.Value = price - 500
game.Players.LocalPlayer.PlayerGui.ropelength.Frame.Visible = false
game.Workspace.Teleport.RemoteFunction:InvokeServer()
script.Parent.BackgroundColor3 = Color3.new(1 ,1, 1)
clone.Parent = script.Parent
script.Parent.Parent.yyyy.LocalScript2:Destroy()
script:Destroy()
game.Players.LocalPlayer.Character.Rope:Destroy()
end
end)

1 comment
ty i will try