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

Help with fixing Shark script? Sharks & Minnows/Tag EDITED

Asked by 7 years ago

Basically, i'm making a sharks and minnows game and I need help with figuring out how to write the script. so far i have got this:


local Character = script.Parent.Parent.Character local humanoid = Character:FindFirstChild("Torso") function Infect(hit) if hit.Parent:FindFirstChild("Torso") then local player = hit.Parent.Name for i,v in pairs(game.Players:GetChildren()) do if v.Name == player then if v:FindFirstChild("BackPack") then local pack = v:FindFirstChild("BackPack") if pack:FindFirstChild("IsShark") then local IsShark = pack:FindFirstChild("IsShark") if IsShark == false then IsShark = true end

EDIT:I'm trying to make the script so that once a round starts, the main script will scan through all the players and if the value in their Backpack (IsShark) is set to true, then it will enable the script I have shown above, which should run a function so that when a 'shark' touches a person who isn't a 'shark' that person will have this script activated and there walkspeed changed

this is a script inside StarterPack and there are two boolValues in starterpack too, IsShark and IsPlaying. I have it so when the IsShark value is changed to true, it should change a players walkspeed and enable this script inside their backpack. However, i have trialed this and it won't work. I'm not too good with scripts like this one and any help would be useful. If you need more information, just ask.This is all in a Normal script**** (in the script, the function and if state,ment ends have been cut off i dont know why)**

0
i suppose you do have all the end's in the original? RubenKan 3615 — 7y
0
yes, might not of made that too clear turtle2004 167 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

When you compare BoolValues in if statements, you need to use .Values. i. e. ~~~~~~~~~~~~~~~~~ if IsShark.Value == true then print("Heh..") end ~~~~~~~~~~~~~~~~~

Ad

Answer this question