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

GUI Script won't work on servers?

Asked by 9 years ago
num = 0
butH = script.Parent.Parent.AbsoluteSize.Y/2
wp = {}

for _, v in pairs(Game.Workspace.Waypoints:GetChildren()) do if v:IsA("BasePart") then table.insert(wp, v) end end

script.Parent.CanvasSize = UDim2.new(0, 0, 0, butH * math.floor(#wp/3))

for _, v in pairs(wp) do
    b = _G.addInstance(("Waypoint%sButton"):format(v.Name:gsub("Waypoint", "")), "TextButton", nil, script.Parent)
    b.TextScaled = true
    b.Text = v.Name:gsub("Waypoint", "")
    b.Size = UDim2.new(0.3, 0, 0, butH)
    b.Position = UDim2.new(0.3 * (num % 3), 0, 0, butH * math.floor(num/3))
    b.TextColor3 = Color3.new(0,0,0)
    b.BackgroundTransparency = 1
    _G.addInstance("Waypoint", "ObjectValue", v, b) 
    Game.ServerStorage.Scripts.WaypointButtonScript:Clone().Parent = b  

    num = num + 1
end

script:Destroy()

This script is meant to create this this effect. -In studio Yet this is what it actually yields. -In play mode

The script that sizes and places the GUIs is above the contents of Game.Workspace.Waypoints is:

MovingPlatformWaypoint (BasePart)
SpawnWaypoint (BasePart)

Any insight as to why the GUI looks different?

Answer this question