Hello.
I want to make a fist tool as default mode, and I want to punch with mouse1(left click).
I tried to make a fist tool, but it didn’t work(I deleted a script so I can’t restoration it).
Like Fallout 4.
And if the player punched with it, the player’s speed will be just a little faster in a few seconds.
Please teach me a script. Thanks.
So, kind of like a simulator? If you Activate
the tool, your WalkSpeed will be faster?
Fist =
Google translate changes it to “first”, but it’s not.
No. If the punch animation has ended, player’s speed will back to default.
So what you would do is to make a tool then put it under starter character scripts, the tool would just be a part that is a cube. And when the mouse button is down, an animation would play, then at the part when the animation plays, you would do something.
I don’t know what you mean by a, “vibration”, can you show us a video?
You need to detect when the animation has stopped playing, using .Stopped
if it has stopped, you change the player’s WalkSpeed? Is this what you’re trying to achieve?
Sure!
This is on phone, but you can understand!
I’m confused, that’s just you holding a tool…
Title of this topic doesn’t match with it’s content.
Anyways, to make a tool default (so you can’t unequip it), in it’s script put this:
tool.Unequipped:Connect(function()
--instead of “tool” put your variable for the tool
humanoid:EquipTool(tool)
--instead of “humanoid” put a variable for character’s humanoid
end)
Remember that asking for full scripts is forbidden.
For this kind of behaviour you will not be looking for a tool, you will be looking to rely solely on user input. Your punch script should be active as in when the user is not currently holding a tool or doing an action that should prevent punching.
Look into UserInputService for a reference on how to check for input that the client sends. From there, it’s all about the appropriate checks passing and whatnot.
At the very least, here’s a rough template of what you would be looking at:
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = game:GetService("Players").LocalPlayer
local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
function inputBegan(inputObject, gameProcessedEvent)
if not gameProcessedEvent then
if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then
if not character:FindFirstChildWhichIsA("Tool") then
print("Punch!")
end
end
end
end
UserInputService.InputBegan:Connect(inputBegan)
Thats legit a 8h gameplay. whut?
not big of a deal just watch it all
Click on the vid and it will send you to the time 15:00 or something I’m not sure