Hi, I hope i posted this in the right section since i dont know if its the script or something else.
Since im learning i took a model out of the roblox studio toolbox to learn.
So i have this part (with a script in it) in my project wich keeps duplicating himself in my workspace.
When i test the game, the part works as it should but it spawns duplicates on itself?
When i try to delete it, its coming back within a second. If i open the script window it closes itself. It seems i cant modify or delete this in any way. Is there something wrong with the script or is it a virus or maybe something else? Anybody has a thought on this one?
I have tried some virus remove plugins without results.
Since im a new user i cant upload a image. location of this part is workspace>part>script
local replicatedStorage = game:GetService("ReplicatedStorage")
script.Parent.Touched:Connect(function(hit)
if hit then
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
replicatedStorage:WaitForChild("TriggerCamA"):FireClient(player)
end
end
end
end)
thank you for your answer. So i looked it up and read about the debounce on the wiki. is it ment to be implented like below?
debounce=true
script.Parent.Touched:Connect(function(hit)
if debounce == true then
debounce = false -- prevents script to run event again.
local replicatedStorage = game:GetService("ReplicatedStorage")
script.Parent.Touched:Connect(function(hit)
if hit then
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
replicatedStorage:WaitForChild("TriggerCamA"):FireClient(player)
end
end
end
end)
debounce = true -- allows script to run event again.
end
end)
and if it is, how can i put the new script in? since its restoring itself to how it is right now. cant edit or delete the script at this point?
debounce=true
script.Parent.Touched:Connect(function(hit)
if debounce == true then
debounce = false -- prevents script to run event again.
local replicatedStorage = game:GetService("ReplicatedStorage")
script.Parent.Touched:Connect(function(hit)
if hit then
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
replicatedStorage:WaitForChild("TriggerCamA"):FireClient(player)
end
end
end
end)
wait (1)
debounce = true -- allows script to run event again.
end
end)
But the strange part is that i cant modify the part with the script in any way. it keeps duplicating and if i delete/modify the part (or script) it restores itself?
so lets say i dont want to use it anymore…how do i delete it?
You could try to find some script and remove/delete/disable them and see if it stops, and delete/modify the script which was causing that. If you can you can send us the place, and remove some scripts to prevent people stealing them.
workspace.Part.Script.Disabled=true or
workspace.Part.Script:Destroy()
it disabled the script but i cant do anything with the part… i think workspace.Part.Script:Destroy() is not correct aswell… if i delete this script the other script is back again… so it was only disabled
Maybe it’s a virus very very very hidden in a script, a backdoor or a plugin. Also, could you try to send us a screenshot/video? That might be useful!