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: Why does this work only in studio?

Previous Thread :: Next Thread 
iTheoryy is not online. iTheoryy
Joined: 25 Apr 2014
Total Posts: 31
30 Jul 2015 12:48 AM
player = game.Players.LocalPlayer
player.Chatted:connect(function(msg)
if msg == "reset" then
game.Workspace.Player.Humanoid.Health = 0
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "successful reset!"
wait(1)
m:remove()
end
end)
player = game.Players.LocalPlayer
player.Chatted:connect(function(msg)
if msg == "ff me" then
Instance.new("ForceField",player.Character)
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "successfully ff'd"
wait(1)
m:remove()
end
end)
player = game.Players.LocalPlayer
player.Chatted:connect(function(msg)
if msg == "unff me" then
player.Character.ForceField:Destroy()
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "successfully unff'd!"
wait(1)
m:remove()
end
end)
player = game.Players.LocalPlayer
player.Chatted:connect(function(msg)
if msg == "god me" then
player.Character.Humanoid.MaxHealth = 9999999999
player.Character.Humanoid.Health = 9999999999
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "successfully godded!"
wait(1)
m:remove()
end
end)
player = game.Players.LocalPlayer
player.Chatted:connect(function(msg)
if msg == "credits" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Created by Awsomeman511"
wait(3)
m:remove()
end
end)
player.Chatted:connect(function(msg)
if msg == "hello" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Hi there!"
wait(3)
m:remove()
end
end)
player.Chatted:connect(function(msg)
if msg == "hows ur day" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Good! you?"
wait(3)
m:remove()
end
end)
player.Chatted:connect(function(msg)
if msg == "hows your day" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Good! you?"
wait(3)
m:remove()
end
end)
player.Chatted:connect(function(msg)
if msg == "hi" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Hello!"
wait(3)
m:remove()
end
end)
player.Chatted:connect(function(msg)
if msg == "who are you" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "I'm a bot coded by awsomeman511."
wait(3)
m:remove()
end
end)

player.Chatted:connect(function(msg)
if msg == "who are u" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "I'm a bot coded by awsomeman511."
wait(3)
m:remove()
end
end)
player.Chatted:connect(function(msg)
if msg == "bye" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Cya later!"
wait(3)
m:remove()
end
end)
player.Chatted:connect(function(msg)
if msg == "secret" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "This will be a secret command coming out SOON!"
wait(3)
m:remove()
end
end)

player.Chatted:connect(function(msg)
if msg == "heal me" then
player.Character.Humanoid.Health = 100
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "successfully healed!"
wait(1)
m:remove()
end
end)

player.Chatted:connect(function(msg)
if msg == "ungod me" then
player.Character.Humanoid.MaxHealth = 100
player.Character.Humanoid.Health = 100
player.Character.Humanoid.Health = 100
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "successfully ungodded!"
wait(1)
m:remove()
end
end)
player = game.Players.Player
mouse = player:GetMouse()
mouse.KeyDown:connect(function(key)
Key = key:lower()
if key == "h" then
m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "lelelelel, shouldnt of pressed this"
player.Character.Humanoid.Health = 0
wait(3)
m:remove()
end
end)


Shrekin' noobs since 1337
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
30 Jul 2015 12:54 AM
Handle this script server sided for players who enter the server. Also, you only need 1 event for the chatted.

player.Chatted:connect(function(msg)
if msg == "Hello" then
print("hi")
elseif msg == "hi" then
print("Hello")
end
end)


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
iTheoryy is not online. iTheoryy
Joined: 25 Apr 2014
Total Posts: 31
30 Jul 2015 12:56 AM
@Time I need to make the scripts sever-sided? how?


Shrekin' noobs since 1337
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
30 Jul 2015 12:57 AM
putting the code into a server script.

game.Players.PlayerAdded:connect(function(player)
--code
end)


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
iTheoryy is not online. iTheoryy
Joined: 25 Apr 2014
Total Posts: 31
30 Jul 2015 01:00 AM
wouldnt work.. :l


Shrekin' noobs since 1337
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