HayHay
11
I did. Ill show you both of the scripts.
Scripts:
ServerScript:
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game.ReplicatedStorage.Requests
local HttpService = game:GetService("HttpService")
local ReqRank = ReplicatedStorage.ReqRank
local url = "https://bahamas-airline-rank-api.herokuapp.com/group/rank/"
local APIKEY = "gfqywhuyt613fhyuj8w67yrrrrrrrrrrrh3uwygfr6t7hyu6t78yu8976tu8ygh796878968ty7u87y6u"
local groupId = 8873606
local GameID = 6299647938
ReqRank.OnServerEvent:Connect(function(plr, Shirt_Id, role_number)
if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr.UserId, Shirt_Id) then
print("User owns gamepass! Now ranking!")
local url_with_data = url.."?user_name="..plr.Name.."&key=".. APIKEY.."&groupid=" ..groupId.."&role_number="..role_number
local response = HttpService:GetAsync(url_with_data)
local data = HttpService:JSONDecode(response)
if data == "The user had their ranked changed" then
plr:Kick("You were ranked in the group!")
else
ReplicatedStorage.InfoOnRank:FireClient("Something went wrong on our end! Try again later, if the issue still persists contact the game owner.")
plr:Kick("Something went wrong on our end! Try again later, if the issue still persists contact the game owner.")
print("An error occured.")
end
else
ReplicatedStorage.InfoOnRank:FireClient("You do not own the gamepass!")
end
end)
ScriptManager:
local plr = game.Players.LocalPlayer
local button = script.Parent
local count = 0
local threshHold = 2
local clickTime = 0.5
local Shirt_Id = 6260470020
local rank_id = 12
local rank_name = "Business Class - 500 RBX"
script.Parent.Parent.RankName.Text = rank_name
local MarketPlaceService = game:GetService("MarketplaceService")
function Click()
count += 1
if count % threshHold == 0 then
game.ReplicatedStorage.Requests.ReqRank:FireServer(Shirt_Id, rank_id)
if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr, Shirt_Id) then
script.Parent.Parent.RankName.Text = "Ranking..."
end
else
if count % threshHold == 1 then
MarketPlaceService:PromptPurchase(game.Players.LocalPlayer, Shirt_Id)
end
end
wait(clickTime)
count -= 1
end
button.MouseButton1Click:Connect(Click)
button.TouchTap:Connect(Click)