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: Pvp

Previous Thread :: Next Thread 
ScriptedCurse is not online. ScriptedCurse
Joined: 18 Jan 2013
Total Posts: 8282
03 Aug 2016 02:00 PM
I am trying to make it so if a player presses on a gui they can either disable or enable pvp, but mine seems to not be working. Here is my script: Player = script.Parent.Parent.Parent
local PvpValue = script.Parent:FindFirstChild("PvpValue")
local PvpEnabled = true
if PvpEnabled == true then
PvpValue.Value = true and Player.Humanoid.Health == 100
script.Parent.Text = "Pvp Enabled"
else
if PvpEnabled == false then
PvpValue.Value = true and Player.Humanoid.Health == 10000000000000000000000000000000000000000000000000000000
script.Parent.Text = "Pvp Disabled"
end
end
Report Abuse
Fangous is not online. Fangous
Joined: 03 Jul 2010
Total Posts: 4448
03 Aug 2016 02:22 PM
please learn to indent
Report Abuse
WatchtowerRobin is not online. WatchtowerRobin
Joined: 11 Feb 2012
Total Posts: 253
03 Aug 2016 02:26 PM
Where is player being told what it is?
like game.Players.LocalPlayer?
Report Abuse
ScriptedCurse is not online. ScriptedCurse
Joined: 18 Jan 2013
Total Posts: 8282
03 Aug 2016 02:29 PM
Yes.
Report Abuse
WrightPhillips99 is not online. WrightPhillips99
Joined: 27 Jun 2015
Total Posts: 667
03 Aug 2016 02:37 PM
Seriously indent dude. If you don't you'll get a headache.
Report Abuse
WrightPhillips99 is not online. WrightPhillips99
Joined: 27 Jun 2015
Total Posts: 667
03 Aug 2016 02:38 PM
Hey scripted and you should see if you could make It an infinite health script.
Report Abuse
WrightPhillips99 is not online. WrightPhillips99
Joined: 27 Jun 2015
Total Posts: 667
03 Aug 2016 02:41 PM
if PVP.Enabled = false then
humanoid.health = math.Huge

this is just the short version
Report Abuse
ScriptedCurse is not online. ScriptedCurse
Joined: 18 Jan 2013
Total Posts: 8282
03 Aug 2016 02:44 PM
How about if I wanted it to happen when a player clicks on it?
Report Abuse
WatchtowerRobin is not online. WatchtowerRobin
Joined: 11 Feb 2012
Total Posts: 253
03 Aug 2016 02:45 PM
script.Parent.MouseButton1Click:connect(function()

local PvpValue = script.Parent:FindFirstChild("PvpValue")
local Player = game.Players.LocalPlayer --Find local player
local character = Player.Character --Get character from said player

if PvpValue.Value == true then --If pvp value is true then run
PvpValue.Value = false --set pvp value to false
character.Humanoid.Health = 100 --get humanoid from character
script.Parent.Text = "Pvp Enabled"
elseif PvpValue.Value == false then
PvpValue.Value = true
character.Humanoid.MaxHealth = math.huge
script.Parent.Text = "Pvp Disabled"
end
end)
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