|
| 20 Jan 2017 08:54 PM |
Because I'm making a combat system and people are telling me you can't use .Touched in a local script... And I need it to play animations... So how do I do it?
nothing here. |
|
|
| Report Abuse |
|
SPACEDUDZ
|
  |
| Joined: 12 Jul 2014 |
| Total Posts: 257 |
|
|
| 20 Jan 2017 09:34 PM |
The reason you cant just put a touch script in a local script is because if someone else touches the block, it will affect other players.
If you want to make it work with just a script then do this:
script.Parent.Touched:connect(function(Part) Humanoid = Part.Parent:FindFirstChild("Humanoid") if Humanoid ~= nil then local animation=Instance.new("Animation",Part.Parent) animation.Name="LocalAnimation" animation.AnimationId="rbxassetid://Numbers" anim=Humanoid:LoadAnimation(animation) anim:Play() end This should work
|
|
|
| Report Abuse |
|
|
| 20 Jan 2017 09:57 PM |
so this would work in a local script?
if so thanks!
nothing here. |
|
|
| Report Abuse |
|