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

Is it possible to damage a humanoid with only the use of local scripts in a tool?

I'm pretty new to scripting and I got curios how to make a gun. I looked at some examples from the toolbar hoping to find some ideas on how to script a gun, but I noticed that there wasn't any remote events or anything that could have used to communicate with the server in the gun I found. All there was is a local script, there was some scripts but it doesn't really do anything with damaging. I tried making a simpler version of the local script but it doesn't work.

local Mouse = game.Players.LocalPlayer:GetMouse()

script.Parent.Activated:Connect(function()
	local Target = Mouse.Target
	if Target then
		local Humanoid = Target.Parent:FindFirstChildWhichIsA("Humanoid")
		if Humanoid then
			Humanoid:TakeDamage(100)
		end
	end
end)

5 comments

0

You should damage the humanoid on the server as the damage will only be seen locally with filtering enabled on

0

As i said don't do the damage in a local script its pretty simple

0

As i said don't do the damage in a local script its pretty simple

0

My question was "Is it possible to damage a humanoid using only a local script?" BECAUSE i found a gun which can DAMAGE ONLY USING A LOCAL SCRIPT

0

can you please at least look at the gun and see the local script

1 answer

heres a quick answer, no it'll only damage on your screen because its "local" aka client sided... you need the server to damage in order for every person to see that it has been damaged

2 comments

0

This shouldn't be an answer. It's too short.

0

well it answers it...

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