|
| 03 Mar 2014 06:57 AM |
So I'm pretty new to scripting and I made this script:
local ting = 0 function onTouched(hit) if ting == 0 then ting = 1 check = hit.Parent:FindFirstChild("Humanoid") if check ~= nil then local user = game.Players:GetPlayerFromCharacter(hit.Parent) local stats = user:findFirstChild("leaderstats") if stats ~= nil then local cash = stats:findFirstChild("Points") cash.Value = cash.Value +10 game.Workspace.Player.Torso.CFrame = CFrame.new(Vector3.new(-34.2, 1.7, -57.8)) wait(0.5) end end ting = 0 end end
--Events
script.Parent.Touched:connect(onTouched)
---------------------------------------------------
Normally, when you touch the brick that the script is inserted in, it gives you 10 points and it teleports you to (-34.2, 1.7, -57.8) + remove the debounce if necessary. Could you tell me what's wrong?
|
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 03 Mar 2014 07:00 AM |
You don't need CFrame AND vector3
and just do MoveTo on the character |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 07:23 AM |
| Ok thanks. But that still doesn't fix the problem. |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 03 Mar 2014 07:25 AM |
You never actually said what to problem is
1: output 2: what you want to happen 3: what actually happens |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Mar 2014 08:15 AM |
game.Workspace.Player.Torso.CFrame = CFrame.new(Vector3.new(-34.2, 1.7, -57.8))
-_-
hit.Parent.Torso.CFrame = CFrame.new(-34.2,1.7,-57.8)
Also if I would use a decoy deploy on that, a clone enemy or npc touches it, it brakes. |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 11:22 AM |
Output: Nothing What I want to happen: Teleport the player and give him 10 points (The one that touches the brick) |
|
|
| Report Abuse |
|
|
| |
|
| |
|