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

I am trying to make a tazer and I keep on getting this error?

Asked by 5 years ago
Edited 5 years ago

"Workspace is not a valid member of workspace" Does anyone know how to fix this?

01script.Parent.Equipped:Connect(function(mouse)
02    mouse.Button1Down:Connect(function(plr)
03        local bullet = Instance.new("Part",workspace)
04        bullet.Transparency = 1
05        bullet.Position = script.Parent.Handle.Position
06        while true do wait(.01)
07            bullet.Touched:Connect(function(plr)
08                if plr.Parent:FindFirstChild("Humanoid") then
09                    if plr.Parent.Name == game.Workspace[script.Parent.Parent.Parent.Name].Name then
10                        wait(.1)
11                    else
12                        plr.Parent.Humanoid.PlatformStand = true
13                        wait(5)
14                        plr.Parent.Humanoid.PlatformStand = false
15                    end
View all 24 lines...

edit: nvm I found the solution

01script.Parent.Equipped:Connect(function(mouse)
02    mouse.Button1Down:Connect(function(plr)
03        local player = game.Players.LocalPlayer.Name
04        local bullet = Instance.new("Part",workspace)
05        bullet.Transparency = 0
06        bullet.Position = workspace[player].Torso.Position
07        while true do wait(.01)
08            bullet.Position = Vector3.new(bullet.Position.X + 1,bullet.Position.Y,bullet.Position.Z)
09            bullet.Touched:Connect(function(plr)
10                if plr.Parent:FindFirstChild("Humanoid") then
11                    if plr.Parent.Name == game.Workspace[player].Name then
12                        wait(.1)
13                    else
14                        plr.Parent.Humanoid.PlatformStand = true
15                        wait(5)
View all 26 lines...
0
Please find which line it says, if it says it in the error code. ghxstlvty 133 — 5y

Answer this question