I have these 2 scripts
Sever:
local Players = game:GetService("Players")
local event = game.ReplicatedStorage:WaitForChild("UpdateImage")
local createEvent = game.ReplicatedStorage:WaitForChild('CreateImage')
local removeEvent = game.ReplicatedStorage:WaitForChild("RemoveImage")
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local startPart = game.Workspace:WaitForChild("Start")
local endPart = game.Workspace:WaitForChild("End")
function update()
while task.wait(0.01) do
for i, player in pairs(Players:GetChildren()) do
local succes, errorMsg = pcall(function()
if game.Workspace:WaitForChild(player.Name).Humanoid.Health >= 0 then
local hrpPosition = game.Workspace:WaitForChild(player.Name).HumanoidRootPart
local distance = (endPart.Position - hrpPosition.Position).Magnitude
local Gui = player.PlayerGui
local ProgressGui = Gui.ProgressGUI
local Frame = ProgressGui.Frame
local newPos = UDim2.new(math.clamp(1 - (distance / 855),0,0.88))
event:FireAllClients(player.Name, distance, newPos)
--print(player.Name.." : ".. math.clamp(1 - (distance / 100),0,0.88))
--Frame:WaitForChild(player.Name.."Image").Position = UDim2.new(math.clamp(1 - (distance / 100),0,0.88))
else
end
end)
if succes then
else
print(errorMsg)
end
end
end
end
task.spawn(update)
game.Players.PlayerAdded:Connect(function(plr)
print(plr.Name)
task.wait(2)
for i, player in pairs(Players:GetChildren()) do
createEvent:FireAllClients(player.Name, player.UserId)
print("fired event for ".. player.Name)
--local plrGui = player.PlayerGui
--local image = plrGui:WaitForChild("ImageTemplate"):Clone()
---image.Name = plr.Name.."Image"
--image.Image = "rbxasset://"..4931209701
--image.Parent = player.PlayerGui.ProgressGUI.Frame
--local content = Players:GetUserThumbnailAsync(plr.UserId, thumbType, thumbSize)
--image.Name = plr.Name.."Image"
--image.Image = content
--image.BackgroundTransparency = 1
--image.Parent = player.PlayerGui.ProgressGUI.Frame
end
end)
Players.PlayerRemoving:Connect(function(plr)
print("plr removing")
removeEvent:FireAllClients(plr.Name)
end)
Client:
local event = game.ReplicatedStorage:WaitForChild("UpdateImage")
local createEvent = game.ReplicatedStorage:WaitForChild('CreateImage')
local removeEvent = game.ReplicatedStorage:WaitForChild("RemoveImage")
local Frame = script.Parent
event.OnClientEvent:Connect(function(player, distance, NewPos)
Frame:WaitForChild(player.."Image").Position = NewPos
end)
createEvent.OnClientEvent:Connect(function(player, id)
print("event recieved with player ".. player)
print(id)
if Frame:FindFirstChild(player.."Image") then return end
print("image does not already exist")
local newImage = Frame.Parent.Parent.ImageTemplate:Clone()
newImage.Parent = Frame
newImage.Name = player.."Image"
local content = game.Players:GetUserThumbnailAsync(id, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
newImage.Image = content
newImage.BackgroundTransparency = 1
end)
removeEvent.OnClientEvent:Connect(function(plr)
Frame:FindFirstChild(plr.."Image"):Destroy()
end)
i am near certain that the issue is in this line
local content = game.Players:GetUserThumbnailAsync(id, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
as when i remove the line that makes the background transparent the image is there but it does not have the players face on it as it should, this worked like literally a few minutes prior and now it just stopped, i did not touch the scripts. Any help is appreciated