Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Name: Wiimote
- Category: Tools
- Aka: The wii controller
- ]]
- wait(1 / 60)
- print("\n Wiimote loaded! \n While using wii, you can move arms \n Controls: \n [E] - Wii 1 button \n [R] - Wii 2 button \n [Z] - Wii button \n [J, I, K, L] - D-pad buttons \n [P, O] - Start/Select buttons")
- local plr = game.Players.LocalPlayer
- local character = plr.Character
- local mouse = plr:GetMouse()
- local head = character.Head
- local Motor6D = {
- ["LeftShoulder"] = character.Torso["Left Shoulder"],
- ["Neck"] = character.Torso.Neck,
- ["RightShoulder"] = character.Torso["Right Shoulder"],
- ["LeftHip"] = character.Torso["Left Hip"],
- ["RightHip"] = character.Torso["Right Hip"],
- }
- local sound = Instance.new("Sound", head)
- sound.Name = "CurrentSound"
- local equipped = false
- local wiimote = Instance.new("Tool", plr.Backpack)
- wiimote.Name = "Wiimote"
- local handle = Instance.new("Part", wiimote)
- handle.Name = "Handle"
- handle.Size = Vector3.new(0.45, 0.419, 1.85)
- local mesh = Instance.new("SpecialMesh", handle)
- mesh.MeshType = Enum.MeshType.FileMesh
- mesh.MeshId = "rbxassetid://5027230424"
- mesh.TextureId = "rbxassetid://5027230482"
- wiimote.Equipped:Connect(function()
- equipped = true
- while true do
- if equipped == true then
- wait()
- Motor6D.RightShoulder.C0 = CFrame.new(1, 0.8, 0) * CFrame.Angles(mouse.Hit.lookVector.X + mouse.Origin.lookVector.X + math.rad(0), mouse.Hit.lookVector.Y + mouse.Origin.lookVector.Y + math.rad(90), mouse.Hit.lookVector.Z + mouse.Origin.lookVector.Z + math.rad(0))
- else
- break
- end
- end
- end)
- wiimote.Unequipped:Connect(function()
- equipped = false
- wait(.01)
- Motor6D.RightShoulder.C0 = CFrame.new(0.993, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))
- Motor6D.LeftShoulder.C0 = CFrame.new(-0.993, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(-90), math.rad(0))
- Motor6D.Neck.C1 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.rad(90), math.rad(180), math.rad(0))
- Motor6D.RightHip.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))
- Motor6D.LeftHip.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(-90), math.rad(0))
- end)
- mouse.KeyDown:Connect(function(key)
- key = key:lower()
- if equipped == true then
- if key == "e" or key == "r" then
- sound.SoundId = "rbxassetid://4086020670"
- wait(.1)
- sound:Play()
- elseif key == "z" then
- sound.SoundId = "rbxassetid://156785206"
- wait(.1)
- sound:Play()
- if key == "j" or key == "i" or key == "k" or key == "l" then
- sound.SoundId = "rbxassetid://4086020670"
- wait(.1)
- sound:Play()
- elseif key == "z" then
- sound.SoundId = "rbxassetid://156785206"
- wait(.1)
- sound:Play()
- elseif key == "p" or key == "o" then
- sound.SoundId = "rbxassetid://156785206"
- wait(.1)
- sound:Play()
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement