Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
In a game. I have a dialogue shop. So I am assuming that I put like a free model of some type of armor and then edit my script? How would I make it increase the max health and current health of the player on touch? |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b1 |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b2 |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b3 |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b4
|
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b5 |
|
|
Player.Character.Humanoid.MaxHealth = NumberHere |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
That is not an onTouch event. I don't think that would work. But am I right about just inserting the armor I would like into replicated storage? |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
Oh and what script would I use. Because I do not want to clone the armor into the players inventory, but like weld it to the player. |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b6 |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b7 |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b8 |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b9 |
|
|
There's a function called 'DialogChoiceSelected'
x = script.Parent --Dialog choice
x.DialogChoiceSelected:connect(function(plr, choice)
c = game.Lighting[choice]:clone()
c.Parent = plr.Backpack
end) |
|
|
For changing the MaxHealth, an example would be,
game.Workspace.Part.Touched:connect(function(Toucher)
if Toucher.Parent and game.Players:FindFirstChild(Toucher.Parent.Name) then
Toucher.Parent.Humanoid.MaxHealth = NumberHere
end
end) |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
Ok. And how would I take an armor, put it in replicated storage? And then I need to figure out a script for when it is bought, to weld to the surface of the player? |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
I know that function phoenix. But like I said. I want to weld the armor to the player. Not clone the armor to the backpack. |
|
|
Set it's position via Vector3 and wield it. |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
What is Vector3? Im just looking for a way to like….Put armor in replicated storage. Then once it is bought, using a script that I have no Idea how to make and would weld it to the player. I don't know how to and would like to learn. |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
b10 |
|
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
ok. So basically it is a way of positioning 3D objects….But isn't there some script that I can make where It just clones armor parts to the player's body? |
|
|
There's more then one method of doing that, you'll have to decide and experiment
Armor = Instance.new("Part")
Armor.Position = Player.Torso.Position
That's just an example, also,
http://wiki.roblox.com/index.php?title=Welds |
|
Cheeso135Join Date: 2013-04-13 Post Count: 2016 |
And I could replace armor with the name of the model of armor? And it would weld to the player? |
|
|
You'll have to position and weld it yourself, read the articles I linked for more information. |
|