Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 05:45 PM |
I worked on a anti-teamkill script for this new RPG I am working on. However it failed, I reviewed it and realized that there was no way it would work in the first place. I went into free models to find some anti-team kill scripts and all of them killed the player if they killed someone.
I am looking for a script that will not allow any damage to be done to another player at all, this preventing anyone dieing in the first place. (Unless a monster has killed them!) I am not much of a noobie to roblox considering I have been playing for a couple years, but I am a bit of a noobie scripting. I know how to edit and fix scripts and I am just getting into making scripts. (Thank you Grade 11 tech class!)
If you can create a script that prevents any, player to player damage I will give the following rewards!: --- Teleporter to your place or a friends! Kohl's V7 Admin Commands (All Commands (-ServerCmd)) ---
The RPG I am making right now is not published yet due to its in-completion and lack of this script.
Otherwise my stats and tool saving is covered at the moment!
|
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 07 Dec 2013 05:51 PM |
| Needa to be in the tool, crazyman32 or stickmasterluke created one named: Anti-TK sword, so search in Catalog, Models Creator, one of their names and type in TK, Sword or Teamkill in search. But you also could change humanoids of the enemies and let the sword only search for those humanoids. |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 07 Dec 2013 05:53 PM |
Go into your Guns/Swords and change this line local humanoid = hit.Parent:findFirstChild("Humanoid") To: local humanoid = hit.Parent:findFirstChild("Attaker")
Then go into your monster then change the humanoid to "Attacker"
Basically it just dosent do any damage unless it hits a Monster(Attacker) |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 07 Dec 2013 05:53 PM |
in your damage script do
if game.Players:GetPlayerFromCharacter(hit) then else --do damage stuff end |
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 05:56 PM |
| Thanks guys you are all life savers! |
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 05:59 PM |
| I changed it from attacher to Monster for organization reason, however thanks |
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:26 PM |
Here is the monsters follow script:
local larm = script.Parent:FindFirstChild("Left Arm") local rarm = script.Parent:FindFirstChild("Right Arm")
function findNearestTorso(pos) local list = game.Workspace:children() local torso = nil local dist = 10 local temp = nil local human = nil local temp2 = nil for x = 1, #list do temp2 = list[x] if (temp2.className == "Model") and (temp2 ~= script.Parent) then temp = temp2:findFirstChild("Torso") human = temp2:findFirstChild("Humanoid") if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then if (temp.Position - pos).magnitude < dist then torso = temp dist = (temp.Position - pos).magnitude end end end end return torso end
while true do wait(0.1) local target = findNearestTorso(script.Parent.Torso.Position) if target ~= nil then script.Parent.Humanoid:MoveTo(target.Position, target) end end
The monsters humanoid is called monster and the players is called humanoid how do i get it chasing me? |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
| |
|
|
| 07 Dec 2013 06:32 PM |
| -.- I hate people who uses admin in their place. |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2013 06:32 PM |
@Naruto9200 That was completely offtopic and random. |
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:34 PM |
The NPC's Humanoid has been renamed to Monster and the script above does not work!
What I want it to do is chase after a player and now since its been named Monster it does not work. However the anti TK is a life saver!
|
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:34 PM |
| I use admin for moderation purposes |
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:37 PM |
| Here is what im dealing with. test it out in a fresh place and check out the follow script in the Hyolin please repost the NPC if you can fix it |
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:37 PM |
| Oops here is the link: http://www.roblox.com/Example-item?id=137870105 |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 07 Dec 2013 06:39 PM |
if target ~= nil then script.Parent.Monster:MoveTo(target.Position, target) end end
This should work now man give it a go! :) |
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
| |
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:40 PM |
| If you could support me with a full script I would be greatfull |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 07 Dec 2013 06:42 PM |
local larm = script.Parent:FindFirstChild("Left Arm") local rarm = script.Parent:FindFirstChild("Right Arm")
function findNearestTorso(pos) local list = game.Workspace:children() local torso = nil local dist = 10 local temp = nil local human = nil local temp2 = nil for x = 1, #list do temp2 = list[x] if (temp2.className == "Model") and (temp2 ~= script.Parent) then temp = temp2:findFirstChild("Torso") human = temp2:findFirstChild("Humanoid") if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then if (temp.Position - pos).magnitude < dist then torso = temp dist = (temp.Position - pos).magnitude end end end end return torso end
while true do wait(0.1) local target = findNearestTorso(script.Parent.Torso.Position) if target ~= nil then script.Parent.Monster:MoveTo(target.Position, target)-----PROBLEMFIXED :) end end
|
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
| |
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:44 PM |
Thank you so-so-so much you are a life saver!
Im adding your name to the admin list now! |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
| |
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:50 PM |
| I know who to call if I have problems. xD |
|
|
| Report Abuse |
|
|
Mapyo10
|
  |
| Joined: 01 Mar 2009 |
| Total Posts: 170 |
|
|
| 07 Dec 2013 06:55 PM |
| We can now say project fresh start, is now underway! |
|
|
| Report Abuse |
|
|