Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Problem with dance script


ryono
 Share

Recommended Posts

hey guys, I decided to make a dance script. however, I have come to the foul conclusion, that it does not work. and there is no error message. heres how u install it.

put this at bottom of main.txt:
```
sub dance(index, speed)
dim dir
dim playerx
dim playery
dim dancephase
dim dancecount
dim num1
dim num2

dir = getplayerdir(index)
playerx = getplayerx(index)
playery = getplayery(index)
num1 = cint(getvar("DanceCount.ini", "TIMES", getplayername(index)))
num2 = cint(getvar("DanceCount.ini", "COMPLETE", getplayername(index)))
call putvar("DanceCount.ini", "TIMES", getplayername(index), "0")
call putvar("DanceCount.ini", "LOOP", getplayername(index), "0")
call putvar("DanceCount.ini", "PHASE", getplayername(index), "1")
call putvar("DanceCount.ini", "COMPLETE", getplayername(index), "0")

call playermsg(index, "You begin dancing!", white)

do while getvar("DanceCount.ini", "COMPLETE", getplayername(index)) <= 10
do while getvar("DanceCount.ini", "PHASE", getplayername(index)) = 1
do while getvar("DanceCount.ini", "TIMES", getplayername(index)) <= 10
select case dir
case 0
call setplayerdir(index, 1)
case 1
call setplayerdir(index, 2)
case 2
call setplayerdir(index, 3)
case 3
call setplayerdir(index, 0)
end select
if getvar("DanceCount.ini", "LOOP", getplayername(index)) = 0 then
call settimer("DanceDelay " & index, speed)
call putvar("DanceCount.ini", "LOOP", getplayername(index), "1")
end if
call putvar("DanceCount.ini", "TIMES", getplayername(index), cstr(num1 + 1))
loop
call putvar("DanceCount.ini", "LOOP", getplayername(index), "0")
call putvar("DanceCount.ini", "TIMES", getplayername(index), "0")
call putvar("DanceCount.ini", "PHASE", getplayername(index), "2")
loop

do while getvar("DanceCount.ini", "PHASE", getplayername(index)) = 2
do while getvar("DanceCount.ini", "TIMES", getplayername(index)) < 1
select case dir
case 0
call setplayerdir(index, 1)
case 1
call setplayerdir(index, 2)
case 2
call setplayerdir(index, 3)
case 3
call setplayerdir(index, 0)
end select
if getvar("DanceCount.ini", "LOOP", getplayername(index)) = 0 then
call settimer("DanceDelay " & index, speed)
call putvar("DanceCount.ini", "LOOP", getplayername(index), "1")
end if
call putvar("DanceCount.ini", "TIMES", getplayername(index), cstr(num1 + 1))
loop
call putvar("DanceCount.ini", "LOOP", getplayername(index), "0")
call putvar("DanceCount.ini", "TIMES", getplayername(index), "0")

do while getvar("DanceCount.ini", "TIMES", getplayername(index)) < 1
select case dir
case 0
call setplayery(index, playery - 1)
case 1
call setplayery(index, playery + 1)
case 2
call setplayerx(index, playerx - 1)
case 3
call setplayerx(index, playerx + 1)
end select
if getvar("DanceCount.ini", "LOOP", getplayername(index)) = 0 then
call settimer("DanceDelay " & index, speed)
call putvar("DanceCount.ini", "LOOP", getplayername(index), "1")
end if
call putvar("DanceCount.ini", "TIMES", getplayername(index), cstr(num1 + 1))
loop
call putvar("DanceCount.ini", "LOOP", getplayername(index), "0")
call putvar("DanceCount.ini", "TIMES", getplayername(index), "0")

do while getvar("DanceCount.ini", "TIMES", getplayername(index)) < 1
select case dir
case 0
call setplayery(index, playery + 1)
case 1
call setplayery(index, playery - 1)
case 2
call setplayerx(index, playerx + 1)
case 3
call setplayerx(index, playerx - 1)
end select
if getvar("DanceCount.ini", "LOOP", getplayername(index)) = 0 then
call settimer("DanceDelay " & index, speed)
call putvar("DanceCount.ini", "LOOP", getplayername(index), "1")
end if
call putvar("DanceCount.ini", "TIMES", getplayername(index), cstr(num1 + 1))
loop
call putvar("DanceCount.ini", "LOOP", getplayername(index), "0")
call putvar("DanceCount.ini", "TIMES", getplayername(index), "0")
call putvar("DanceCount.ini", "PHASE", getplayername(index), "1")
loop
call putvar("DanceCount.ini", "COMPLETE", getplayername(index), cstr(num2 + 1))
loop
end sub

```
edit: I forgot the timer sub so also add this in your main.txt:
```
sub dancedelay(index)
call putvar("DanceCount.ini", "TIMES", getplayername(index), cstr(num1 + 1))
call putvar("DanceCount.ini", "LOOP", getplayername(index), "0")
end sub
```
then make a .ini called "DanceCount.ini" and put this in it:
```
[TIMES]
[LOOP]
[PHASE]
[COMPLETE]
```
then u can call it like this:
```
call dance(index, speed)
```index - the index number of player
speed - the speed at which the player dances. The lower the faster.In miliseconds.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...