freaked Beginner Poster
Joined: 26 May 2008 Posts: 20
|
Posted: Sat May 31, 2008 2:44 am Post subject: Whats Wrong? |
|
|
Whats wrong with this Script? I want it when touched, it will give you a weapon and will teleport to teleporter2d.
-- Mini Shop by BouyertheDestroyer -- January 2008
amnt = 20 -- Cost.
local weapon = game.Lighting.Snipe-- Are you familiar with the Lighting Hack?
function onTouched(part)
local H = part.Parent:findFirstChild("Message")
if (H==nil) then
local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
local thisplr = game.Players:findFirstChild(h.Parent.Name)
if (thisplr~=nil) then
local stats = thisplr:findFirstChild("leaderstats")
if (stats~=nil) then
local score = stats:findFirstChild("KOs")
if (score~=nil) then -- Do not Edit anything after this except for the text.
if (score.Value <amnt> amnt - 1) then
score.Value = score.Value - amnt
weapon:clone().Parent = thisplr
local Hint = Instance.new("Hint")
Hint.Parent = part.Parent
Hint.Text = "You just purchased a"
script.Parent.BrickColor = BrickColor.new(37)
wait(1)
Hint.Text = weapon.Name
script.Parent.BrickColor = BrickColor.new(26)
wait(1)
Hint.Text = "For"
wait(1)
Hint.Text = amnt
wait(1)
Hint.Text = "KOs"
wait(1)
Hint.Text = "You have"
wait(1)
Hint.Text = score.Value.." KOs"
wait(1)
Hint.Text = "Left"
wait(1)
Hint:remove()
end
end
end
end
end
end
end
script.Parent.Touched:connect(onTouched)
------------------------------------
modelname="teleporter2d"
------------------------------------
function onTouched(part)
if part.Parent ~= nil then
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
local teleportfrom=script.Parent.Enabled.Value
if teleportfrom~=0 then
if h==humanoid then
return
end
local teleportto=script.Parent.Parent:findFirstChild(modelname)
if teleportto~=nil then
local torso = h.Parent.Torso
script.Parent.Enabled.Value=0
teleportto.Enabled.Value=0
torso.Parent:MoveTo(teleportto.Position) -- + Vector3.new(math.random(1,3),math.random(1,3),math.random(1,3)
wait(3)
script.Parent.Enabled.Value=1
teleportto.Enabled.Value=1
else
print("Could not find teleporter!")
end
end
end
end
end
script.Parent.Touched:connect(onTouched) _________________
http://robloxhub.wordpress.com |
|