User:Outofspace/Gus-Bot: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Outofspace
>Outofspace
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<br>[http://www.roblox.com/Item.aspx?ID=499790 Gus 3.3]
This is a script I'm working on. Feel free to use it and modify it.
This is a script I'm working on. Feel free to use it and modify it.


Line 6: Line 8:


*Follows you around.
*Follows you around.
*Heals others on touch.
*Heals itself.
*Sparkle commands ("sparkles/on" or "sparkles/off")


== Future Plans ==
== Future Plans ==


*Improving Healing others on touch.
*Improving Healing itself
*Improving Healing itself
*Add/Fix add sparkle command.
*Ability to shoot rockets (via command).
*Self Destruct; Self Remove.
*More customability.
*Ability to shoot rockets.


== Script ==
== Script ==
Line 20: Line 23:
--[[
--[[
       By outofspace
       By outofspace
       Revision 2.75b
       Revision 3.3
--]]
--]]


local sss = Instance.new("Script")
----
sss.Parent = game.Workspace
----
sss.Name = "RemoveOldGus"
 
sss.Source =[[
local BotName = "Gus" --Put your pets name here.
local UserName = "outofspace" --Replace with your username!
cc = true --Can gus collide with other objects?
 
----
----
----Gus controls.
----
----
 
local has = Instance.new("Hint")
has.Parent = game.Workspace
has.Text = "Creating gus..."


c = game.Workspace:GetChildren()
c = game.Workspace:GetChildren()


for i=1,#c do
for i=1,#c do
if c[i].Name == "Gus" then c[i]:Remove() end
if c[i].Name == BotName and c[i].className == "Model" then  
c[i]:Remove()  
end
end
end


wait(1)
script.Name = "GusScript"
 
local m = Instance.new("Model")
script:Remove()
m.Name = BotName
 
]]


sssa = sss:clone()
sss:Remove()
sssa.Parent = game.Workspace


BotName = "Gus" --Put your pets name here.
UserName = game.Workspace.outofspace.Head --Replace outofspace with your name.
----
----
----
----
script.Name = "GusScript"
local m = Instance.new("Model")
m.Name = "Gus"
m.Parent = game.Workspace
m.Parent = game.Workspace
local ma = Instance.new("Model")
local ma = Instance.new("Model")
ma.Parent = game.Workspace.Gus
ma.Parent = m
ma.Name = "SETTINGS"
ma.Name = "SETTINGS"
local sva = Instance.new("StringValue")
local sva = Instance.new("StringValue")
sva.Name = "NameBot"
sva.Name = "NameBot"
sva.Parent = game.Workspace.Gus.SETTINGS
sva.Parent = m.SETTINGS
sva.Value = BotName
sva.Value = BotName
local svb = Instance.new("StringValue")
local svb = Instance.new("StringValue")
svb.Name = "NameUser"
svb.Name = "NameUser"
svb.Parent = game.Workspace.Gus.SETTINGS
svb.Parent = m.SETTINGS
svb.Value = "For future Features"
svb.Value = UserName
 
local b = Instance.new("Part")  
local b = Instance.new("Part")  
b.Parent = game.Workspace.Gus
b.Parent = m
b.Locked = true
b.Locked = true
b.Name = "Head"
b.Name = "Head"
b.Position = Vector3.new(-14.5, 103, -10)
b.Position = Vector3.new(-14.5, 103, -10)
b.CanCollide = true
b.CanCollide = cc
 
local rp = Instance.new("RocketPropulsion")
local rp = Instance.new("RocketPropulsion")
rp.Parent = game.Workspace.Gus.Head
rp.Parent = m.Head
rp.Name = "RP"
rp.Name = "RP"
local h = Instance.new("Humanoid")
local h = Instance.new("Humanoid")
h.Parent = game.Workspace.Gus
h.Parent = m


local bav = Instance.new("BodyAngularVelocity")
bav.Parent = m.Head
bav.angularvelocity = Vector3.new(0, 0, 3)
--[[
--[[


Line 83: Line 94:
--]]
--]]


local sa = Instance.new("Script") --creates a self healing script. (for gus)
local sa = Instance.new("Script")
sa.Parent = game.Workspace.Gus
sa.Parent = m
 
sa.Source =[[
sa.Source =[[
function waitForChild(parent, childName)
function waitForChild(parent, childName)
Line 119: Line 131:
sad.Parent = game.Workspace.Gus --Replaces the old script
sad.Parent = game.Workspace.Gus --Replaces the old script
sad.Name = "HealingScript"
sad.Name = "HealingScript"
local bav = Instance.new("BodyAngularVelocity")
bav.Parent = game.Workspace.Gus.Head


--[[
local sb = Instance.new("Script") --Touch to heal script.
sb.Parent = m.Head
 
sb.Source =[[
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid") -- Find Humanoids in whatever touched this
if (h ~=nil) then -- If there is a Humanoid then
      h.Health = h.MaxHealth -- Set the health to maximum (full healing)
end
end
 
script.Parent.Touched:connect(onTouched) -- Make it call onTouched when touched
]]
 
sbd = sb:clone()
sb:Remove()
sbd.Parent = m.Head
sbd.Name = "Touch-to-Heal"
 
--game.Workspace.Gus.Name = game.Workspace.Gus.SETTINGS.NameBot.Value --Sets name
 
ty = game.Workspace:findFirstChild(""..UserName.."")
 
if (ty ~= nil) then
 
m.Head.RP.Target = ty.Head
 
else
 
m:Remove()
 
end
 
has.Text = "Done!"


Rocket Propulsion
wait(2)


--]]
has:Remove()


local sd = Instance.new("Script")
local sd = Instance.new("Script")
sd.Parent = game.Workspace.Gus.Head
sd.Parent = m.Head
sd.Source = [[
sd.Source = [[
script.Name = "FollowScript"
script.Name = "FollowScript"
while true do
while true do
script.Parent = game.Workspace.Gus.Head
--script.Parent.RP.Target = script.Parent.Parent.SETTINGS.NameUser.Value
script.Parent.RP.Target = nil
script.Parent.RP:Fire()
script.Parent.RP:Fire()
wait(0.1)
wait(0.1)
end
end
]]
]]
sdd = sd:clone()
sdd = sd:clone()
sd:Remove()
sd:Remove()
sdd.Parent = game.Workspace.Gus.Head
sdd.Parent = m.Head
 
function onChatted(msg, recipient, speaker)
 
--tyy = game.Players:findFirstChild(""..UserName.."")
 
if string.sub(msg,1,11) == "sparkles/on" and speaker.Name == UserName then
 
local sp = Instance.new("Sparkles")
sp.Parent = m
sp.Color = Color3.new(math.Random(), math.Random(), math.Random())
 
end


--[[
if string.sub(msg,1,12) == "sparkles/off" and speaker.Name == UserName then
 
t = m:GetChildren()
 
for i=1, #t do
 
if t[i].className == "Sparkles" then


Touch to Heal script
t[i]:Remove()


--]]
end
end


local sb = Instance.new("Script") --Touch to heal script.
end --onchatted
sb.Parent = game.Workspace.Gus.Head
sb.Source =[[
function onTouched(part)
local h = part.Parent:findFirstChild(Humanoid) -- Find Humanoids in whatever touched this
if (h ~=nil) then -- If there is a Humanoid then
      h.Health = h.MaxHealth -- Set the health to maximum (full healing)
else end
end
end


script.Parent.Touched:connect(onTouched) -- Make it call onTouched when touched
function onPlayerEntered(newPlayer)
]]
print("entered")
sbd = sb:clone()
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)  
sb:Remove()
end
sbd.Parent = game.Workspace.Gus.Head
sbd.Name = "Touch-Heal-Script"


game.Workspace.Gus.Name = game.Workspace.Gus.SETTINGS.NameBot.Value --Sets name
game.Players.ChildAdded:connect(onPlayerEntered)
game.Workspace.Gus.Head.RP.Target = UserName
</pre>
</pre>

Latest revision as of 01:17, 23 November 2008


Gus 3.3

This is a script I'm working on. Feel free to use it and modify it.

Features

  • Follows you around.
  • Heals others on touch.
  • Heals itself.
  • Sparkle commands ("sparkles/on" or "sparkles/off")

Future Plans

  • Improving Healing itself
  • Ability to shoot rockets (via command).
  • More customability.

Script

--[[
      By outofspace
      Revision 3.3
--]]

----
----

local BotName = "Gus" --Put your pets name here.
local UserName = "outofspace" --Replace with your username!
cc = true --Can gus collide with other objects?

----
----
----Gus controls.
----
----

local has = Instance.new("Hint")
has.Parent = game.Workspace
has.Text = "Creating gus..."

c = game.Workspace:GetChildren()

for i=1,#c do
	if c[i].Name == BotName and c[i].className == "Model" then 
c[i]:Remove() 
end
end

script.Name = "GusScript"
local m = Instance.new("Model")
m.Name = BotName


m.Parent = game.Workspace
local ma = Instance.new("Model")
ma.Parent = m
ma.Name = "SETTINGS"

local sva = Instance.new("StringValue")
sva.Name = "NameBot"
sva.Parent = m.SETTINGS
sva.Value = BotName

local svb = Instance.new("StringValue")
svb.Name = "NameUser"
svb.Parent = m.SETTINGS
svb.Value = UserName

local b = Instance.new("Part") 
b.Parent = m
b.Locked = true
b.Name = "Head"
b.Position = Vector3.new(-14.5, 103, -10)
b.CanCollide = cc

local rp = Instance.new("RocketPropulsion")
rp.Parent = m.Head
rp.Name = "RP"

local h = Instance.new("Humanoid")
h.Parent = m

local bav = Instance.new("BodyAngularVelocity")
bav.Parent = m.Head
bav.angularvelocity = Vector3.new(0, 0, 3)
--[[

Self heal script

--]]

local sa = Instance.new("Script")
sa.Parent = m

sa.Source =[[
function waitForChild(parent, childName)
	local child = parent:findFirstChild(childName)
	if child then return child end
	while true do
		child = parent.ChildAdded:wait()
		if child.Name==childName then return child end
	end
end

-- declarations

local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")

-- regeneration
while true do
	local s = wait(1)
	local health = Humanoid.Health
	if health > -1 and health < Humanoid.MaxHealth then
		health = health + 0.05 * s * Humanoid.MaxHealth
		if health * 1.05 < Humanoid.MaxHealth then
			Humanoid.Health = health
		else
			Humanoid.Health = Humanoid.MaxHealth
		end
	end
end
]]
sad = sa:clone()
sa:Remove() --Removes the old script
sad.Parent = game.Workspace.Gus --Replaces the old script
sad.Name = "HealingScript"

local sb = Instance.new("Script") --Touch to heal script.
sb.Parent = m.Head

sb.Source =[[
function onTouched(part)
 local h = part.Parent:findFirstChild("Humanoid") -- Find Humanoids in whatever touched this
 if (h ~=nil) then -- If there is a Humanoid then
       h.Health = h.MaxHealth -- Set the health to maximum (full healing)
 end
 end

script.Parent.Touched:connect(onTouched) -- Make it call onTouched when touched
]]

sbd = sb:clone()
sb:Remove()
sbd.Parent = m.Head
sbd.Name = "Touch-to-Heal"

--game.Workspace.Gus.Name = game.Workspace.Gus.SETTINGS.NameBot.Value --Sets name

ty = game.Workspace:findFirstChild(""..UserName.."")

if (ty ~= nil) then

m.Head.RP.Target = ty.Head

else

m:Remove()

end

has.Text = "Done!"

wait(2)

has:Remove()

local sd = Instance.new("Script")
sd.Parent = m.Head
sd.Source = [[
script.Name = "FollowScript"
while true do
--script.Parent.RP.Target = script.Parent.Parent.SETTINGS.NameUser.Value
script.Parent.RP:Fire()
wait(0.1)
end
]]

sdd = sd:clone()
sd:Remove()
sdd.Parent = m.Head

function onChatted(msg, recipient, speaker)

--tyy = game.Players:findFirstChild(""..UserName.."")

if string.sub(msg,1,11) == "sparkles/on" and speaker.Name == UserName then 

local sp = Instance.new("Sparkles")
sp.Parent = m
sp.Color = Color3.new(math.Random(), math.Random(), math.Random())

end

if string.sub(msg,1,12) == "sparkles/off" and speaker.Name == UserName then 

t = m:GetChildren()

for i=1, #t do

if t[i].className == "Sparkles" then

t[i]:Remove()

end
end

end --onchatted

function onPlayerEntered(newPlayer)
	print("entered")
	newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) 
end

game.Players.ChildAdded:connect(onPlayerEntered)