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
 

remotefunction error?

Previous Thread :: Next Thread 
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
17 Jun 2016 09:10 AM
23:16:52.299 - cannot resume non-suspended coroutine
23:16:52.299 - Script 'ServerScriptService.Server Handler', Line 12 - field ?
23:16:52.300 - Script 'ServerScriptService.Server Handler', Line 41
23:16:52.300 - Stack End
23:16:52.300 - cannot resume non-suspended coroutine
23:16:52.300 - Script 'Players.Player1.PlayerScripts.Framework', Line 24 - method fetch
23:16:52.301 - Script 'Players.Player1.PlayerScripts.Framework', Line 240
23:16:52.301 - Stack End

This is how the server handles functions:

function remoteFunction.OnServerInvoke(client,data)
return functions[data['FunctionType']](client,data)
end


and this is how the client sends requests:

local network = {}

function network:send(data)
print('okay2')
remoteEvent:FireServer(data)
end

function network:fetch(data)
return remoteFunction:InvokeServer(data)
end

local neck = network:fetch({['FunctionType'] = 'createNeck'})


And here are all the server side functions:

functions.LoadCharacter = function(Client,data)
Client:LoadCharacter()
return true
end

functions.SpawnCharacter = function(Client,data)
local spawnLoc = math.random(1,#game.Workspace.Spawns:GetChildren())
Client:LoadCharacter()
Client.Character.HumanoidRootPart.CFrame = game.Workspace.Spawns['Spawn'..spawnLoc].CFrame
return true
end

functions.createNeck = function(Client,data)
local neck = Instance.new("Motor6D", Client.Character:WaitForChild('Torso'))
neck.Part0 = Client.Character.Torso
neck.Part1 = Client.Character.Head
neck.C0 = CFrame.new(0, 1.5, 0)

if Client.Character.Torso.Neck then
Client.Character.Torso.Neck:Destroy()
neck.Name = "Neck"
end
print('Success 2')
return neck
end

functions.EquipTool = function(Client,data)

end



#code io.write('( ͡° ͜ʖ ͡°)')
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
17 Jun 2016 09:37 AM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=191372995
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