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 » Scripters
Home Search
 

Re: Script doesn't do anything

Previous Thread :: Next Thread 
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
08 Jun 2016 08:26 PM
function onChatted(msg, recipient, Speaker)
msg = string.lower(msg)
if msg == "Spawn Sazuki Dummy" then
wait(3)
local model = Instance.new("Model",workspace)
model.Name = "Saz the dummy"
print("Building leg1...")
local p = Instance.new("Part",model)
p.Name = "Right Leg"
p.BrickColor = BrickColor.new("Br. yellowish green")
p.Transparency = 0.5
p.Size = Vector3.new(1,2,1)
p.CFrame = CFrame.new(-1.5,12,0.5)
p.Anchored = true
p.CanCollide = false
for i=0,19 do
wait()
p.CFrame = p.CFrame - Vector3.new(0,0.5,0)
end
p.CanCollide = true
p.Transparency = 0
-------------------------------------------------------------
print("Building leg2...")
local p2 = Instance.new("Part",model)
p2.Name = "Left Leg"
p2.BrickColor = BrickColor.new("Br. yellowish green")
p2.Transparency = 0.5
p2.Size = Vector3.new(1,2,1)
p2.CFrame = CFrame.new(-2.5,12,0.5)
p2.Anchored = true
p2.CanCollide = false
for i=0,19 do
wait()
p2.CFrame = p2.CFrame - Vector3.new(0,0.5,0)
end
p2.CanCollide = true
p2.Transparency = 0
-------------------------------------------------------------
print("Building torso...")
local p3 = Instance.new("Part",model)
p3.Name = "Torso"
p3.BrickColor = BrickColor.new("Bright blue")
p3.Transparency = 0.5
p3.Size = Vector3.new(2,2,1)
p3.CFrame = CFrame.new(-2,14,0.5)
p3.Anchored = true
p3.CanCollide = false
p3.LeftSurface = "Weld"
p3.RightSurface = "Weld"
for i=0,19 do
wait()
p3.CFrame = p3.CFrame - Vector3.new(0,0.5,0)
end
p3.CanCollide = true
p3.Transparency = 0
local d = Instance.new("Decal",p3)
d.Transparency = 1
d.Face = "Front"
d.Name = "roblox"
d.Texture = "http://www.roblox.com/asset/?id=30874337"
for i=0,19 do
wait()
d.Transparency = d.Transparency - 0.05
end
-------------------------------------------------------------
print("Building head...")
local p4 = Instance.new("Part",model)
local m = Instance.new("SpecialMesh",p4)
m.Scale = Vector3.new(1.25,1.25,1.25)
p4.Name = "Head"
p4.BrickColor = BrickColor.new("Bright yellow")
p4.Transparency = 0.5
p4.Size = Vector3.new(2,1,1)
p4.CFrame = CFrame.new(-2,15.5,0.5)
p4.Anchored = true
p4.CanCollide = false
for i=0,19 do
wait()
p4.CFrame = p4.CFrame - Vector3.new(0,0.5,0)
end
p4.CanCollide = true
p4.Transparency = 0
local d2 = Instance.new("Decal",p4)
d2.Transparency = 1
d2.Face = "Front"
d2.Name = "face"
d2.Texture = "rbxasset://textures/face.png"
for i=0,19 do
wait()
d2.Transparency = d2.Transparency - 0.05
end
-------------------------------------------------------------
print("Building arm1...")
local p5 = Instance.new("Part",model)
p5.Name = "Right Arm"
p5.BrickColor = BrickColor.new("Bright yellow")
p5.Transparency = 0.5
p5.Size = Vector3.new(1,2,1)
p5.CFrame = CFrame.new(-0.5,14,0.5)
p5.Anchored = true
p5.CanCollide = false
for i=0,19 do
wait()
p5.CFrame = p5.CFrame - Vector3.new(0,0.5,0)
end
p5.CanCollide = true
p5.Transparency = 0
-------------------------------------------------------------
print("Building arm2...")
local p6 = Instance.new("Part",model)
p6.Name = "Left Arm"
p6.BrickColor = BrickColor.new("Bright yellow")
p6.Transparency = 0.5
p6.Size = Vector3.new(1,2,1)
p6.CFrame = CFrame.new(-3.5,14,0.5)
p6.Anchored = true
p6.CanCollide = false
for i=0,19 do
wait()
p6.CFrame = p6.CFrame - Vector3.new(0,0.5,0)
end
p6.CanCollide = true
p6.Transparency = 0
-------------------------------------------------------------
print("Finalizing...")
local h = Instance.new("Humanoid",model)
p.Anchored = false
p2.Anchored = false
p3.Anchored = false
p4.Anchored = false
p5.Anchored = false
p6.Anchored = false
local copy = model:Clone()
model:Destroy()
copy.Parent = workspace
copy:MakeJoints()
copy.Humanoid.MaxHealth = math.huge
copy.Humanoid.Health = copy.Humanoid.MaxHealth
local f = Instance.new("ForceField",copy)
wait(3)
copy.Humanoid.MaxHealth = 100
copy.Humanoid.Health = copy.Humanoid.MaxHealth
f:Destroy()
print("Saz the dummy is ready! :D")
while wait() do
for i=0,3 do
wait(3)
if copy.Humanoid.Health < 1 then
print("Saz the dummy died, aborting script...")
copy:Destroy()
script:Destroy()
end
copy.Humanoid.WalkToPoint = Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
end
local msgs = {"Hello!","How ya doin, buckero?","heya","I like walking!","I was created by KaiVonZiegner!",":)","Please don't kill me! D:"}
local clrs = {Enum.ChatColor.Green,Enum.ChatColor.Blue,Enum.ChatColor.Red}
local m = math.random(1,2)
if m == 1 then
copy.Humanoid.Jump = true
elseif m == 2 then
game:GetService("Chat"):Chat(copy.Head,msgs[math.random(1,#msgs)],clrs[math.random(1,#clrs)])
end
end
end
end

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

The script doesn't do anything if I say the phrase. No error in console either


Report Abuse
Proxidious is not online. Proxidious
Joined: 18 Jul 2011
Total Posts: 1339
08 Jun 2016 08:30 PM
if msg == string.lower("Spawn Sazuki Dummy") then
Report Abuse
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
08 Jun 2016 10:12 PM
Didn't work.


Report Abuse
obscurr is not online. obscurr
Joined: 21 May 2016
Total Posts: 655
08 Jun 2016 10:14 PM
p5.CanCollide = true

actually dont listen to me i have never scripted in my life


SET THE GAME ABLAZE, I'M AN ARCADE FIRE
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
08 Jun 2016 10:17 PM
You never connected the onPlayerEntered function to the PlayerAdded event. Add this to the bottom of the script:

game.Players.PlayerAdded:connect(onPlayerEntered)

Also, if you wrap that onChatted function in with the connector you won't need to use that hacky anonymous function to pass in the player.
Report Abuse
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
08 Jun 2016 10:31 PM
function onChatted(msg, recipient, Speaker)
msg = string.lower(msg)
if msg == string.lower("Spawn Sazuki Dummy") then
wait(3)
local model = Instance.new("Model",workspace)
model.Name = "Saz the dummy"
print("Building leg1...")
local p = Instance.new("Part",model)
p.Name = "Right Leg"
p.BrickColor = BrickColor.new("Br. yellowish green")
p.Transparency = 0.5
p.Size = Vector3.new(1,2,1)
p.CFrame = CFrame.new(-1.5,12,0.5)
p.Anchored = true
p.CanCollide = false
for i=0,19 do
wait()
p.CFrame = p.CFrame - Vector3.new(0,0.5,0)
end
p.CanCollide = true
p.Transparency = 0
-------------------------------------------------------------
print("Building leg2...")
local p2 = Instance.new("Part",model)
p2.Name = "Left Leg"
p2.BrickColor = BrickColor.new("Br. yellowish green")
p2.Transparency = 0.5
p2.Size = Vector3.new(1,2,1)
p2.CFrame = CFrame.new(-2.5,12,0.5)
p2.Anchored = true
p2.CanCollide = false
for i=0,19 do
wait()
p2.CFrame = p2.CFrame - Vector3.new(0,0.5,0)
end
p2.CanCollide = true
p2.Transparency = 0
-------------------------------------------------------------
print("Building torso...")
local p3 = Instance.new("Part",model)
p3.Name = "Torso"
p3.BrickColor = BrickColor.new("Bright blue")
p3.Transparency = 0.5
p3.Size = Vector3.new(2,2,1)
p3.CFrame = CFrame.new(-2,14,0.5)
p3.Anchored = true
p3.CanCollide = false
p3.LeftSurface = "Weld"
p3.RightSurface = "Weld"
for i=0,19 do
wait()
p3.CFrame = p3.CFrame - Vector3.new(0,0.5,0)
end
p3.CanCollide = true
p3.Transparency = 0
local d = Instance.new("Decal",p3)
d.Transparency = 1
d.Face = "Front"
d.Name = "roblox"
d.Texture = "http://www.roblox.com/asset/?id=30874337"
for i=0,19 do
wait()
d.Transparency = d.Transparency - 0.05
end
-------------------------------------------------------------
print("Building head...")
local p4 = Instance.new("Part",model)
local m = Instance.new("SpecialMesh",p4)
m.Scale = Vector3.new(1.25,1.25,1.25)
p4.Name = "Head"
p4.BrickColor = BrickColor.new("Bright yellow")
p4.Transparency = 0.5
p4.Size = Vector3.new(2,1,1)
p4.CFrame = CFrame.new(-2,15.5,0.5)
p4.Anchored = true
p4.CanCollide = false
for i=0,19 do
wait()
p4.CFrame = p4.CFrame - Vector3.new(0,0.5,0)
end
p4.CanCollide = true
p4.Transparency = 0
local d2 = Instance.new("Decal",p4)
d2.Transparency = 1
d2.Face = "Front"
d2.Name = "face"
d2.Texture = "rbxasset://textures/face.png"
for i=0,19 do
wait()
d2.Transparency = d2.Transparency - 0.05
end
-------------------------------------------------------------
print("Building arm1...")
local p5 = Instance.new("Part",model)
p5.Name = "Right Arm"
p5.BrickColor = BrickColor.new("Bright yellow")
p5.Transparency = 0.5
p5.Size = Vector3.new(1,2,1)
p5.CFrame = CFrame.new(-0.5,14,0.5)
p5.Anchored = true
p5.CanCollide = false
for i=0,19 do
wait()
p5.CFrame = p5.CFrame - Vector3.new(0,0.5,0)
end
p5.CanCollide = true
p5.Transparency = 0
-------------------------------------------------------------
print("Building arm2...")
local p6 = Instance.new("Part",model)
p6.Name = "Left Arm"
p6.BrickColor = BrickColor.new("Bright yellow")
p6.Transparency = 0.5
p6.Size = Vector3.new(1,2,1)
p6.CFrame = CFrame.new(-3.5,14,0.5)
p6.Anchored = true
p6.CanCollide = false
for i=0,19 do
wait()
p6.CFrame = p6.CFrame - Vector3.new(0,0.5,0)
end
p6.CanCollide = true
p6.Transparency = 0
-------------------------------------------------------------
print("Finalizing...")
local h = Instance.new("Humanoid",model)
p.Anchored = false
p2.Anchored = false
p3.Anchored = false
p4.Anchored = false
p5.Anchored = false
p6.Anchored = false
local copy = model:Clone()
model:Destroy()
copy.Parent = workspace
copy:MakeJoints()
copy.Humanoid.MaxHealth = math.huge
copy.Humanoid.Health = copy.Humanoid.MaxHealth
local f = Instance.new("ForceField",copy)
wait(3)
copy.Humanoid.MaxHealth = 100
copy.Humanoid.Health = copy.Humanoid.MaxHealth
f:Destroy()
print("Saz the dummy is ready! :D")
while wait() do
for i=0,3 do
wait(3)
if copy.Humanoid.Health < 1 then
print("Saz the dummy died, aborting script...")
copy:Destroy()
script:Destroy()
end
copy.Humanoid.WalkToPoint = Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
end
local msgs = {"Hello!","How ya doin, buckero?","heya","I like walking!","I was created by KaiVonZiegner!",":)","Please don't kill me! D:"}
local clrs = {Enum.ChatColor.Green,Enum.ChatColor.Blue,Enum.ChatColor.Red}
local m = math.random(1,2)
if m == 1 then
copy.Humanoid.Jump = true
elseif m == 2 then
game:GetService("Chat"):Chat(copy.Head,msgs[math.random(1,#msgs)],clrs[math.random(1,#clrs)])
end
end
end
end

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

Did what you said and it still didn't work. Nothing in console and nothing happened


Report Abuse
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
09 Jun 2016 02:11 PM
Bump


Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
09 Jun 2016 02:13 PM
The PlayerAdded thing still isn't at the bottom though :0

unless it's somewhere else in the script and I can't see it
Report Abuse
Fangous is not online. Fangous
Joined: 03 Jul 2010
Total Posts: 4448
09 Jun 2016 02:20 PM
inb4scriptisdisabled
Report Abuse
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
09 Jun 2016 03:27 PM
Studio says "Unknown Global msg, recipient"


Report Abuse
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
10 Jun 2016 10:03 AM
Bump -aaaaaaaaaaaaaaaa-


Report Abuse
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
10 Jun 2016 06:17 PM
Bump -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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