generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: error

Previous Thread :: Next Thread 
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
17 Mar 2017 02:27 AM
what did i do wrong?
Players.Player1.Backpack.Smg.LocalScript:8: 'then' expected near '='



local tool = script.Parent
local player = game:GetService("Players").LocalPlayer

tool.Equipped:connect(function(mouse)
print("Tool equipped!")
mouse.Button1Down:connect(function()
IsShooting = true
if IsShooting = true then
repeat until IsShooting == false
print("Mouse pressed!")
local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * 100)----Range
local part, position = workspace:FindPartOnRay(ray, player.Character, false, true)
script.Parent.Handle.Sound:Play()
local beam = Instance.new("Part", workspace)
beam.BrickColor = BrickColor.new("New Yeller")
beam.FormFactor = "Custom"
beam.Material = "Neon"
beam.Transparency = 0.25
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
beam.Name = "beam"

local distance = (tool.Handle.CFrame.p - position).magnitude
beam.Size = Vector3.new(0.3, 0.3, distance)
beam.CFrame = CFrame.new(tool.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)

game:GetService("Debris"):AddItem(beam, 0.1)

if part then
local humanoid = part.Parent:FindFirstChild("Zombie")

if not humanoid then
humanoid = part.Parent.Parent:FindFirstChild("Zombie")
end

if humanoid then
humanoid:TakeDamage(15)
end
end
end
mouse.Button1Up:(function(mouse)
IsShooting == false
end)
end)
end)


Report Abuse
kylerzong is not online. kylerzong
Joined: 06 Aug 2011
Total Posts: 659
17 Mar 2017 02:28 AM
if IsShooting = true then


needs to be

if IsShooting == true then
Report Abuse
Bit_blox is not online. Bit_blox
Joined: 28 Aug 2016
Total Posts: 974
17 Mar 2017 02:30 AM
when you are comparing variables with an if statement, you must ALWAYS use two equal signs.

i.e. if humanoid.Health == 0 then return end


OR

i.e if not humanoid.Health == 0 then
print('Humanoid isnt dead')
end

either way you need doubles



- Hello world -
Report Abuse
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
17 Mar 2017 03:14 AM
Players.Player1.Backpack.Smg.LocalScript:42: 'name' expected near '('

this error now
Report Abuse
kylerzong is not online. kylerzong
Joined: 06 Aug 2011
Total Posts: 659
17 Mar 2017 01:18 PM
What line is that
Report Abuse
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
17 Mar 2017 01:40 PM
42
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
17 Mar 2017 01:41 PM
http://wiki.roblox.com/index.php?title=RBXScriptSignal#Methods


Report Abuse
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
17 Mar 2017 01:58 PM
will read up on it
Report Abuse
Vincenzo_Costello is not online. Vincenzo_Costello
Joined: 09 Jul 2010
Total Posts: 615
17 Mar 2017 02:10 PM
seeing that everyone is too lazy to read;

mouse.Button1Up:(function(mouse)
IsShooting == false
end)

Setting a variable needs to be a single equal sign, not dual.

== is comparing.

mouse.Button1Up:(function(mouse)
IsShooting = false
end)
Report Abuse
Vincenzo_Costello is not online. Vincenzo_Costello
Joined: 09 Jul 2010
Total Posts: 615
17 Mar 2017 02:11 PM
forgot to add one thing;

you forgot to connect the event.

mouse.Button1Up:connect(function(mouse)
IsShooting = false
end)
Report Abuse
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
17 Mar 2017 03:10 PM
Players.Player1.Backpack.testt.LocalScript:38: unexpected symbol near '='
it does this


local tool = script.Parent
local player = game:GetService("Players").LocalPlayer

tool.Equipped:connect(function(mouse)
print("Tool equipped!")
mouse.Button1Up:connect(function(mouse)
IsShooting = false
print("Mouse pressed!")
local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * 100)----Range
local part, position = workspace:FindPartOnRay(ray, player.Character, false, true)
script.Parent.Handle.Sound:Play()
local beam = Instance.new("Part", workspace)
beam.BrickColor = BrickColor.new("New Yeller")
beam.FormFactor = "Custom"
beam.Material = "Neon"
beam.Transparency = 0.25
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
beam.Name = "beam"

local distance = (tool.Handle.CFrame.p - position).magnitude
beam.Size = Vector3.new(0.3, 0.3, distance)
beam.CFrame = CFrame.new(tool.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)

game:GetService("Debris"):AddItem(beam, 0.1)

if part then
local humanoid = part.Parent:FindFirstChild("Zombie")

if not humanoid then
humanoid = part.Parent.Parent:FindFirstChild("Zombie")
end

if humanoid then
humanoid:TakeDamage(15)
repeat until
IsShooting = true
tool.Deactivated:connect(function(mouse)
IsShooting = true
end)
end)
end
end
end)
end)
Report Abuse
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
17 Mar 2017 03:12 PM
Players.Player1.Backpack.testt.LocalScript:9: attempt to index local 'mouse' (a nil value)
Now this one

local tool = script.Parent
local player = game:GetService("Players").LocalPlayer

tool.Equipped:connect(function(mouse)
print("Tool equipped!")
mouse.Button1Up:connect(function(mouse)
IsShooting = false
print("Mouse pressed!")
local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * 100)----Range
local part, position = workspace:FindPartOnRay(ray, player.Character, false, true)
script.Parent.Handle.Sound:Play()
local beam = Instance.new("Part", workspace)
beam.BrickColor = BrickColor.new("New Yeller")
beam.FormFactor = "Custom"
beam.Material = "Neon"
beam.Transparency = 0.25
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
beam.Name = "beam"

local distance = (tool.Handle.CFrame.p - position).magnitude
beam.Size = Vector3.new(0.3, 0.3, distance)
beam.CFrame = CFrame.new(tool.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)

game:GetService("Debris"):AddItem(beam, 0.1)

if part then
local humanoid = part.Parent:FindFirstChild("Zombie")

if not humanoid then
humanoid = part.Parent.Parent:FindFirstChild("Zombie")
end

if humanoid then
humanoid:TakeDamage(15)
repeat until
IsShooting == true
tool.Deactivated:connect(function(mouse)
IsShooting = true
end)
end
end
end)
end)
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
17 Mar 2017 03:13 PM
local player = game.Players.LocalPlayer:GetMouse()
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
17 Mar 2017 03:14 PM
Ops i meant this:
local Mouse = player:GetMouse()
Report Abuse
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
17 Mar 2017 03:21 PM
Players.Player1.Backpack.testt.LocalScript:9: attempt to index local 'mouse' (a nil value)
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
17 Mar 2017 03:24 PM
mouse is non exsistant you're attempting to index a mouse that doesnt exist drop a line under player and do this:
local mouse = player:GetMouse()
Report Abuse
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
17 Mar 2017 03:53 PM
Players.Player1.Backpack.testt.LocalScript:37: ')' expected (to close '(' at line 36) near 'repeat'


local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
tool.Equipped:connect(function(mouse)
print("Tool equipped!")
mouse.Button1Up:connect(function(mouse)
IsShooting = false
print("Mouse pressed!")
local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * 100)----Range
local part, position = workspace:FindPartOnRay(ray, player.Character, false, true)
script.Parent.Handle.Sound:Play()
local beam = Instance.new("Part", workspace)
beam.BrickColor = BrickColor.new("New Yeller")
beam.FormFactor = "Custom"
beam.Material = "Neon"
beam.Transparency = 0.25
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
beam.Name = "beam"

local distance = (tool.Handle.CFrame.p - position).magnitude
beam.Size = Vector3.new(0.3, 0.3, distance)
beam.CFrame = CFrame.new(tool.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)

game:GetService("Debris"):AddItem(beam, 0.1)

if part then
local humanoid = part.Parent:FindFirstChild("Zombie")

if not humanoid then
humanoid = part.Parent.Parent:FindFirstChild("Zombie")
end

if humanoid then
humanoid:TakeDamage(15
repeat until
IsShooting = true
tool.Deactivated:connect(function(mouse)
IsShooting = true
end)
end)
end
end
end)
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image