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

How do I make a flag script to take flag and take it back to your base? [closed]

Asked by 5 years ago

I was wondering if anyone could help me make a flag script, I am trying to make a flag on one teams side only, and I want to script it as if a enemy from the other team grabs the flag, they take it back to their base on a certain 'part' where the flag dissapears when you reach your base, and your entire team gains a point for it. Then the flag regenerates back on the other team, and you have to try repeat the process all over again. If anyone knows how to do this, please let me know, thanks!

0
THIS IS NOT A SCRIPT REQUEST SCRIPT. Instead why don't you try to make one for yourself and If you have problems regarding your script, then you can ask on this site on how to 'fix' it or 'why' is it not working... NickAtNick 163 — 5y

Closed as Not Constructive by Fifkee, JakyeRU, zblox164, namespace25, and BlueTaslem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago

First you need to figure out what mechanics you what the player to use for picking up the flag.

Touching it? [ Touched:Connect ] Key stroke? [ game:GetService("UserInputService").InputBegan:connect ] Mouse Click? [ Mouse.Button1Down:connect ]

Then how you want the player to hold the flag.

In hand? [ humanoid:EquipTool ] In backpack? [ .Parent = Player.Backpack ]

Then you use the Touched event to make a triggered plate to Destroy() the flag the player is carrying.

0
game:GetService("UserInputService").InputBegan:connect ] [ Mouse.Button1Down:connect ] [ humanoid:EquipTool ] Wouldn’t work if I did try that, so how would I make all of that function in a script exactly? MrMultiMusic -9 — 5y
0
So the player will have to touch the flag in order to grab the flag?? doncellanerdy 21 — 5y
0
The player will have to touch the flag in order to grab it, it goes on their back (if possible) or hand. MrMultiMusic -9 — 5y
0
You can place it on their back but I have never done anything like that. As for the rest you can start out by using {flagPart}.Touched:Connect() to place the flag into the players backpack by making the parent Player.Backpack. doncellanerdy 21 — 5y
View all comments (8 more)
0
Either one is fine. But how would I do the script? That's the hardest part here. MrMultiMusic -9 — 5y
0
If you can't make the script with the suggestion I gave you sounds like you should probably start with something a bit more easier. https://www.youtube.com/watch?v=pY-s57Ap6AE this video show you how to use the touched event. doncellanerdy 21 — 5y
0
Ok. I have watched that video, understood etc. Do you have any other links to how to do this // if you could expain how to do this? MrMultiMusic -9 — 5y
0
Because if I were to use touched event, I'd need to use Destroy() to destroy the flag out of the players inventory, however that would need to function points for teams aswell... MrMultiMusic -9 — 5y
0
I've been looking at the ROBLOX wiki for help, destroy script etc. Just very confusing.. MrMultiMusic -9 — 5y
0
For destroy you find the flag and just put :destroy(). I will find an example, for you to follow if you still need one. doncellanerdy 21 — 5y
0
Yes please do. If it could give leaderboard points when it touches the part, would be a great help. Thanks MrMultiMusic -9 — 5y
0
This is what I use to find and destroy an item from the players backpack Player.Backpack:FindFirstChild("Key"):Destroy() You need to define player depending where the code goes. Do you have the leaderboard created? doncellanerdy 21 — 5y
Ad