Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

4 comments

0

Edit your question to explain what you want to do clearly.

0

i edited it

0

No requests please! You need to attempt to do it

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.

1 answer

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.

12 comments

0

What do you mean a new part? o-o? And i don't understand the body positioning part.

0

You wanted it to freeze them then put an ice cube around them, yes?

0

Well that sort of means you need to MAKE the ice cube, and POSITION it properly, right? Jeez

0

don't be mad ;-; im trying to learn. I thought the body positioning thing needed to be insert with mathematical codes.

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 ;)

0

oh ok thanks >.<

0

Btw the ice didn't show up

0

Then you've done something wrong with the script. Works for me.

0

eggs ;-; do i need to insert a part into that script or something?

0

No, just put the script into the part?... It works for me, I don't know why it isn't working for you.

0

send me the model if it still doesn't work, on roblox.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.