Ad
Log in to vote
0

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

Asked by 2 months 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 — 2mo
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 Somethings_wrong 0 — 2mo

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

Answer this question



Ad