Im in Roblox API looking at how to make a event fire when a player touches something, but it gives no example or syntax really. I dont want to just copy paste this to do what i want if it aint gonna work. Here is the website im looking at
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Touched
How would i use this?
here is the box script
local Character = game.Players.LocalPlayer
local part = script.Parent
_G.DieNibba = function()
part:Destroy()
end
repeat wait() until _G.giveXP
part.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
game.Workspace.part:Destroy()
end
end)

1 comment
FASCINATING. i just realized that functions can be connected and called with certain trigger events, so thanks for the help!