Jump to content
Sign in to follow this  
eagledude4

Function not working?

Recommended Posts

Resolved, See Post #2 for solution

Edited by eagledude4

Share this post


Link to post
Share on other sites

It doesn't know what _Sel is. You spawn the code that add the actions. Any code spawned has only knowledge of its own local variables not that of other code, so the when your switch runs _Sel is nil.

UltRP_Actions = {
_Sel = _this select 0;
[] spawn {
	switch (_Sel) do {
		case "Add": {

You could pass it to spawn, however, in this case I don't see why the spawn at all - the function doesn't use any loops so no need really.

Share this post


Link to post
Share on other sites

Thanks, that did the trick. I wasn't really sure when the use of spawn was appropriate.

Edited by eagledude4

Share this post


Link to post
Share on other sites

The switch strings are case sensitive. Not sure I you already solved your issue. Anyhow, that caught me off a few times. Figured I'd bring it up.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×