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

Local Script won't equip item to template character when a button is clicked, help?

Asked by 3 years ago

I made a local script that was supposed to clone the item the player has clicked into a template character in the workspace. Everything but the item showing up on the character works. There is no error.

template.TextButton.MouseButton1Click:Connect(function()

                local result = game.ReplicatedStorage.Equipped:InvokeServer(hat)
                print(result)
                if result == "Equipped" then
                    print("not wearing")
                    game.Workspace["stab soundeffect"]:Play()
                    local item = game.ReplicatedStorage.Accessories:FindFirstChild(hat.Name):Clone()
                    item.Parent = game.Workspace.HatMODEL
                end
                if result == "Unequipped" then
                    print("Already wearing")
                    game.Workspace.HatMODEL:FindFirstChild(hat.Name):Destroy()
                    game.Workspace["Among Us Swipe Card Error"]:Play()
                end
                local smoke = Instance.new("Smoke",game.Workspace.HatMODEL.HumanoidRootPart)
                wait(0.5)
                smoke:Destroy()
            end)

Answer this question