i have some problems with getting my players equiped tool to show on the server.
i had previously had the equip process done in a player localscript but as that did not fix this I have put the equip code in a module hoping that as that would be running on the server it would be a solution.
It did not work as shown in this pic.
The invoke in the localscript now is
_G.Controller.Equipped:Connect(function()
CM:Disable() -- freez player
equiping.Visible = true
print("Equiped")
_G.Controller = script.Parent
local BMEquiped = ControllerBMModuleScript:Equip(ActivePlayer)
if BMEquiped then
holding = true
end
CM:Enable() -- unfreez player
end)
and the corresponding code in the module is
-- This module manages BotMaster equip.
local module = {}
local parts = {}
local function scanWeld(parent,Bot)
for _,v in pairs(parent:GetChildren()) do
if (v:IsA("BasePart")) then
if v.Name ~= "MainPart" then
local w = Instance.new("WeldConstraint")
w.Name = ("WC_%s"):format(v.Name)
w.Part0 = Bot.MainPart
w.Part1 = v
w.Parent = Bot.MainPart
table.insert(parts,v)
scanWeld(v)
wait(0.05)
end
end
end
end
function module:Equip(player)
print("BM_Equip_Called")
local BotMasterOffset = Vector3.new(-0.5,0,-1.75)
local BotMasterOrientation = CFrame.Angles(0,0,math.rad(90))
local RS = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local LP = Players.LocalPlayer
local Handle = _G.Controller:WaitForChild("Handle")
local Bot = RS.BotMaster:Clone()
Bot.Parent = Handle
scanWeld(Bot, Bot)
for _,v in pairs(parts) do
v.Anchored = false
end
parts = {}
local APUTCF = player.UpperTorso.CFrame
local BotMainPartCFrameAdjustment = APUTCF + APUTCF.lookVector + BotMasterOffset
Bot:SetPrimaryPartCFrame(BotMainPartCFrameAdjustment)
local orientBot = Bot:GetPrimaryPartCFrame() * BotMasterOrientation
Bot:SetPrimaryPartCFrame(orientBot)
local w1 = Instance.new("WeldConstraint")
w1.Part0 = player.UpperTorso
w1.Part1 = Bot.MainPart
w1.Name = "WC_BotMaster"
w1.Parent = player.UpperTorso
Bot.MainPart.Anchored = false
wait(0.1)
local color1 = Color3.new(0,0,0.5)
local color2 = Color3.new(0,0,0.75)
local colorSeq = ColorSequence.new(color1,color2)
local beam = Instance.new("Beam")
beam.FaceCamera = true
beam.Attachment0 = player.UpperTorso.BodyFrontAttachment
beam.Width0 = 0.075
beam.Attachment1 = Bot.BackShield.Attachment
beam.Width1 = 0.075
beam.Color = colorSeq
beam.Name = "Beam_BotMaster"
beam.Parent = player.UpperTorso
return true
end
return module
So my question is how do I get the tool to show in the server so that when I go to multi-player I see all the players with their tools in each players window.