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

Coffe machine works in studio but not in live? there is no error

Asked by 6 years ago

i made a coffee machine that uses transparency stuff and tool manipulation; the screen is a surfaceGui in a part called "Screen" which has a normal script (not localscript)

but the problem is that when pressing done, it will not make any coffee

function Click()
local username = game.Players.LocalPlayer.Name
local char = game.Workspace:FindFirstChild(username)
if script.Parent.Parent.Parent.Parent.FoamEnabled.Value == true then
script.Parent.Parent.Parent.Parent.Spill4.Transparency = 0
end
script.Parent.Parent.Parent.Parent.Spill.Transparency = 0
script.Parent.Parent.Parent.Parent.Spill2.Transparency = 0
script.Parent.Parent.Parent.Parent.Spill3.Transparency = 0
script.Parent.Parent.Parent.Parent.Mug.Transparency = 0.5
script.Parent.Parent.Parent.Parent.Mug2.Transparency = 1
script.Parent.Parent.Parent.Parent.Spilt.Transparency = 1
script.Parent.Parent.Parent.Parent.Spilt2.Transparency = 1
script.Parent.Parent.Parent.Parent.Spilt3.Transparency = 1
script.Parent.Parent.Parent.Parent.Spilt4.Transparency = 1
wait(5)
if game.Players.LocalPlayer.Backpack:findFirstChild("Mug") == nil and char:findFirstChild("Mug") == nil then
local cof = game.ServerStorage.Mug:Clone()
cof.Parent = game.Players.LocalPlayer.Backpack
if script.Parent.Parent.Parent.Parent.FoamEnabled.Value == true then
cof.FoamEnabled.Value = true
elseif script.Parent.Parent.Parent.Parent.FoamEnabled.Value == false then
cof.FoamEnabled.Value = false
end
cof.Drink1.Transparency = 0
cof.Drink2.Transparency = 0
cof.Drink3.Transparency = 0
cof.Drink4.Transparency = 0
cof.Drink5.Transparency = 0
cof.Drink6.Transparency = 0
cof.Drink7.Transparency = 0
cof.Drink8.Transparency = 0
cof.Drink1.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
cof.Drink2.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
cof.Drink3.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
cof.Drink4.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
cof.Drink5.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
cof.Drink6.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
cof.Drink7.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
cof.Drink8.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
if script.Parent.Parent.Parent.Parent.FoamEnabled.Value == true then
cof.FoamEnabled.Value = true
cof.Foam2.BrickColor = script.Parent.Parent.Parent.Parent.Foam.Value
cof.Foam3.BrickColor = script.Parent.Parent.Parent.Parent.Foam.Value
cof.Foam4.BrickColor = script.Parent.Parent.Parent.Parent.Foam.Value
cof.Foam5.BrickColor = script.Parent.Parent.Parent.Parent.Foam.Value
cof.Foam6.BrickColor = script.Parent.Parent.Parent.Parent.Foam.Value
cof.Foam7.BrickColor = script.Parent.Parent.Parent.Parent.Foam.Value
cof.Foam8.BrickColor = script.Parent.Parent.Parent.Parent.Foam.Value
cof.Foam8.Transparency = 0
end
script.Parent.Parent.Parent.Parent.Spill.Transparency = 1
script.Parent.Parent.Parent.Parent.Spill2.Transparency = 1
script.Parent.Parent.Parent.Parent.Spill3.Transparency = 1
if script.Parent.Parent.Parent.Parent.Spill4.Transparency == 0 then
script.Parent.Parent.Parent.Parent.Spill4.Transparency = 1
end
script.Parent.Parent.Parent.Parent.Mug.Transparency = 1
else
script.Parent.Parent.Parent.Parent.Spill.Transparency = 1
script.Parent.Parent.Parent.Parent.Spill2.Transparency = 1
script.Parent.Parent.Parent.Parent.Spill3.Transparency = 1
script.Parent.Parent.Parent.Parent.Spill4.Transparency = 1
script.Parent.Parent.Parent.Parent.Mug.Transparency = 1
script.Parent.Parent.Parent.Parent.Spilt.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
script.Parent.Parent.Parent.Parent.Spilt2.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
script.Parent.Parent.Parent.Parent.Spilt3.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
script.Parent.Parent.Parent.Parent.Spilt4.BrickColor = script.Parent.Parent.Parent.Parent.Drink.Value
script.Parent.Parent.Parent.Parent.Mug2.Transparency = 0.5
script.Parent.Parent.Parent.Parent.Spilt.Transparency = 0
script.Parent.Parent.Parent.Parent.Spilt2.Transparency = 0
script.Parent.Parent.Parent.Parent.Spilt3.Transparency = 0
script.Parent.Parent.Parent.Parent.Spilt4.Transparency = 0
end
end 

script.Parent.MouseButton1Down:connect(Click)

this is the model https://www.roblox.com/catalog/976000342/redirect

by the way, the mug comes from ServerStorage. it comes with the model, so you have to move the tool to ServerStorage.

0
I tested it 99% of the times it spills and 1 % of the time i get my coffe HALTDEINMAULDUDEN 5 — 6y
0
because it checks if you already have a mug in your inventory or in your hand. if true it will spill. that's why TimeMeddler 0 — 6y

Answer this question