Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do i add ice block if the player is frozen?

Asked by 8 years ago

HEres the script

function onTouched(part)
local hu = part.Parent:findFirstChild("Humanoid")
local he = part.Parent:findFirstChild("Head")
local la = part.Parent:findFirstChild("Left Arm")
local ll = part.Parent:findFirstChild("Left Leg")
local ra = part.Parent:findFirstChild("Right Arm")
local rl = part.Parent:findFirstChild("Right Leg")
local to = part.Parent:findFirstChild("Torso")


if hu~=nil then
he.BrickColor = BrickColor.new(1013)
he.Transparency = 0.7
he.Anchored = true
la.BrickColor = BrickColor.new(1013)
la.Transparency = 0.7
la.Anchored = true
ll.BrickColor = BrickColor.new(1013)
ll.Transparency = 0.7
ll.Anchored = true
ra.BrickColor = BrickColor.new(1013)
ra.Transparency = 0.7
ra.Anchored = true
rl.BrickColor = BrickColor.new(1013)
rl.Transparency = 0.7
rl.Anchored = true
to.BrickColor = BrickColor.new(1013)
to.Transparency = 0.7
to.Anchored = true
end

end

script.Parent.Touched:connect(onTouched)

i wanted this script to freeze people and it did, now i wanted this script to freeze people and an iceblock will appear to the people got freezed.

0
Edit your question to explain what you want to do clearly. BlueTaslem 18071 — 8y
0
i edited it SHIFTRK9 -2 — 8y
0
No requests please! You need to attempt to do it Shawnyg 4330 — 8y
0
I am so sorry if this is considered as a request, i been searching the answer but none of them are related to this. SHIFTRK9 -2 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Yes, this is technically a request, since you didn't attempt to create the ice yourself, but since you did try to make the first part of the script, I'd like to consider it "Help" more than "request", since it's also a simple thing.

What you need to do is create a new part, and then put it over the player, like so:

function onTouched(part)
local hu = part.Parent:findFirstChild("Humanoid")
local he = part.Parent:findFirstChild("Head")
local la = part.Parent:findFirstChild("Left Arm")
local ll = part.Parent:findFirstChild("Left Leg")
local ra = part.Parent:findFirstChild("Right Arm")
local rl = part.Parent:findFirstChild("Right Leg")
local to = part.Parent:findFirstChild("Torso")
local ice = Instance.new("Part", workspace)


if hu~=nil then
he.BrickColor = BrickColor.new(1013)
he.Transparency = 0.7
he.Anchored = true
la.BrickColor = BrickColor.new(1013)
la.Transparency = 0.7
la.Anchored = true
ll.BrickColor = BrickColor.new(1013)
ll.Transparency = 0.7
ll.Anchored = true
ra.BrickColor = BrickColor.new(1013)
ra.Transparency = 0.7
ra.Anchored = true
rl.BrickColor = BrickColor.new(1013)
rl.Transparency = 0.7
rl.Anchored = true
to.BrickColor = BrickColor.new(1013)
to.Transparency = 0.7
to.Anchored = true

ice.Size = Vector3.new(4, 6, 4)  -- Since you called for 'ice', it makes a new instance of a part.
ice.CFrame = CFrame.new(to.Position) -- Position the ice at their torso
ice.Anchored = true
ice.BrickColor = BrickColor.new("Cyan")

ice.Transparency = 0.5

end

end

script.Parent.Touched:connect(onTouched)


Though requests aren't something we should take here, genuine requests for 'How do I do this?' should still be answered if they're simple enough. Have a lovely day.

0
What do you mean a new part? o-o? And i don't understand the body positioning part. SHIFTRK9 -2 — 8y
0
You wanted it to freeze them then put an ice cube around them, yes? Maxwell_Edison 105 — 8y
0
Well that sort of means you need to MAKE the ice cube, and POSITION it properly, right? Jeez Maxwell_Edison 105 — 8y
0
don't be mad ;-; im trying to learn. I thought the body positioning thing needed to be insert with mathematical codes. SHIFTRK9 -2 — 8y
View all comments (8 more)
0
what do you mean mathmatical code? "CFrame.new(to.Position)" - you're literally setting it's position to the position of the torso, there is no fancy code needed. just telling it to go there ;) Maxwell_Edison 105 — 8y
0
oh ok thanks >.< SHIFTRK9 -2 — 8y
0
Btw the ice didn't show up SHIFTRK9 -2 — 8y
0
Then you've done something wrong with the script. Works for me. Maxwell_Edison 105 — 8y
0
eggs ;-; do i need to insert a part into that script or something? SHIFTRK9 -2 — 8y
0
No, just put the script into the part?... It works for me, I don't know why it isn't working for you. Maxwell_Edison 105 — 8y
0
send me the model if it still doesn't work, on roblox. Maxwell_Edison 105 — 8y
0
Oh sure, i sent you a friend request. It's easier for us to contact each other thought. I'm in south asia right now. I'll sent you in the next 8 hours. I'm so sorry for the delay SHIFTRK9 -2 — 8y
Ad

Answer this question