This is one of the scripts
part=script.Parent function collect(part1) part:Destroy() print("bob") part1.Item.Coke.Value+1 end part.ClickDetector.MouseClick:connect(collect)
Here is another.
game.Players.PlayerAdded:connect(function(player) local Item= Instance.new("Model") Item.Name = "Item" Item.Parent=player wait(1) local Coke=Instance.new("IntValue") Coke.Name="Coke" Coke.Parent=player.Item Coke.Value=0 end)
So basically what the first script wants is when you click the part it destroys itself and also adds a value to the player What the second one does is add a value into the player and this is the value that the first scripts adds onto. So the problem is it wont add. The addition sign in the first script has a red line under it but thats all i know.
To use addition to IntValues and all of that stuff you have to do it like this part1.Item.Coke.Value = part1.Item.Coke.Value + 1
.
And I am pretty sure that after you destroy the part where the script is held, the rest of the code won't execute.
First script
Your function "collect" has a parameter called "part1" so when calling it you have to define the parameter, silly!
part.ClickDetector.MouseClick:connect(collect) -- NO PARAMETER part.ClickDetector.MouseClick:connect(collect(--[[WHATEVER YOU WANT part1 TO BE]]))
Hehe
Otherwise line 4 of your function is not acting on anything and breaking the code, since Part1 is not defined
Second script
Item is a variable in your code as well as an item in the player so when calling
player.Item
Since you defined "Item" as "the player that joined's item" you are actually doing:
Player.Player.Item
Instead do
.Parent = Item