ive been wanting to make where when someone gets touched by something it will put a colorcorrection on their screen; but it is not working for me… this is my code
server:
hitbox.Touched:Connect(function(Hit)
if Hit.Parent ~= Character and Hit.Parent ~= Stand then
local enemyplayer = players:GetPlayerFromCharacter(Hit.Parent)
print(enemyplayer)
blodlustremote:FireClient(enemyplayer)
end
client:
blodlustremote.OnClientEvent:Connect(function(enemyPlayer)
print("joe mama fatst")
local bloodcolor = game.Lighting.Bleeding
if enemyPlayer then
bloodcolor.Enabled = true
end
print("recieved the thing")
wait(blodcd)
print("waited")
bloodcolor.Enabled = false
end)
please tell me how to make my code work or give me a better method
You could just get a screen gui, insert a text image, change the image id to something white, and when they get hit turn the transparency to 0.8 or something.
hitbox.Touched:Connect(function(Hit)
if Hit.Parent ~= Character and Hit.Parent ~= Stand then
local enemyplayer = players:GetPlayerFromCharacter(Hit.Parent)
print(enemyplayer)
if enemyplayer then
blodlustremote:FireClient(enemyplayer)
end
end
no that ruins my whole game. i need a script to fix it also that would literally change nothing, dont get me started with scripts dont run there; because all my other moves work. its not the parenting thats wrong
uhm… the entire client script is really unrelated and it handles a whole entire 6 moves, with 575 lines of code. here is the parts that matter:
local rp = game.ReplicatedStorage
local remotes = rp.Remotes
local blodlustremote = remotes.TheWorld.Bloodlust
local blooddeb = false
local blodcd = 5.3
function blodfro()
if thang.Value > 0 then
if Character:FindFirstChild("TheWorld") then
if canattack == true then
blodlustremote:FireServer()
end
end
end
end
UIS.InputBegan:Connect(function(input,IsTyping)
if IsTyping then
return
elseif input.KeyCode == Enum.KeyCode.H then
if Player.Character:FindFirstChild("TheWorld") then
if not Character.Humanoid:FindFirstChild("CantAttack") then
blodfro()
end
end
end
end)
blodlustremote.OnClientEvent:Connect(function()
print("joe mama fatst")
local bloodcolor = game.Lighting.Bleeding
bloodcolor.Enabled = true
print("recieved the thing")
wait(blodcd)
print("waited")
bloodcolor.Enabled = false
end)