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

How can I anchor this accessory but still be able to try it on?

Asked by
0hiivs 0
3 years ago

Someone please help me! Okay so i have this accessory u can try on. I want it to stand in place, but if i anchor it i get stuck in the item when i try it on.

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Make a duplicate of the accessory the player is touching and put it in ServerStorage, then put this script inside the accessory the player is touching's "Handle":

local touchpart = script.Parent --This is defining the part you are touching, make sure this is anchored
local tryonpart = game.ServerStorage.TryOnPart --This is the part you want your player to have, but change "TryOnPart" to whatever it's called and make sure it's unanchored

touchpart.Touched:Connect(function(hit) --This triggers when the player touches the part
    if hit and hit.Parent:FindFirstChild("Humanoid") then --This checks if the thing that touched it was a player

        local char = hit.Parent --Defining the player

        tryonpart.Parent = char --Parenting the part to the player (Teleporting it)

    end
end)
Ad

Answer this question