So I went in and made edits to my original scripts based off of your game, I still get this:
It makes me wonder if it has something to do with the script that includes the chances. I’ll put in all four updated scripts.
Local Script (StarterPlayerScripts)
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local CollectionService = game:GetService("CollectionService")
local virusremote = game.ReplicatedStorage.VirusRemote
wait(10)
while true do
local newRandom
local oldRandom = newRandom
local chosenDisease
local oldchosenDisease= chosenDisease
if TuberOn == true then
for count = 1, 60 do
wait(1)
Character.Humanoid.Health = Character.Humanoid.Health - 1
Character.Humanoid.WalkSpeed = Character.Humanoid.WalkSpeed - .1
end
TuberOn = false
elseif FluOn == true then
for count = 1, 300 do
wait(1)
Character.Humanoid.Health = Character.Humanoid.Health - .1
Character.Humanoid.WalkSpeed = Character.Humanoid.WalkSpeed - .005
end
FluOn = false
elseif ColdOn == true then
CollectionService:AddTag(Character.Humanoid, "Cold")
for count = 1, 30 do
wait(16)
end
ColdOn = false
CollectionService:RemoveTag(Character.Humanoid, "Cold")
end
do repeat
newRandom = math.random(20, 30)
wait()
until
newRandom ~= oldRandom
end
do repeat
chosenDisease = math.random(0, 100)
wait()
until
chosenDisease ~= oldchosenDisease
end
wait(newRandom)
print(chosenDisease)
TuberOn = false
FluOn = false
ColdOn = false
if chosenDisease >= 90 then
print("Tuberculosis!")
TuberOn = true
elseif chosenDisease >= 85 then
print("Flu!")
FluOn = true
elseif chosenDisease >= 0 then
print("Cold!")
ColdOn = true
elseif chosenDisease >= 0 then
print("None!")
end
end
Local Script (Tool)
local tool = script.Parent
local player = game.Players.LocalPlayer
local Debounce = true
local virusremote = game.ReplicatedStorage.VirusRemote
local player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
tool.Handle.Touched:Connect(function(hit)
Debounce = false
virusremote:FireServer("Cold", hit.player.Character)
print("firedcold")
wait(1)
Debounce = true
end)
end)
Server Script (ServerScriptService)
local virusremote = game.ReplicatedStorage.VirusRemote
local virusbindable = game.ReplicatedStorage.VirusBindable
local collectionservice = game:GetService("CollectionService")
virusremote.OnServerEvent:Connect(function(originalplr,disease,infectedplr)
print(infectedplr.Name)
virusbindable:Fire(disease,infectedplr)
collectionservice:AddTag(infectedplr,disease)
end)
Server Script (ServerScriptService)
(Handler)
local collectionservice = game:GetService("CollectionService")
local virusbindable = game.ReplicatedStorage.VirusBindable
virusbindable.Event:Connect(function(disease,plr)
print(plr.Name)
if disease == "Cold" then
if disease == "Cold" then
-- local Cough1Copy = game.ReplicatedStorage.Cough1:Clone()
-- Cough1Copy.Parent = plr.Head
-- local Cough2Copy = game.ReplicatedStorage.Cough2:Clone()
-- Cough2Copy.Parent = plr.Head
print("GotCold!")
wait(8)
print(plr.Parent.Name)
-- Cough1Copy:Play()
plr.Humanoid.WalkSpeed = plr.Humanoid.WalkSpeed - .4
wait(8)
-- Cough2Copy:Play()
end
if disease == "remove disease" then
collectionservice:RemoveTag(plr,collectionservice:GetTags(plr))
end
end
if disease == "remove disease" then
collectionservice:RemoveTag(plr,collectionservice:GetTags(plr))
end
end)