So I have a Local script in StarterPack and it functions 100% in studio but not in servers why is this? Here is my code below.
UIS = game:GetService("UserInputService")
fire = script:WaitForChild("fire")
flame1 = game:GetService("ServerStorage"):WaitForChild("Flame")
plr = script.Parent.Parent
m = plr:GetMouse()
UIS.InputBegan:connect(function(Input, gameProc)
if Input.KeyCode == Enum.KeyCode.Z and not gameProc then
if plr.Character.RightHand:FindFirstChild("Flame") then
print("Already Equipped")
else
fh = plr.Character.Humanoid:LoadAnimation(fire)
fh.Priority = 2
fh:Play()
weld = Instance.new("Weld")
flame = flame1:Clone()
flame.Parent = plr.Character.RightHand
weld.Parent = plr.Character.RightHand
weld.Part0 = flame
weld.Part1 = plr.Character.RightHand
weld.C0 = CFrame.new(0,0.7,0)
m.Button1Down:connect(function()
print("clicked")
weld:Destroy()
fh:Stop()
bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = m.Hit.lookVector*100
bv.Parent = flame
flame.Dmg.Disabled = false
plr.Character.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position, Vector3.new(m.Hit.p.X, plr.Character.HumanoidRootPart.Position.Y, m.Hit.p.Z))
flame.Touched:connect(function(hit)
if hit.Name ~= "Handle" then
if hit ~= plr.Character.RightHand then
print(hit)
exp = game.ServerStorage.Explode:Clone()
exp.CFrame = flame.CFrame
exp.Parent = workspace
flame:Destroy()
wait(1)
exp:Destroy()
if hit.Parent:FindFirstChild("Humanoid") then
fp = game.ServerStorage.FireParticle:Clone()
fp.Parent = hit.Parent.LowerTorso
fp.Enabled = true
for i = 1,5,1 do
wait(1)
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 2.5
end
fp.Enabled = false
fp:Destroy()
end
end
end
end)
game:GetService("Debris"):AddItem(flame, 7)
game:GetService("Debris"):AddItem(exp,3)
end)
end
end
end)

2 comments
Is your game Filtering Enabled?
No, but it will be soon and then i will add remote events i just want this to work first