Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local nameLabel = script.Parent:WaitForChild("NamePart"):WaitForChild("NameGui"):WaitForChild("NameLabel")
- nameLabel.Text = "Unclaimed!"
- local itemsScroller = script.Parent:WaitForChild("ItemsPart"):WaitForChild("ItemsGui"):WaitForChild("ItemsScroller")
- local proximityPrompt = Instance.new("ProximityPrompt", script.Parent.NamePart)
- proximityPrompt.HoldDuration = 1
- proximityPrompt.ActionText = "Hold E to Claim!"
- proximityPrompt.UIOffset = Vector2.new(0, 2)
- proximityPrompt.RequiresLineOfSight = false
- proximityPrompt.Name = "StandProximityPrompt"
- local http = game:GetService("HttpService")
- local url = "https://catalog.roproxy.com/v1/search/items/details?Category=3&CreatorName="
- proximityPrompt.Triggered:Connect(function(plr)
- local data = http:JSONDecode(http:GetAsync(url .. plr.Name)).data
- if data then
- game.ReplicatedStorage.RemoteEvent:FireClient(plr)
- nameLabel.Text = plr.Name .. "'s Stand"
- proximityPrompt.Enabled = false
- table.sort(data,
- function(a,b)
- return a.price < b.price
- end
- )
- for i, item in pairs(data) do
- local newButton = script.DonateButton:Clone()
- newButton.Text = item.price .. "R$"
- local id = Instance.new("IntValue", newButton)
- id.Value = item.id
- newButton.Parent = itemsScroller
- itemsScroller.CanvasSize = UDim2.new(0, itemsScroller.UIListLayout.AbsoluteContentSize.X, 0, 0)
- end
- game.Players.PlayerRemoving:Connect(function(plrLeaving)
- if plr == plrLeaving then
- nameLabel.Text = "Unclaimed!"
- proximityPrompt.Enabled = true
- for i, child in pairs(itemsScroller:GetChildren()) do
- if child:IsA("TextButton") then child:Destroy() end
- end
- end
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement