Problem
My script is, when the player joins it gets a part inside the workspace and welds it into the player. This works in studio but not in game. I've used FireClient so send code to Server to client but it doesn't work. What am I doing wrong?
LocalScript:
local Players = game:GetService('Players') local Player = Players.LocalPlayer local char = Player.Character local LeftArm = char.Torso game.ReplicatedStorage.DoDun.OnClientEvent:Connect(function(Part)--Get the RemoteEvent print("hoolio") Part.CFrame = LeftArm.CFrame * CFrame.new(-5,0,0) local weld = Instance.new("Weld")--Welds it to left arm -5 on the x scale weld.Part0 = LeftArm weld.C0 = LeftArm.CFrame:inverse() weld.Part1 = Part weld.C1 = Part.CFrame:inverse() weld.Parent = Part print("ok") Part.Anchored = false Part.CanCollide = false print("non") end)
Server Script
game.Players.PlayerAdded:Connect(function(Player)--Get the player when joines local Part = game.ReplicatedStorage.Part:Clone()--Clones the part Part.Parent = workspace game.ReplicatedStorage.DoDun:FireClient(Player, Part)--FireClient with the RemoteEvent end)