Here's a script that deals with Touch, so I know it can be done in script builder.
local p = Workspace.jaytheidiot
local tableOfChildren = p:GetChildren()
function Touch(part)
local human = part.Parent:FindFirstChild("Humanoid")
if human then
human:TakeDamage(human.MaxHealth)
end
end
for i,v in pairs(tableOfChildren) do
if v:IsA("BasePart") then
v.Touched:connect(Touch)
end
end
Now what I need to do is spawn a brick and make it have an Touch event. Here's a brick spawning script.
Dan = Workspace.jaytheidiot.Torso
p = Instance.new("Part")
p.Parent = Workspace.Bucket
p.Size = Vector3.new(100,10,100)
p.Anchored = true
p.BrickColor = BrickColor.new(1032)
p.Material = "SmoothPlastic"
p.CFrame = CFrame.new(Dan.CFrame.X,Dan.CFrame.Y-7,Dan.CFrame.Z)
What I want to happen when that block is touched is change the Touched player's torso CFrame to something so I can move them. Any ideas how to make this work? We can use CFrame.new(1,1,1) as an example CFrame. I'll change that to what I need later.
