Author Topic: [Scripts] Gun Script Help  (Read 947 times)

0 Members and 1 Guest are viewing this topic.

ANTHONY 7357

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
    • Awards
  • Xbox: ANTHONY 7357
[Scripts] Gun Script Help
« on: March 18, 2017, 04:58:31 PM »
This is the script for shooting and damaging a target.

If
Intersect [ray] [vrel:0,0,0] [vrel:250,0,0] [players]
Then
Context [player] [target]
Health [-37]

I also have this script running that activates it.

SetEventScript [ItemSwing] [AssaultRifle] [guns/AR]

So i set up my script exactly like this and I can damage other players but if there are more than 2 players everyone except for the person shooting will take damage when a target is hit. How can I modify this script to only damage one target at a time?
Hi Craig

Lunar

  • Elite Member
  • *****
  • Posts: 928
  • The God of the Galaxy
  • Awards 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: Qvzw
  • PSN: Widumn_Boise
Re: Gun Script Help
« Reply #1 on: March 18, 2017, 10:57:39 PM »
You could also add an ammo history to make it more realistic, and particles, this is very basic and could be improved a lot.

crazytater94

  • Supreme Member
  • *****
  • Posts: 2581
  • Mastering TM since 2011
  • Awards Awarded to exemplary forum members Members who have unlocked the robotic avatar 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Former MotM winners Week 1 members w/25+ posts (4/13/13-4/20/13) 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: crazytater94
  • PSN: crazytater94 (Inactive)
  • Steam: crazytater94
Re: Gun Script Help
« Reply #2 on: March 19, 2017, 03:11:13 AM »
It should not damage more than one player, because a ray is a line, and when it intersects at one player, it ends there.

The only thing I could think of, would be where you have "players" as a plural, but even then, that shouldn't cause it. I've tried to make the sphere intersect hit multiple targets, and that never turns out in my favor.

TheDestinedCrab

  • Legendary Member
  • *****
  • Posts: 1297
  • Did you see that? Me neither.
  • Awards 3 years on site+600 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
Re: Gun Script Help
« Reply #3 on: March 19, 2017, 05:49:12 AM »
You could also add an ammo history to make it more realistic, and particles, this is very basic and could be improved a lot.

He asked how to fix it, not improve it.

I hear that Dryym is good with gun scripts, ask him.
Thanks Gold Knight for the amazing sig!

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4233
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Gun Script Help
« Reply #4 on: March 19, 2017, 09:14:52 PM »
You could also add an ammo history to make it more realistic, and particles, this is very basic and could be improved a lot.

NO! No history. History is global among all items.

http://totalminerforums.net/index.php?topic=18541.0

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym