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

remote events will not work with weapons?

Asked by 6 years ago
Edited 6 years ago

i tried another way to make weapons with fe on and i cant believe i cant do it. works in studio but not game and i tried multiple ways of waiting for the child so it loads in.

local script code that is in the handle

player = game.Players.LocalPlayer mouse = player:GetMouse() tool = script.Parent.Parent enabled = true tool.Activated:connect(function() game.ReplicatedStorage.DamageEvent:FireServer()

end)

normal script that is meant to work when damageevent is fired

~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ ``

`player = game.Players.LocalPlayer mouse = player:GetMouse() tool = script.Parent enabled = true game.ReplicatedStorage.DamageEvent.OnServerEvent:connect(function() if enabled == true then local part = Instance.new("Part",game.Workspace) game.Debris:AddItem(part,3) part.Size = Vector3.new(0.1,0.1,3) part.Material = Enum.Material.Neon

01part.TopSurface = "Smooth"
02part.BottomSurface = "Smooth"
03part.BrickColor = BrickColor.new("Gold")
04part.CanCollide = false
05part.CFrame = tool.Handle.CFrame
06part.CFrame = CFrame.new(part.Position,mouse.Hit.p)
07local v = Instance.new("BodyVelocity",part)
08v.Velocity = part.CFrame.lookVector * 500
09v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
10tool.Handle.Sound:Play()
11part.Touched:connect(function(hit)
12    humanoid = hit.Parent:FindFirstChild("Humanoid")
13    if humanoid and humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
14        humanoid.Health = humanoid.Health - 10
15    end
16end)
17enabled = false
18wait(0.5)
19enabled = true
20end

end)`

and if it looks weird idk how to fix im very new to site have not used it often

2 answers

Log in to vote
0
Answered by 6 years ago

player = game.Players.LocalPlayer mouse = player:GetMouse() tool = script.Parent

cannot be in normal script

0
wouldnt work i put it in both local scripts FaZe_McDouble -7 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

wouldnt work i put it in both local scripts

Answer this question