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
 

Why am I getting this error?

Previous Thread :: Next Thread 
johnjohncar is not online. johnjohncar
Joined: 22 Aug 2012
Total Posts: 3557
07 Sep 2015 11:19 AM
12:18:11.962 - Workspace.Recieve:3: attempt to concatenate field '?' (a nil value)
12:18:11.963 - Stack Begin
12:18:11.964 - Script 'Workspace.Recieve', Line 3
12:18:11.965 - Stack End

script:WaitForChild("CallServer")
script.CallServer.OnClientEvent:connect(function(player, arguments)
local k = script.Parent.Parent.Kart
local s = script.Parent.Parent.StartPosition
game.Workspace.Data:FireServer(k.Value)
game.Workspace.Data:FireServer(s.Value)
end)


event2 = game.Workspace.Data
event2.OnServerEvent:connect(function(player, arguments)
print(player.Name .. " says " .. arguments[1])
print(player.Name .. " says " .. arguments[2])
end)



I am special because I have a siggy (👌 ͡° ͜ʖ ͡°👏)
Report Abuse
Saldor010 is not online. Saldor010
Joined: 20 Sep 2010
Total Posts: 1035
07 Sep 2015 11:27 AM
It's throwing that error because arguments[1] is a nil value, and does not exist. Try adding an if statement in front of your print's to check before you try and concatenate any potential nil values. For example:

event2 = game.Workspace.Data
event2.OnServerEvent:connect(function(player, arguments)
if arguments[1] and arguments[2] then
print(player.Name .. " says " .. arguments[1])
print(player.Name .. " says " .. arguments[2])
else
print("Hey, your arguments don't exist!!")
end
end)
Report Abuse
johnjohncar is not online. johnjohncar
Joined: 22 Aug 2012
Total Posts: 3557
07 Sep 2015 11:30 AM
Nvm I got it to work by myself sorry for wasting your time. I just put both values in a table ({k.Value, s.Value})



I am special because I have a siggy (👌 ͡° ͜ʖ ͡°👏)
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