Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

If I wanted to spawn an object on a players arm when they joined how would I do that?

Asked by 3 years ago

the script I used doesn’t work properly

game.Players.PlayerAdded:Connect(function(player)   
    player.CharacterAdded:Connect(function(character)
        local rightarm = character:WaitForChild("RightArm")
        local ticket = game.ReplicatedStorage.Spawn:Clone()
        ticket.Parent = character
        ticket.Orientation = rightarm.Orientation
        ticket.band.WeldConstraint.Part0 = rightarm
        ticket.band.WeldConstraint.Part1 = ticket.band  
        ticket.LeftArm:Remove() 
        ticket.band.SurfaceGui.Frame.Size.X = player:WaitForChild("Tickets").Value  
    end)
end

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago
game.Players.PlayerAdded:Connect(function(player)   
local character = player.character or player.CharacterAdded:Wait()
local part = Instance.new("Part",workspace)
local weld = Instance.new("Weld",character.RightHand)
weld.Part0 = character.RightHand
weld.Part1 = part
end)
Ad

Answer this question