Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Fire spawns in studio fine, but not in-game?

Asked by 8 years ago
local plr = game.Players.LocalPlayer
local char = plr.Character
local firePart = game.ServerStorage.FireAttack
repeat wait() until char

function weld(part1, part2)
 local weld = Instance.new("Weld")
 weld.Part0 = part1
 weld.Part1 = part2
 weld.C0 = part1.CFrame:toObjectSpace(part2.CFrame)
 weld.Parent = part1
 return weld
end

game:GetService("UserInputService").InputBegan:connect(function (input,GPE)
local humanoid = char:FindFirstChild("Humanoid")
 if input.KeyCode == Enum.KeyCode.One then
  local fireCopy = firePart:Clone()
  fireCopy.Parent = char["Right Arm"]
  local spin1Weld = weld(firePart.FakeArm, firePart.Spinner1)
  local spin2Weld = weld(firePart.FakeArm, firePart.Spinner2)
  firePart.FakeArm.CFrame = char["Right Arm"].CFrame

  local weld = Instance.new("Weld", firePart)
  weld.Part1 = char["Right Arm"]
  weld.Part0 = firePart.FakeArm
  local lastTick = tick()
  while (tick() - lastTick < 5) do
   wait()
   spin1Weld.C1 = spin1Weld.C1 * CFrame.Angles(0.1, 0, 0)
   spin1Weld.C0 = spin1Weld.C0 * CFrame.Angles(0.1, 0, 0)
  end
  char["Right Arm"].FireAttack:Destroy()
 end
end)

So basically this works fine in studio, but in-game the fire part just doesn't spawn at all

0
Do not use ServerStorage. Use ReplicatedStorage. Rodmane234 85 — 8y
0
^ BakonBot 26 — 8y
0
So I switched from ServerStorage to ReplicatedStorage, still doesn't work. HornedWyven 10 — 8y

Answer this question