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 » Scripting Helpers
Home Search
 

Re: Need help fixing a script for a monster in my RPG (ASAP)

Previous Thread :: Next Thread 
haribo686 is not online. haribo686
Joined: 21 Aug 2008
Total Posts: 36
01 Jan 2013 06:48 PM
In my RPG the monsters dont seem to be moving and I cant seem to be able to fix the script, could someone try and help me and correct it so he will move agian because in game it just stands still and dosent move.

If you need the model to see what other parts are in the monster to make sure I havent done anything else wrong you can get the model here: http://www.roblox.com/RPG-Monster-Needs-Fixing-ASAP-item?id=102426158

Script:
wait()
level=script.Parent.Level.Value
script.Parent.After.Value=""
script.Parent.TakeDamage.Value=0
drops={{"Coins1","C"},{"Coins5","UC"},{"Coins10","R"}}
dropItems={}
function addChance(item,times)
for j=1, times do
table.insert(dropItems,item)
end
end

for i=1, #drops do
if drops[i][2]=="C" then
addChance(drops[i][1],4)
end
if drops[i][2]=="UC" then
addChance(drops[i][1],3)
end
if drops[i][2]=="R" then
addChance(drops[i][1],2)
end
end



hp=40+(level*15)
backup=script.Parent:clone()
m=script.Parent.Monster
m.MaxHealth=hp
m.Health=hp
script.Parent.Name=script.Parent.Name.." - Level "..tostring(level)
after=script.Parent.After
take=true
deal=true
origin=Instance.new("Part")
origin.Transparency=1
origin.Size=Vector3.new(1,1,1)
origin.CanCollide=false
origin.Anchored=true
origin.Position=script.Parent.Torso.Position
origin.Parent=script.Parent
function touch(hit)
if hit.Parent==nil then return end
if hit.Parent.Name==after.Value and deal then
hit.Parent.Humanoid:TakeDamage(script.Parent.Damage.Value)
deal=false
time=0
wait(2)
deal=true
end
end
a=script.Parent:GetChildren()
for i=1, #a do
if a[i].className=="Part" then
a[i].Touched:connect(touch)
end
end
taken=script.Parent.TakeDamage
timer=30
time=0
function take()
amount=taken.Value
if amount==0 then return end
m:TakeDamage(amount)
time=0
taken.Value=0
end
taken.Changed:connect(take)

while m.Health>0 do
wait()
if after.Value~="" then
char=workspace:FindFirstChild(after.Value)
if char~=nil then
m:MoveTo(char.Torso.Position,char.Torso)
wait(1)
time=time+1
print(time)
if time>timer or char.Humanoid.Health==0 then
time=0
after.Value=""
m:MoveTo(origin.Position,origin)
end
else
after.Value=""
end
else

m:MoveTo(origin.Position,origin)
end

end
print(script.Parent.Name.." has died")
player=game.Players:FindFirstChild(after.Value)
if player~=nil then
xp=player.stats.Combat.XP
xp.Value=xp.Value+(level*3)

end

pos=script.Parent.Torso.Position
wait(1.5)
a=script.Parent:GetChildren()
for i=1, #a do if a[i].className=="Part" then a[i]:Remove() end end
itemName=dropItems[math.random(1,#dropItems)]
item=game.Lighting.Drops:FindFirstChild(itemName):clone()
item.Parent=script.Parent
item:MoveTo(pos)
if player~=nil then
item.For.Value=player.Name
end
wait(9)
backup.Parent=script.Parent.Parent
backup:MakeJoints()
script.Parent:Remove()












Report Abuse
bvhv is not online. bvhv
Joined: 15 Feb 2009
Total Posts: 192
01 Jan 2013 07:12 PM
Upon opening a little test server I Noticed you cant even push him but even after moving him in the server He wouldn't move I will give you more information on what i discover after looking at the script.
P.S. I'm barely a begginer scripter so please don't get mad at me if i cant find the problem >.<
Report Abuse
haribo686 is not online. haribo686
Joined: 21 Aug 2008
Total Posts: 36
01 Jan 2013 07:18 PM
Ok thank you.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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