Hey devs since the may update of my new game strife stadium is getting closer im finishing off the final mechanic and the one causing most trouble being blocking
The block negating dmg itself is working if i put the value in npcs but the value isnt changing in the player when triggered to by the server script so players cant block for some reason
Local script
local UIS = game:GetService("UserInputService")
local remote = script.Trigger
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
remote:FireServer("Block")
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
remote:FireServer("UnBlock")
end
end)
The local script triggers the remote event and either tells the server script to block or unblock depending on whether key is down or not
ServerScript
script.Parent.OnServerEvent:Connect(function(player, state)
local char = player.Character
local isBlocking = char.isBlocking
if state == "Block" then
isBlocking.Value = true
local anim = script.BlockAnim
local playAnim = char.Humanoid:LoadAnimation(anim)
playAnim:Play()
end
if state == "UnBlock" then
isBlocking.Value = false
end
end)
The server script then changed the players Blocking value in there character and plays an animation(Not made the animation yet)
Hope you can help
~Neptune
[EDIT:Right now im off studio so if you want to see the results itll be late tommorrow since i have school 0-0]