Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

time stop script stops player too ?

Edit: I've fixed the issue problem was it shoudnt be

mortals:IsA("Accessory")

it should be

mortals.Parent:IsA("Accessory")

when i stop the time it stops the player who stopped time Local Script

local UIS =game:GetService("UserInputService")
local jotaro= game:GetService("Players").LocalPlayer
UIS.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.V then
		game.ReplicatedStorage.timestopfunctions.TimeStopEvent:FireServer()
	end
end)

Server Script

local TS = game.ReplicatedStorage.timestopfunctions.TimeStopEvent
local InUse = game.ReplicatedStorage.timestopfunctions.InUse
local sound = game.Workspace.ZAWARUDO
local Table = {}


TS.OnServerEvent:Connect(function(player)
	local descandants = workspace:GetDescendants()
	if InUse.Value == false then
		
		InUse.Value = true
		sound:Play()
		wait(2)
		game.Lighting.TSeffect.Enabled = true
		for i= 1, #descandants do
			local mortals = descandants[i]
			if mortals:IsA("Part") or mortals:IsA("MeshPart") or mortals:IsA("BasePart") then
				if mortals.Anchored == false and mortals.Parent.Name ~= player.Name and mortals.Name ~= "Baseplate" and not mortals:IsA("Accessory") then
					mortals.Anchored = true
					table.insert(Table, mortals)
				end
			end
		end
	elseif InUse.Value == true then
		InUse.Value = false
		game.Lighting.TSeffect.Enabled = false
		for i=1, #Table do
			local mortals = Table[i]
			mortals.Anchored = false
		end
		Table.clear(Table)
	end
	
end)

Workspace Setup https://ibb.co/ChZzkPq

Video Evidence https://streamable.com/aex4ob

1 comment

0

ZA WARUDO, lol

1 answer

The answer is to check if any part is related to the Player who fired the function.

	local TS = game.ReplicatedStorage.timestopfunctions.TimeStopEvent
	local InUse = game.ReplicatedStorage.timestopfunctions.InUse
	local sound = game.Workspace.ZAWARUDO
	local Table = {}


	TS.OnServerEvent:Connect(function(player)
		local descandants = workspace:GetDescendants()
		if InUse.Value == false then

			InUse.Value = true
			sound:Play()
			wait(2)
			game.Lighting.TSeffect.Enabled = true
			for i= 1, #descandants do
			local mortals = descandants[i]
			if mortals.Parent.Name ~= player.Name and mortals.Parent.Parent.Name ~= player.Name then -- proceeds if it has nothing to do with the player
				if mortals:IsA("Part") or mortals:IsA("MeshPart") or mortals:IsA("BasePart") then
					if mortals.Anchored == false and mortals.Parent.Name ~= player.Name and mortals.Name ~= "Baseplate" and not mortals:IsA("Accessory") then
						mortals.Anchored = true
						table.insert(Table, mortals)
					end
					end
				end
			end
		elseif InUse.Value == true then
			InUse.Value = false
			game.Lighting.TSeffect.Enabled = false
			for i=1, #Table do
				local mortals = Table[i]
				mortals.Anchored = false
			end
			Table.clear(Table)
		end

	end)

This discussion is preserved as it was. New answers, comments, and votes are closed.