generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Hat giver for one morph only?

Previous Thread :: Next Thread 
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 02:53 PM
Hello, I'm trying to make a script for a hat giver... but there is one problem.. I need it so that only one morph can pick up that hat... This is a little bit complicated (no really? lol) but let me explain it's purpose.

I'm creator of a roblox game series called Humans vs. Arthropods or HvA for short (if you heard of it or not) and I'm currently working on hva 6, In HvA you become either a human and get a weapon and teleport to the arena/map or you become a giant insect, arachnid, or crustecean and bite, poison, pinch, (I think you get the point) its pretty much the same as arachnids vs. mankind by spider1034 if you played that game but a little more advanced. Any who.. In hva 6 I plan on it being an ocean themed area which is in progress. I was thinking about adding a type of crustecean called a decorator crab to be playable. A decorator crab (in real life) picks up sponges, corals, plants, sand etc and puts it on their bodies for camo. I want to do something like that in hva 6, where there are sponges and such laying around that the crab can pick up. of couse the only way to do that is to make them all hats with meshes and edit their positions so they go on the crab's arm's, legs, etc. But how is that preventing the other morphs and players from picking them up? I was thinking of multiply ways to do this... I can make it a vip script where the player wears a vip shirt for the decorator crab and I make it so the morph keeps it and shirt just remains hidden rather than deleting it like most morphs, and then make it so that only players who are wearing that shirt can pick up the "hat".. or I can make it much more simple with the idea of having the morph itself only be able to pick up the "hats". I'm new to scripting so help would be appreciated and credited.

To sum things up I basicly need to know how to make it so that only 1 morph players become is capable of picking up hats, thank you!
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 02:59 PM
bump?
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
11 Jul 2013 03:01 PM
So are you saying, one team, or one player? And what I mean by team is by one type of species.
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 03:02 PM
one player
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 03:04 PM
its one player becomes a decorator crab, only that one player can pick up the "hats" but of course other players will be capable of playing as the crab at the same time also with the same ability.
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
11 Jul 2013 03:08 PM
script.Parent.Touched:connect(function(hit)
if hit.Parent.Humanoid~=nil then
if hit.Parent.CanGetHat.Value==1 then ++OR++ if hit.Parent.Name =="JohnnyCash" then
-------Give them hat---------
end
end
end


Just put a Number value in the player when they spawn, and when they touch a hat just make it to where it puts a statements to check if he/she's allowed to have it.

Other than that I really don't know what you're trying to do.
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
11 Jul 2013 03:10 PM
Well then go with the first option. When the player is selected put an instance.new("NumberValue") in him and put the value as 1 so only he can get it.
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 03:18 PM
Was that the entire script that I insert into the handle of the hat?
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 03:24 PM
ok, I made it so that whenever someone steps on the morph pad it gives the player the value.

local debounce = false

function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end

function onTouch(part)

local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then

debounce = true

local player = getPlayer(human)

if (player == nil) then return end

script.Parent:clone().Parent = player

wait(2)
debounce = false
end
end


script.Parent.Parent.Touched:connect(onTouch)

I inserted that into a NumberValue and changed it to 1. When testing it in studio it inserts the value into "Player1" under "Players"... or is it apposed to be inserted into the player model under workspace?
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
11 Jul 2013 03:31 PM
This is why I don't help that much, I'm horrible at it!

What I'm trying to say is whenever someone joins the game insert a number value.
Then when the crab person is chosen change that value to one in him. So whenever he steps on a hat only he can get it and no one else. And at the end of the game change the value back to 0.

I can't script it out, because I have no script to work from.
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 03:55 PM
ok well when the player dies or respawns the value should reset to 0 so this is perfect. I can make it change the value when stepping on the morph pad, now how do I make the hats for the player to pick up... I don't know how I should do this... if the script you provided was for that how should I insert it...
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 04:01 PM
and also... how do I write the script to give the numbervalue?...
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
11 Jul 2013 04:02 PM
Just edit the script and add the if value. So when the player touches the hat or the button for the hat it will check.
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 04:36 PM
Ok we both know what we're trying to do. The value thing will work perfectly. I'm only a beginner scripter and have no idea how to script any of this...
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 04:47 PM
bump?
Report Abuse
metr0idhunterx is not online. metr0idhunterx
Joined: 15 Feb 2011
Total Posts: 257
11 Jul 2013 05:15 PM
Actually I thought of a much easier... less annoying way to do this... simply just going to create a room where the player can put on the hats before they enter the arena....
:3
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image