Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My guns that I have made in game don't show up to other players how would I fix this?

So I have Been Working on a gun script for some time, But the guns themselves show up to the local players holding them, but not to other players, and vice versa. So it looks as if the player is holding nothing but if you look at the players screen it actually is. The gun script its self is a local Script. I have some what a knowledge of lua, but I have never quite had this problem .

 repeat wait() until game.Players.LocalPlayer.Character
  repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
  wait(1 / 20)
--Constants and Varibles
  local Gun = script.Parent
  local Handle = Gun:WaitForChild("Handle")
 local AimPart = Gun:WaitForChild("AimPart")
  local Main = Gun:WaitForChild("Main")
  local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local Torso = Character:WaitForChild("Torso")
local Head = Character:WaitForChild("Head")
local HRP = Character:WaitForChild("HumanoidRootPart")

local Neck = Torso:WaitForChild("Neck")
local LArm = Character:WaitForChild("Left Arm")
local RArm = Character:WaitForChild("Right Arm")
local LLeg = Character:WaitForChild("Left Leg")
local RLeg = Character:WaitForChild("Right Leg")
local CF, CFANG = CFrame.new, CFrame.Angles
local RAD, SIN, COS, TAN = math.rad, math.sin, math.cos, math.tan
local M2 = Player:GetMouse()
local Camera = game.Workspace.CurrentCamera
local INSERT = table.insert
local Parts = {}
	local RightS = Torso:WaitForChild("Right Shoulder");
local	LeftS = Torso:WaitForChild("Left Shoulder")
	repeat wait() until Gun.Parent == Character.LoadOut.Primary
	script.Parent.Parent = script.Parent.Parent.Parent.Parent

--Arm Set-Up
repeat wait() until RArm
 weld = Instance.new("Weld")
weld.Part0 = Character["Right Arm"]
weld.Part1 = Gun.Handle
weld.C0 = CFrame.new(0, -1, 0) * CFrame.Angles(-0.5 * math.pi, 0, 0)

weld.Parent = RArm

 pos = LeftS.C0.p;
 wantedRot = CFrame.new(-1, 0.5, 0) * CFrame.Angles(0 * math.pi, 60, 30)
    LeftS.C0 =  wantedRot;

Right now all it does is weld to players arm and rotate itself, but still the other players cant see this. Photos [(http://ibb.co/mGxewK)] [(http://ibb.co/jyqciz)]

4 comments

0

Can you post the script? Do you have a wait() in it also?

0

There you go.

0

I think if your in filtering enabled you would need to use a remote function

0

I have filtering enabled disabled.

1 answer

✓ Accepted answer

It's because when you add something to the workspace through a local script, that thing is only visible to the local player of that script. For example, if you insert a part into the workspace through a local script, that part will only be visible to the local player, and not the whole server. You can make the gun appear in the player's hand on a server script, using remote events.

1 comment

0

How would I do so, I have never herd of remote functions?

This discussion is preserved as it was. New answers, comments, and votes are closed.