Project1

标题: 我又来求助了,简单的脚本问题 [打印本页]

作者: 笹舟丶萚    时间: 2018-7-17 13:39
标题: 我又来求助了,简单的脚本问题
  1. p = rand(12) + 1
  2. p p
  3.   if p =1
  4.   @MNSHPTT == "001-Blind01"
  5.   Graphics.transition(2, "Graphics/Transitions/001-Blind01")
  6.   end
  7.   if p = 2
  8.   @MNSHPTT== "002-Blind02"
  9.   Graphics.transition(2, "Graphics/Transitions/002-Blind02")
  10.   end
  11.   if p = 3
  12.   @MNSHPTT== "003-Blind03"
  13.   Graphics.transition(2, "Graphics/Transitions/003-Blind03")
  14.   end
  15.   if p = 4
  16.   @MNSHPTT== "004-Blind04"
  17.   Graphics.transition(2, "Graphics/Transitions/004-Blind04")
  18.   end
  19.   if p = 5
  20.   @MNSHPTT== "005-Stripe01"
  21.   Graphics.transition(2, "Graphics/Transitions/005-Stripe01")
  22.   end
  23.   if p = 6
  24.   @MNSHPTT== "006-Stripe02"
  25.   Graphics.transition(2, "Graphics/Transitions/006-Stripe02")
  26.   end
  27.   if p = 7
  28.   @MNSHPTT== "007-Line01"
  29.   Graphics.transition(2, "Graphics/Transitions/007-Line01")
  30.   end
  31.   if p = 8
  32.   @MNSHPTT== "008-Line02"
  33.   Graphics.transition(2, "Graphics/Transitions/008-Line02")
  34.   end
  35.   if p = 9
  36.   @MNSHPTT== "009-Random01"
  37.     Graphics.transition(2, "Graphics/Transitions/009-Random01")
  38.   end
  39.   if p =10
  40.   @MNSHPTT== "010-Random02"
  41.   Graphics.transition(2, "Graphics/Transitions/010-Random02")
  42.   end
  43.   if p = 11
  44.   @MNSHPTT== "011-Random03"  
  45.   Graphics.transition(2, "Graphics/Transitions/011-Random03")
  46.   end
  47.   if p = 12
  48.   @MNSHPTT== "012-Random04"  
  49.   Graphics.transition(2, "Graphics/Transitions/012-Random04")
  50. end
  51. p p
  52. p @MNSHPTT
复制代码

如题,第一次输出p是随机值,第二次输出p一定为12,为什么啊。还有最后输出@MHSHPTT是nil,为什么呢
作者: soulsaga    时间: 2018-7-17 13:54
变量代入是用=
不是==
等於是==不是=
你用错了..
作者: 阮声悠悠    时间: 2018-7-17 14:17
if p =1、if p =2。。。这些都改成if p ==1、if p ==2
@MNSHPTT== "011-Random03"  都改成   @MNSHPTT= "011-Random03"  




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1