Still broken effects

sorry for posting this a lot but its still not solved and so far nothing ive tried works

Im making an effects system but for some reason i have a thing that when touched gives you an effect if you don’t have it but for some reason it only gives the effect once then breaks.

local BloodP = script.Parent.BloodP
BloodP.CFrame = script.Parent.CFrame * CFrame.new(0, 2, 0)
BloodP.Touched:Connect(function(hit)
	if hit.Name == "HumanoidRootPart" then
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		if player then
			local buffs = player.PlayerGui.ScreenGui["Buffs/Debuffs"]
			print(player)
			local found = buffs:FindFirstChild("Frozen")
			print(found)

			if not found then
				print("no frozen")
				local Poison = game.ReplicatedStorage["Buff/Debuff"]:Clone()
				Poison.Parent = buffs
				Poison.Name = "Frozen"
				Poison.BDtext.Text = "Frozen"
				Poison.time.Value = 5
				Poison.amount.Value = 1
			else
				print("Frozen")
			end
		end
	end
end)

(yes its frozen now)
I tested it with prints and for some reason it keeps running but when the effect goes away and deletes itself the code still thinks that player has the effect. this is in a server script if that changes anything.

1 Like

Do you delete the effect on the server or the client ? And also i recommended setting the parent of the clone after setting the properties.

on the client, the server adds the effect then the effect deletes itself.

If the effect is getting destroyed on the client, then the server doesn’t detect that change because that’s on the client. This is the reason that the server still thinks you have the effect

1 Like

this worked thx, it may give me some troubles due to having to do this on the server but at least it works.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.