|
| 28 Nov 2016 02:53 PM |
(Don't ask about the title, my friend and I are working on a game that uses as toasters as weapons and they fire toast instead of bullets. It is a strange idea.)
Me and my friend recently started working on a game, and in order for it to work I had to script a weapon. It is working almost perfectly, except for one issue. The projectile is hitting the person firing it. There are no errors in the console, and this is the part of the script that should run when the toaster is fired.
tost.Touched:connect(function(hit) if hit.Parent ~= char and hit.Parent ~= script.Parent then local hum = hit.Parent:FindFirstChild("Humanoid") if hum then hum:TakeDamage(25) end tost:Destroy() end end)
I recorded a video that shows what happens when I test it in studio, and then what happens in the actual game. https://www.youtube.com/watch?v=Wvz6x49VIxo |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2016 03:26 PM |
| Any ideas for how to fix this? |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2016 09:02 PM |
| The title of this thread is strange now that I think about it. |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2016 11:03 PM |
| I seriousely don't know whats wrong with the toaster. |
|
|
| Report Abuse |
|
|
cbsqueast
|
  |
| Joined: 16 Apr 2011 |
| Total Posts: 6784 |
|
|
| 30 Nov 2016 11:10 PM |
go onto the scripters forum pls
most of us aren't the people to talk about this kind of stuff
You're gonna clean your home in a quicky, when you use your Schticky. |
|
|
| Report Abuse |
|
|
cbsqueast
|
  |
| Joined: 16 Apr 2011 |
| Total Posts: 6784 |
|
|
| 30 Nov 2016 11:13 PM |
i hope you fix ur toaster man
my poptart shot out of my toaster and it scared me very badly
You're gonna clean your home in a quicky, when you use your Schticky. |
|
|
| Report Abuse |
|
|
sc4rydev
|
  |
| Joined: 06 Nov 2015 |
| Total Posts: 421 |
|
|
| 30 Nov 2016 11:17 PM |
This is obvious.. The projectile is being created where the toaster is from what I see, therefore touching your character's arm. making you take damage and deleting it. You need to have the projectile created at an offset from the lookvector.
|
|
|
| Report Abuse |
|
|
|
| 01 Dec 2016 06:26 AM |
| You forgot to connect it to the humanoid. |
|
|
| Report Abuse |
|
|
|
| 01 Dec 2016 06:28 AM |
Wait nvm... I still don't see how the script runs without the connection but I guess it does.
Try offsetting the toast by 2.14 studs infront of the characters arm. |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 05:41 PM |
| I'll try setting the offset |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2016 10:31 PM |
| Its no longer an issue, we got it figured out. I am going to take 100% of the credit for the solution even though it was my friend's idea. jk :P |
|
|
| Report Abuse |
|
|