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

remote events will not work with weapons?

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

part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
part.BrickColor = BrickColor.new("Gold")
part.CanCollide = false
part.CFrame = tool.Handle.CFrame
part.CFrame = CFrame.new(part.Position,mouse.Hit.p)
local v = Instance.new("BodyVelocity",part)
v.Velocity = part.CFrame.lookVector * 500
v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
tool.Handle.Sound:Play()
part.Touched:connect(function(hit)
	humanoid = hit.Parent:FindFirstChild("Humanoid")
	if humanoid and humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
		humanoid.Health = humanoid.Health - 10
	end
end)
enabled = false
wait(0.5)
enabled = true
end

end)`

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

2 answers

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

cannot be in normal script

1 comment

0

wouldnt work i put it in both local scripts

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