I’m trying to make a tool with an animation for a guitar and it looks normal locally but for other people it is broken behind their back
local Tool = script.Parent
local Player = Tool.Parent.Parent
local Char = Player.Character
local hold = Tool.hold
Tool.Equipped:Connect(function()
Char.RightHand:WaitForChild("RightGrip"):Destroy()
local Motor6D = Instance.new("Motor6D",Char.UpperTorso)
Motor6D.Name = "HandleMotor6D"
Motor6D.Part0 = Char.UpperTorso
Motor6D.Part1 = Tool.Handle
Motor6D.C0 = CFrame.new (0,0.2,-0.7)
local anim = Tool.hold
hold = Char.Humanoid:LoadAnimation(anim)
hold:Play()
end)
Tool.Unequipped:Connect(function()
if Char.RightHand:FindFirstChild("HandleMotor6D")then
Char.RightHand.HandleMotor6D:Destroy()
end
hold:Stop()
end)
Its quite simple, all you would need to do is setup a remote event which on the server(script) creates the motor for you, then from there you can use the Method fo the remote event called FireServer to fire the event on the client, with the Equipped event, (this concept also applies for removing the motor).
--[[Server]]--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = Instance.new("RemoteEvent") -- We create a remote event(You can create it in studio if you want)
RemoteEvent.Name = "MotorEvent" -- The RemoteEvent's Name
RemoteEvent.Parent = game:GetService("ReplicatedStorage") -- You can access this RemoteEvent from here
local function MotorMethod(Player) -- We create the function
-- You can create the motor here
end
RemoteEvent.OnServerEvent:Connect(MotorMethod)
--[[Client]]--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MotorEvent = ReplicatedStorage:WaitForChild("MotorEvent")
-- From here on out you can use the :FireServer method to call the method on the server e.g MotorEvent:FireServer()
I’m not very much a coder so I don’t really understand some of the terminology you’re putting down, is there anyway you can simplify it another to a coding noob?