Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I don't know why my timestop script isn't working. Any ideas as to what the problem might be?

Asked by 3 years ago
--localscript
RS = game:GetService("ReplicatedStorage")
local InputService = game:GetService("UserInputService")
InputService.InputBegan:Connect(function(input)
    if script.Parent.Name == "defaultkid99" or script.Parent.isadmin.Value == true then
        if input.KeyCode == Enum.KeyCode.F and workspace.timestopped == false then
            RS.Abilities.timeevent:FireServer(script.Parent)
        elseif input.KeyCode == Enum.KeyCode.F and workspace.timestopped == true and workspace.timeowner == script.Parent then
            RS.Abilities.timecontinue:FireServer()
        end
    end
end)




--script
RS = game:GetService("ReplicatedStorage")
local ts = RS.Abilities.timeevent

ts.OnServerEvent:Connect(function(player)
    for i,v in next, workspace:GetDescendants() do
        if v:IsA("Part") or v:IsA("UnionOperation") or v:IsA("WedgePart") and v:DescendantOf(player) == false then
            if v.Anchored == false then 
                workspace.timestopped = true
                workspace.timeowner = player
                game.Lighting.timestopeffect.Enabled = true
                v.Anchored = true
                local vel = v.Velocity
                v.Velocity = Vector3.new(0,0,0)
                game.ReplicatedStorage.Abilities.timecontinue.OnServerEvent:Connect(function()
                    v.Anchored = false
                    v.Velocity = vel
                    game.Lighting.timestopeffect.Enabled = false
                end)
            end
        end
    end
end)

This is the full two scripts for that one person who said give full script when i did give full script.

0
You need to describe what you are doing more, we have no idea what the context is. Benbebop 1049 — 3y
0
i'm just trying to anchor everything in workspace that isnt anchored except for my character defaultkid99 4 — 3y

Answer this question