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

Dice gui only shows ups on tool users screen?

Asked by 5 years ago

So my dice script consists of the decals and whatever decal lands up when the dice is thrown, that gui pops up. Well it only shows up on the throwers hand. Is there a fix?

Script: repeat wait(1) until script.Parent.Handle

local player = game.Players.LocalPlayer

local Character = player.Character

local Humanoid = Character.Humanoid

dice = script.Parent.Handle

DrinkAnim = script.Parent.DrinkAnim

local I = dice:FindFirstChild("1").Texture

local II = dice:FindFirstChild("2").Texture

local III = dice:FindFirstChild("3").Texture

local IV = dice:FindFirstChild("4").Texture

local V = dice:FindFirstChild("5").Texture

local VI = dice:FindFirstChild("6").Texture

scolor = script.Parent.Data.SureColor.Value.Color

dcolor = script.Parent.Data.DecideColor.Value.Color

playername = game.Players.LocalPlayer

tool = script.Parent

cooldown = true

rolltime = 0.25

displaytime = 5

script.Parent.Equipped:connect(function(mouse)

mouse.Button1Down:connect(function()

local DrinkAnimTrack = Humanoid:LoadAnimation(DrinkAnim)

if DrinkAnimTrack then

DrinkAnimTrack:Play()

wait(1)

if cooldown == false then return end

cooldown = false

local die = dice:Clone()

die.DieGui.NameButton.Text = playername.Name.."'s dice"

die.Parent = game.Workspace

die.CanCollide = true

--display roll--

--display roll--

local obama = math.random(1,6)

die.DieGui.DieButton.Text = obama

local babes = die:GetChildren()

for i=1, #babes do

if babes[i].ClassName == "Decal" then

if obama == 1 then babes[i].Texture = I elseif obama == 2 then babes[i].Texture = II elseif obama == 3 then babes[i].Texture = III elseif obama == 4 then babes[i].Texture = IV elseif obama == 5 then babes[i].Texture = V elseif obama == 6 then babes[i].Texture = VI end

end end

die.DieGui.DieButton.TextColor3 = scolor

die.DieGui.Active = true

wait(5)

die.DieGui.Active = false

die:Destroy()

cooldown = true

end end)

end)

1 answer

Log in to vote
0
Answered by 5 years ago

You are firing it only on the client side instead of server side. To fire it on server side you must use remote events. You can check this to get an idea: https://developer.roblox.com/api-reference/class/RemoteEvent This to see how the event firing should look like: https://developer.roblox.com/articles/Remote-Functions-and-Events You could also check this youtube tutorial that i think explained it the best (well at least from my pov): https://www.youtube.com/watch?v=4Dc_bri9mjs

0
Im still sort of confused, Im not very good with functions. Pooglies 7 — 5y
0
Just watch the video, it explains it quite well and try repeating what he does and understanding it, that way(and maybe some experimenting) you will get an idea on how to use the remote events but in short, you use a local script to use the remote to fire an event that will affect depending on how many players you want. richboifexekappa 89 — 5y
0
Alright Pooglies 7 — 5y
0
Still not good at this. Pooglies 7 — 5y
View all comments (2 more)
0
I can try helping you understand it better, find me in discord: fexe995#0342 richboifexekappa 89 — 5y
0
Alright, I added you. Pooglies 7 — 5y
Ad

Answer this question