Hi all, I was wondering what could be causing this issue where in team test, the weapon or character that i currently have equipped is messing with the model of another player’s weapon. In the video provided, the character that has the big green sword should NOT be holding it over their head in the air like that. In fact, that model should not be showing. Instead, it is supposed to show the model of the second, rainbow sword towards the end. Could anyone try and help me figure out what’s causing this? The script provided is placed in ServerScript Service, should it be placed on the client? and if so, What Changes need to be made for it to work? Thanks in advance if anyone could help!
local Players = game:GetService("Players")
local RepStorage = game:GetService("ReplicatedStorage")
local Weapon = RepStorage.Assets.JadeSword:WaitForChild("Weapon")
local charVariable
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Wait()
charVariable = player
end)
Players.PlayerAdded:Connect(function(Players)
Players.CharacterAppearanceLoaded:Connect(function(Character)
if charVariable:WaitForChild("CurrentCharacter").Value == "Character1" then
return
elseif charVariable:WaitForChild("CurrentCharacter").Value == "Character2" or charVariable:WaitForChild("CurrentCharacter").Value == "Empress" then
if charVariable:WaitForChild("CurrentCharacter").Value == "Empress" then
Weapon = RepStorage.Assets.Empress:WaitForChild("EmpTerra")
elseif charVariable:WaitForChild("CurrentCharacter").Value == "Character2" then
Weapon = RepStorage.Assets.JadeSword:WaitForChild("Weapon")
end
local RightArm = Character:WaitForChild("Right Arm")
local HRP = Character:WaitForChild("HumanoidRootPart")
local ClonedWeapon = Weapon:Clone()
ClonedWeapon.Parent = Character
local Handle = ClonedWeapon:FindFirstChild("Handle")
local CFrameValue = ClonedWeapon:FindFirstChild("Value")
local motor6d = ClonedWeapon.Handle:WaitForChild("Motor6D")--Instance.new("Motor6D")
if charVariable:WaitForChild("CurrentCharacter").Value == "Empress" then
motor6d.Part0 = HRP
else
motor6d.Part0 = RightArm
end
motor6d.Part1 = Handle
motor6d.Parent = Handle
end
--[[local RightArm = Character:WaitForChild("Right Arm")
local ClonedWeapon = Weapon:Clone()
ClonedWeapon.Parent = Character
local Handle = ClonedWeapon:FindFirstChild("Handle")
local CFrameValue = ClonedWeapon:FindFirstChild("Value")
local motor6d = ClonedWeapon.Handle:WaitForChild("Motor6D")--Instance.new("Motor6D")
motor6d.Part0 = RightArm
motor6d.Part1 = Handle
motor6d.Parent = Handle
local armmotor6d = Instance.new("Motor6D", RightArm)
armmotor6d.Part0 = RightArm
armmotor6d.Part1 = Handle
armmotor6d.Parent = Handle]] -- Old code, before the weapon rework
end)
end)