Im trying to create a webhook system to send a rating for my game to a discord server.
Everything works fine exept the rating part.
Script:
local url = "i removed the webhook for safety purposes"
local http = game:GetService("HttpService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local folder = Instance.new("Folder", script)
folder.Name = "ratings"
ReplicatedStorage.FlightRating.RE.Main.OnServerEvent:Connect(function(plr)
local function rating1()
if plr.PlayerGui.FlightRating.Main.Rating1.Star5_Service_Image_Full.Visible == true then
return "5"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star5_Service_Image_Half.Visible == true then
return "4.5"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star4_Service_Image_Full.Visible == true then
return "4"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star4_Service_Image_Half.Visible == true then
return "3.5"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star3_Service_Image_Full.Visible == true then
return "3"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star3_Service_Image_Half.Visible == true then
return "2.5"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star2_Service_Image_Full.Visible == true then
return "2"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star2_Service_Image_Half.Visible == true then
return "1.5"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star1_Service_Image_Full.Visible == true then
return "1"
else
if plr.PlayerGui.FlightRating.Main.Rating1.Star1_Service_Image_Half.Visible == true then
return "0.5"
else
return "0"
end
end
end
end
end
end
end
end
end
end
end
local function rating2()
if plr.PlayerGui.FlightRating.Main.Rating2.Star5_Service_Image_Full.Visible == true then
return "5"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star5_Service_Image_Half.Visible == true then
return "4.5"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star4_Service_Image_Full.Visible == true then
return "4"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star4_Service_Image_Half.Visible == true then
return "3.5"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star3_Service_Image_Full.Visible == true then
return "3"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star3_Service_Image_Half.Visible == true then
return "2.5"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star2_Service_Image_Full.Visible == true then
return "2"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star2_Service_Image_Half.Visible == true then
return "1.5"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star1_Service_Image_Full.Visible == true then
return "1"
else
if plr.PlayerGui.FlightRating.Main.Rating2.Star1_Service_Image_Half.Visible == true then
return "0.5"
end
end
end
end
end
end
end
end
end
end
end
local function rating3()
if plr.PlayerGui.FlightRating.Main.Rating3.Star5_Service_Image_Full.Visible == true then
return "5"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star5_Service_Image_Half.Visible == true then
return "4.5"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star4_Service_Image_Full.Visible == true then
return "4"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star4_Service_Image_Half.Visible == true then
return "3.5"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star3_Service_Image_Full.Visible == true then
return "3"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star3_Service_Image_Half.Visible == true then
return "2.5"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star2_Service_Image_Full.Visible == true then
return "2"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star2_Service_Image_Half.Visible == true then
return "1.5"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star1_Service_Image_Full.Visible == true then
return "1"
else
if plr.PlayerGui.FlightRating.Main.Rating3.Star1_Service_Image_Half.Visible == true then
return "0.5"
end
end
end
end
end
end
end
end
end
end
end
local rating1data = rating1()
local rating2data = rating2()
local rating3data = rating3()
local data = {
['embeds'] = {{
['title'] = "New Rating from "..plr.Name,
['description'] = "Service: "..rating1data,
['color'] = 3769131,
['url'] = "https://www.roblox.com/isers/"..plr.UserId.."/profile"
}}
}
local finaldata = http:JSONEncode(data)
http:PostAsync(url, finaldata)
end)
The thing is now it only returns “0” to the embed. Even tho for the player the 5 star is visible.
Please help.