pawel630Join Date: 2016-04-12 Post Count: 15 |
Could anyone help me make a script that when you touch a part it moves you up by ## studs? Or a script that when you touch a part it checks your team and then if you're in a certain team then it teleports you to a certain position? Thanks , pawel630. |
|
spinywindJoin Date: 2012-01-26 Post Count: 3580 |
local Part = game.Workspace.Part
Part.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
Hit.Position = Hit.Position + Vector3.new(0,10,0)
end;
end);
|
|
iiNemoJoin Date: 2013-07-22 Post Count: 2380 |
^ that moves whatever body part that is touched by 5 and would remove the limb.
Fish Are Friends, Not Food |
|
spinywindJoin Date: 2012-01-26 Post Count: 3580 |
Oops, yea your right sorry bout that
Use this:
local Part = game.Workspace.Part
Part.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
Part.Position = Part.Position + Vector3.new(0,10,0)
end;
end);
|
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
Ok , thx ill try it out :D |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
Hmmm , it doesn't work :/. I touch it and nothing happens. |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
What the script does is move up a brick called "Part" by ## studs in the Workspace. So when you touch a brick with that script in it it will move the brick called "Part" up by ## studs in the Workspace. |
|
arcsecJoin Date: 2010-04-04 Post Count: 13 |
local PositionToTeleportTo = Vector3.new(0, 0, 0)
Part.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Humanoid.Health > 0 and hit.Parent:FindFirstChild("HumanoidRootPart") then
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(PositionToTeleportTo)
end
end)
|
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
So you would have to change local Part = game.Workspace.Part to something that would target the player. I don't know how to do this since im not that much of an expert in scripting I might be fully wrong. |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
###### it doesn't know what "Part" means in your script. |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
I put the location of the brick to touch in the script but it just respawns me. |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
It teleports me to the spawn point* |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
Anyone else who could help me? |
|
Kiriot22Join Date: 2015-07-19 Post Count: 226 |
local part = workspace.Part
local studs = 10
part.Touched:connect(function(p)
if p.Parent:IsA"Model" and p.Parent:FindFirstChildOfClass("Humanoid") then
p.Parent.HumanoidRootPart.CFrame = p.Parent.HumanoidRootPart.CFrame * CFrame.new(0,studs,0)
end
ebd) |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
It can also be a script that when you touch a part it checks your team and then if you're in a certain team then it teleports you to a certain position. Like , let's say the player who touches the part is in "Red" team it will teleport him to ######## ####### ####### for example.And if the player is in "Blue" team it will teleport him to ###### ###### ###### |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
Wow , ###### your script worked :D. Thanks so much. |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
Does this script not work in ################## Because I have the model in ReplicatedStorage and when I join the game it doesnt work :/. It works if it's in Workspace. |
|
pawel630Join Date: 2016-04-12 Post Count: 15 |
It works in studio but it doesn't work in the actual game. Could someone tell me what I am doing wrong? |
|