LordGan
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1366 |
|
|
| 04 Jul 2014 06:57 PM |
sp = script.Parent
function onTouched(hit) local h = hit.Parent:FindFirstChild("Humanoid") if (h ~= nil) then m = Instance.new("Hint",Workspace) m.Text = "Your gift is down the hall son :)" wait(5) m:remove() end end
sp.Touched:connect(onTouched)
This script is inside a brick called "P1" |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 07:01 PM |
The problem is that too many Message objects are being created when a character touches the part. To fix this, I added in a debounce into the script.
sp = script.Parent enabled = true
function onTouched(hit) local h = hit.Parent:FindFirstChild("Humanoid") if (h ~= nil) and enabled == true then enabled = false m = Instance.new("Hint",Workspace) m.Text = "Your gift is down the hall son :)" wait(5) m:remove() enabled = true end end
sp.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
PwnzaKing
|
  |
| Joined: 19 Jul 2012 |
| Total Posts: 14852 |
|
|
| 04 Jul 2014 07:11 PM |
just go to kohls admin and h/ your gift is down the hall son :) ur welocme!'
|
|
|
| Report Abuse |
|
|
blox6137
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 1109 |
|
|
| 04 Jul 2014 08:07 PM |
Wait, why is it "m = Instance.new("Hint",Workspace)" it should be m = Instance.new("Message", Workspace)" Also, try and capitalize things that need to be. Like the word 'remove'. Capitalize that, otherwise it slows down the script.
System32? Delete it. |
|
|
| Report Abuse |
|
|
alij12
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1204 |
|
|
| 04 Jul 2014 08:12 PM |
sp = script.Parent m = Instance.new("Hint") db = false
function onTouched(hit) if hit.Parent:findFirstChild("Humanoid") and db == false then db = true m.Text = "Your gift is down the hall son :)" m.Parent = game.Workspace wait(5) m.Parent = nil db = false end end
sp.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|