You can write your topic however you want, but you need to answer these questions:
I’m trying to make it when my tool hits another player, I am able to change THAT OTHER players properties.
The issue is that I don’t really know how to achieve this, I’m not an advanced scripter.
The furthest I’ve gotten is making a Remote Event and connecting it to the Tools script and a script in ServerScriptService.
My problem is that I am not really a scripter. I know basic stuff, and this seems advanced to me! But so far I have a RemoteEvent called when you click the tool, then I have it sent to a script in ServerScriptService. I’m not sure how to make it so that when the tool collides with another player, I am able to edit that other players properties, an example being: You swing the tool, it hits another player and it turns their torso red. If you could please help, that would be greatly appreciated, thanks!
All you need is the part that is getting touched, from there we can extract the player’s character and all the other necessary stuff.
In this example I’ll be using .Touched.
local PS = game:GetService("Players")
local part: BasePart
part.Touched:Connect(function(touch)
local char = touch:FindFirstAncestorWhichIsA("Model")
local hum = char and char:FindFirstChildWhichIsA("Humanoid")
if hum then
-- do stuff here
end
end)
So should I keep the Remote Event? Will I need that still, because the main script thats in the tool is a Local Script. (Sorry for all the questions, I’m more of a Builder and Animator then Scripter)
That’s the main end part of my hammer, the part that you would usually hit someone with if you hit someone with a hammer lol. I am still getting the same error message though.