Does anyone know how to make this

This looks really hard can anyone give me tipps how to script that?

So my Idea is;

Make a touch Event

Fire player Client, – but how can I fire to the player client and make a input check etc I never saw that?

3 Likes

This works using the particle system and lights. Also, the camera FOV changes (i guess), and that you probably can’t move so your controls get disabled. That’s how I think it works.

1 Like

As @AZ9tumas said:

  1. The camera changes and you cannot move.
  2. Particles, lights and sounds are activated.
  3. A ScreenGui appears, and since motion is disabled, there is no problem pressing the keys.
1 Like

I am sure that there are animations because in the video the character vibrates.

1 Like

I know that I just asked about how to fire his client
other things I do know

1 Like

Touch event might work but it is very unstable and sometimes might not work. So I think you should use things like magnitude to check if the player is close enough. Then check if the character has the animation playing using the humanoid. If all these conditions are true then this system can start working.
You could use touch event also to check if the character touched the player’s head while hitting.

Use a FireServer event with the parameters of Target, Action and the server should FireClient(Target) so the other client receives that he is under attack and carry on with what SOTR said.

@Iwantbebetter Could you tell me which game that is from?

Grand piece online you can play it is on roblox

1 Like

No no hahah there is much more about it I want to add, and I would never solve this with magnitude xD

hm could you show me a post in this Devforum or give me a script example I cant really understand how you mean that

local player = game.Players.LocalPlayer
--I think the thing the player uses to attack is a tool
local tool = ... --Set this to the tool
local maxDistance = 15  --change this according to ur wish

tool.Activated:Connect(function()
     local players = game.Players:GetPlayers()
     for i, v in pairs(players) do
          if workspace:FindFirstChild(v.Name) then
               local chr = workspace[v.Name]
               if player.Character and player.Character.HumanoidRootPart then
                    if (chr.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude <= maxDistance then
                         --do stuff 
                    end
               end
          end
     end

end)

Place a Remote Event in ReplicatedStorage and name it “Combat”
(This is for adding on to @AZ9tumas)

Client Script 1

local player = game.Players.LocalPlayer
--I think the thing the player uses to attack is a tool
local tool = ... --Set this to the tool

tool.Activated:Connect(function()
     local players = game.Players:GetPlayers()
     for i, v in pairs(players) do
          if workspace:FindFirstChild(v.Name) then
               local chr = workspace[v.Name]
               if player.Character and player.Character.HumanoidRootPart then
                    if (chr.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude <= maxDistance then
                        ReplicatedStorage.Combat:FireServer(v, "attack")
                        --Start Camera shake and show keybinds
                        --Assume it's an attack move
                    end
               end
          end
     end

end)

Server Script (Place in ServerScriptService)

local ReplicatedStorage = game:GetServer("ReplicatedStorage")

ReplicatedStorage.Combat.OnServerEvent:Connect(function(plr, target, move) 
    ReplicatedStorage.Combat:FireClient(target, move, plr)
    --Enable the particles here
end

Client Script 2

local ReplicatedStorage = game:GetService("ReplicatedStorage")

function onAttack()
    --Disable movement, enable keybinds, camera shake
end

ReplicatedStorage.Combat.OnClientEvent:Connect(onAttack)

Yes, after that I guess that when one of those blue colored bars will be filled, then you can fire another remote event that will stop this process.

guys really thanks but I want know how I can make the gui part thats hard

how can I check the input and fire something to the player, can you guys understand me?

You could use a tween to scale the blue thing, have different keybinds in a table, then use math.random() to choose the next keybind from the the table, then use UserInputService to check the keybinds pressed.

2 Likes

Thaaaanks thats all what I wanted xD

1 Like