Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 05-31-2016, 10:33 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 26,181
NobodysHero is on a distinguished road
Default

THANK YOU THANK YOU THANK YOU!!!!

I did have to tweak it a little bit and I'm really surprised I got it working. x.x I'm horrible with PHP (Inexperienced and dyslexic), but for those who want this for their site, this is the code that worked for me. Don't forget to replace my pet types with your own!

PHP Code:
function items_random($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$random rand(1,9); 
                    if(
$random >= && $random <= 3){
                    
$newtype = ('Chestnut Unicorn');
                    }
                    elseif(
$random >= && $random <= 6){
                    
$newtype = ('Sienna Kirin');
                    }
                    elseif(
$random >= && $random <= 9){
                    
$newtype = ('Piebald Kirin');
                    }
  
$mysidia->db->update("owned_adoptables", array("type" => $newtype), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
  
$note "The {$item->itemname} has been successfully used on your pet, it is now an {$newtype}!<br>";
  
//Update item quantity...
  
$delitem $item->remove(); 
  return 
$note;

Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:32 PM.

Currently Active Users: 3108 (0 members and 3108 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636