Right now, this script only runs when the player enters, then never runs again. I want to make it run again when the player respawns, but I'm not sure how I would go to doing this.
local wings = game.ReplicatedStorage.Wings
local mps = game:GetService("MarketplaceService")
game:GetService("Players").PlayerAdded:Connect(function(player)
if mps:UserOwnsGamePassAsync(player.UserId,5260848) then
local function createMachine()
local wingsClone = wings:Clone()
wingsClone.PrimaryPart = wingsClone.Base
wingsClone.Parent = player.Character
wingsClone:moveTo(player.Character.Torso.Position)
local weld = Instance.new("Motor6D")
weld.Parent = wingsClone.Base
weld.Part0 = wingsClone.Base
weld.Part1 = player.Character.Torso
end
createMachine(player)
end
end)

4 comments
Just make it Touched function, and add it to the Spawn Point, it will do it always when he touches the spawn point.
just use the CharacterAdded event of the player, which fires when the character loads or respawns
https://www.robloxdev.com/api-reference/event/Player/CharacterAdded
How would I go to applying that to this script? I tried multiple ways, but it's only a event of player so it's kind of difficult to do